• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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
    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



    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:
    Thanks for this, it's going to be very useful.
     
    Back
    Top