• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Update Sprites in battle script for Pokemon Essentials

41
Posts
14
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



    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
    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.
     
    Last edited:
    Back
    Top