- 6
- Posts
- 3
- Years
- He/Him
- 25.0000 N 71.0000 W
- Seen Nov 11, 2023
I'm trying to implement a custom ability that will cause a Pokémon to change into a completely different randomly generated Pokémon. For context, this Pokémon is only ever given to an NPC trainer. Example: The Pokémon comes out into battle turn 1, and the ability immediately selects a random Pokémon to transform into. The ability then functions similarly to imposter (reusing the respective Ability Handler), albeit without the 5 PP drawback and it copies the HP stat.
This part of my script works fine, but the problem arises when the new Pokémon is switched out for whatever reason. This resets the Pokémon back to its original species, but I'd like for the Pokémon to be completely replaced by whichever randomly generated Pokémon is selected so that it can be switched out and retain all of the information for that randomly generated Pokémon.
I'm assuming this is either because I reused some of the code for imposter and its coded to reset back to a ditto (or whatever its original species is) when its switched out, or the battle mechanics are set to function like that in general. Unfortunately, for some reason I haven't been able to locate where in the game this happens for the life of me. Does anyone know where/how to either
A: Change the battle mechanics so that it won't reset the random battlers data back to its original data once it's switched out after it has transformed
B: Completely replace all of the battlers data mid-fight so that the game doesn't keep the original species that it'll want to reset back to
or perhaps even
C: Some other viable solution I haven't considered yet
I've been experimenting with this for hours now, and at this point I figure that I'm gonna hate myself if I don't just try posting this here. If something here doesn't make sense then feel free to let me know and I'll try to elaborate further. Any suggestions are appreciated.
This part of my script works fine, but the problem arises when the new Pokémon is switched out for whatever reason. This resets the Pokémon back to its original species, but I'd like for the Pokémon to be completely replaced by whichever randomly generated Pokémon is selected so that it can be switched out and retain all of the information for that randomly generated Pokémon.
I'm assuming this is either because I reused some of the code for imposter and its coded to reset back to a ditto (or whatever its original species is) when its switched out, or the battle mechanics are set to function like that in general. Unfortunately, for some reason I haven't been able to locate where in the game this happens for the life of me. Does anyone know where/how to either
A: Change the battle mechanics so that it won't reset the random battlers data back to its original data once it's switched out after it has transformed
B: Completely replace all of the battlers data mid-fight so that the game doesn't keep the original species that it'll want to reset back to
or perhaps even
C: Some other viable solution I haven't considered yet
I've been experimenting with this for hours now, and at this point I figure that I'm gonna hate myself if I don't just try posting this here. If something here doesn't make sense then feel free to let me know and I'll try to elaborate further. Any suggestions are appreciated.