Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2015-10-22 13:00:57

Schattenjäger
Member
Registered: 2015-10-21
Post 1/25

A Few Pokered Questions

I discovered pokered this spring, and have been dabbling with on and off since then. I've mastered a lot of stuff, but I have a few questions to ask people more experienced than me. Helping "noobs" is frowned upon in Pokémon rom hacking, but I'm actually motivated to learn and do know some of the basics already.

I'd like to create custom move effects that have a "dual" effect, such as Bulk Up raising both attack and defense at the same time.

I've been looking into StatModifierUpEffect, but I'm still confused as to what exactly dictates what in the code. What exactly is the function that tells the game to raise attack with ATTACK_UP1_EFFECT, for instance? I'm pretty sure what I want could be accomplished by creating a move effect that "connects" attack_up and defense_up, but for some reason I haven't been able to get ahead. Or maybe I'm completely off base to begin with. I'm not looking for someone to do it for me, I just need a push in the right direction, if someone knows how to do this. I have a feeling it shouldn't be too hard.

Another effect I would like to do is having the user's stat reduced after use, such as Draco Meteor and Overheat.

Another issue is that after Pokémon 189 - it could be 190, but I'm pretty sure 189 - the pokémon's start menu list palettes are black and white. They function correctly in battle and in the pokédex screen, but are black and white in the start menu screen. Has anyone encountered this?

chimchar1

chimchar2

Last edited by Schattenjäger (2015-10-22 13:01:12)

Offline

#2 2015-10-22 14:15:50

Crystal_
Member
From: Spain
Registered: 2012-09-16
Post 327/435
Website

Re: A Few Pokered Questions

In core.asm there's a table called MoveEffectPointerTable that maps each effect id to a function. This will bring you to StatModifierUpEffect for ATTACK_UP1_EFFECT. This function was only made to raise one stat, but you could create a new effect that executes the StatModifierUpEffect function twice for two different stats. The reason ATTACK_UP1_EFFECT specifically raises attack and not another stat is because the stat up effect ids are ordered by stat id (e.g. DEFENSE_UP1_EFFECT is the next constant to ATTACK_UP1_EFFECT, so by substracting ATTACK_UP1_EFFECT, the game ends up with a value between 0 and the number of stats that it can use to identify the stat involved. This value is what ends up in register c at line 7569 and is then added to hl to point to the correct stat mod.
So you could create a new effect like ATK_DEF_UP1_EFFECT that you map to a TwoStatModifierUpEffect that first calls StatModifierUpEffect with the wPlayerMoveEffect or wEnemyMoveEffect address (based on whose turn it is) containing the value ATTACK_UP1_EFFECT and then call it again with that address containing DEFENSE_UP1_EFFECT. Then you can restore it to the original ATK_DEF_UP1_EFFECT value. You also have to add your new effect to the ResidualEffects2 array.

Another effect I would like to do is having the user's stat reduced after use, such as Draco Meteor and Overheat.

You could make use of the StatModifierDownEffect function calling it with the turn value inverted. You should also check out the PoisonEffect function (for example) to see how side effects (e.g Poison Sting) are handled compared to non-damaging move effects (e.g. Posionpowder). For example, side effects are not added to any of the residual effects array (because they are executed after damage calculation) and don't call MoveHitTest (they already called it to determine if the move will deal damage).

The last Pokemon has index number 190 so there's probably some function that makes pokemon with invalid number use a grey palette by default.

Offline

#3 2015-10-22 20:33:20

Danny-E 33
Administrator
Registered: 2012-06-09
Post 917/1,044

Re: A Few Pokered Questions

Schattenjäger wrote:

Another issue is that after Pokémon 189 - it could be 190, but I'm pretty sure 189 - the pokémon's start menu list palettes are black and white. They function correctly in battle and in the pokédex screen, but are black and white in the start menu screen. Has anyone encountered this?

This happens when the status screen palette packet is being built in SetPal_StatusScreen: in engine/palettes.asm
If a Pokemon's ID is beyond VICTREEBEL, the ID in register a gets overwritten with RHYDON before calling DeterminePaletteIDOutOfBattle.


Red Hack: Pokémon Prototype

Total number of registered users: 8000+
Total number of active users: ~12

Offline

#4 2015-10-22 21:34:22

Schattenjäger
Member
Registered: 2015-10-21
Post 2/25

Re: A Few Pokered Questions

Thanks a bunch, Crystal. That cleared things up for me, I think I can make it work with your advice.

And thanks a bunch, Danny, too, the palette thing was actually pretty obvious, I should have looked into it more. I replaced Victreebel with num_pokemon.

Last edited by Schattenjäger (2015-10-22 21:35:10)

Offline

#5 2015-10-23 14:10:30

Danny-E 33
Administrator
Registered: 2012-06-09
Post 918/1,044

Re: A Few Pokered Questions

NUM_POKEMON probably isn't the correct solution, unless you replaced the internal ID order with the Pokedex order, which is doable. But if the Pokemon are still in their original order, you probably want to replace VICTREEBEL, in engine/palettes.asm, with what ever last Pokemon you added beyond VICTREEBEL in constants/pokemon_constants.asm.


Red Hack: Pokémon Prototype

Total number of registered users: 8000+
Total number of active users: ~12

Offline

#6 2015-10-23 14:58:23

Schattenjäger
Member
Registered: 2015-10-21
Post 3/25

Re: A Few Pokered Questions

Yes, you're right. I've actually re-organized the internal IDs using the pokédex order. Thanks, anyway. :)

Offline

Board footer

Powered by FluxBB