- 41
- Posts
- 15
- Years
- Seen Apr 12, 2023
First off I use the May 2010 version of Pokemon Essentials.
This is the def that I use to update sprites during battle for Pokemon like Castform, Cherim, Darmantian, and any others that change forms in battle. I'm not a great coder so I'm not gonna say this is best way to do it but it is the way I discovered myself and no one had come out with anything else when I coded this.
Place the def pbUpdateSprites after the def pbStartBattle in PokeBattle_ActualScene
of course lets say you want castform's sprite to change so in pbForecast you would use this function call @battle.scene.pbUpdateSprites(@index) in one of the areas where castform's type changes. However, this function must be used in combination with other coding to force the sprite to change. Which will require edits to pbLoadPokemonBitmapSpecies and any other relivant section of code.
Please credit Tai Mao/taimao if you use this script in your project.
This is the def that I use to update sprites during battle for Pokemon like Castform, Cherim, Darmantian, and any others that change forms in battle. I'm not a great coder so I'm not gonna say this is best way to do it but it is the way I discovered myself and no one had come out with anything else when I coded this.
Place the def pbUpdateSprites after the def pbStartBattle in PokeBattle_ActualScene
Code:
def pbUpdateSprites (spriteIndex)
[email protected][spriteIndex].pokemon
return if @sprites["pokemon#{spriteIndex}"]==nil
if spriteIndex==0 ||spriteIndex==2
@sprites["pokemon#{spriteIndex}"].setPokemonBitmap(pkmn,true)
else
@sprites["pokemon#{spriteIndex}"].setPokemonBitmap(pkmn,false)
end
@sprites["pokemon#{spriteIndex}"].update
end
Please credit Tai Mao/taimao if you use this script in your project.
Last edited: