• 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.

[Scripting Question] How can I make the screen white during a battle through scripting?

90
Posts
6
Years
    • Seen Nov 24, 2023
    My game is made with Version 17.2. I'm trying to change "Def pbchangepokemon" so that, when a pokemon changes form, a white screen appears (like when you throw a pokeball) and fades away after the pokemon has changed sprites.

    Here's how I changed the code by using .movetone, but all it does is only change the color of the pokemon transforming and it also messes up its sprite position.

    Code:
    def pbChangePokemon(attacker,pokemon)
    
        spritePoke=@sprites["pokemon#{attacker.index}"]
    
        picturePoke=PictureEx.new(spritePoke.z)
    
        picturePoke.moveTone(6,1,Tone.new(255,255,255,0))
    
        pbWait(6)
    
        pkmn=@sprites["pokemon#{attacker.index}"]
    
        shadow=@sprites["shadow#{attacker.index}"]
    
        [email protected]?(attacker.index)
    
        pkmn.setPokemonBitmap(pokemon,back)
    
        pkmn.x=-pkmn.bitmap.width/2
    
        pkmn.y=adjustBattleSpriteY(pkmn,pokemon.species,attacker.index)
    
        if @battle.doublebattle
    
          case attacker.index
    
          when 0
    
            pkmn.x+=PokeBattle_SceneConstants::PLAYERBATTLERD1_X
    
            pkmn.y+=PokeBattle_SceneConstants::PLAYERBATTLERD1_Y
    
          when 1
    
            pkmn.x+=PokeBattle_SceneConstants::FOEBATTLERD1_X
    
            pkmn.y+=PokeBattle_SceneConstants::FOEBATTLERD1_Y
    
          when 2
    
            pkmn.x+=PokeBattle_SceneConstants::PLAYERBATTLERD2_X
    
            pkmn.y+=PokeBattle_SceneConstants::PLAYERBATTLERD2_Y
    
          when 3
    
            pkmn.x+=PokeBattle_SceneConstants::FOEBATTLERD2_X
    
            pkmn.y+=PokeBattle_SceneConstants::FOEBATTLERD2_Y
    
          end
    
        else
    
          pkmn.x+=PokeBattle_SceneConstants::PLAYERBATTLER_X if attacker.index==0
    
          pkmn.y+=PokeBattle_SceneConstants::PLAYERBATTLER_Y if attacker.index==0
    
          pkmn.x+=PokeBattle_SceneConstants::FOEBATTLER_X if attacker.index==1
    
          pkmn.y+=PokeBattle_SceneConstants::FOEBATTLER_Y if attacker.index==1
    
        end
    
        if shadow && !back
    
          shadow.visible=showShadow?(pokemon.species)
    
        end
    
        picturePoke.moveTone(0,picturePoke.totalDuration,Tone.new(0,0,0,0))
    
        loop do
    
          picturePoke.update
    
          setPictureSprite(spritePoke,picturePoke)
    
          pbGraphicsUpdate
    
          pbInputUpdate
    
          pbFrameUpdate
    
          break if !picturePoke.running?
    
        end
    
      end

    Can anyone help me make this code work properly? ($game_screen.start_tone_change does not work, either)
     
    1,407
    Posts
    10
    Years
    • Seen yesterday
    I dont think that's really the best place to be making these edits. As the name of the method implies, pbChangePokemon changes things about the Pokemon sprite, so its going to apply these edits specifically to the sprite being changed, not to the general battle scene.

    What youre trying to do sounds more like youre trying to create an animation that plays when certain things are triggered, which sounds like a common animation to me. Look at how something like Mega Evolution works, since that plays an animation upon changing forms and is similar to what youre doing here.
     
    Back
    Top