• 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!
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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] Change Forme on Move Use

thepsynergist

Vinemon: Sauce Edition Programmer and Composer
  • 790
    Posts
    16
    Years
    Heya, got a question I'm hoping can be answered.

    I have a custom move that combines Spit Up and Swallow, called Purge. I have a fakemon that needs to change form when using Stockpile, and revert back to it's original forme when using Purge. Any clue how I can do this?
     
    Try to look for the code I made for Gulp Missile: Cramorant will change its form after use Surf or Dive.
     
    Heya, got a question I'm hoping can be answered.

    I have a custom move that combines Spit Up and Swallow, called Purge. I have a fakemon that needs to change form when using Stockpile, and revert back to it's original forme when using Purge. Any clue how I can do this?


    Add these lines to the code of Stockpile:
    Code:
    if isConst?(attacker.species,PBSpecies,:FAKEMON) && attacker.form==0
       attacker.form=1
    end

    And add this to Purge:
    Code:
    if isConst?(attacker.species,PBSpecies,:FAKEMON) && attacker.form==1
       attacker.form=0
    end

    And in pbResetForm replace this:
    Code:
    (self.species,PBSpecies,:XERNEAS)
    with this :
    Code:
     isConst?(self.species,PBSpecies,:XERNEAS) ||
    isConst?(self.species,PBSpecies,:FAKEMON)
     
    Does the placement of those form checks matter within the move effect?
    Yes.

    I do not have access to my PC right now, but check out the Gulp Missile Code made by WolfPP and figure out the placement accordingly. It should be after the part which calculates damage done.

    Also check if you have entered the appropriate data in pokemonforms.txt and have the sprite in the battlers folder with the correct filename. Eg 891_1, 891b_1, 891s_1, 891sb_1.
     
    I was able to get it working! Thank you so much for your help!
    Code:
         if isConst?(attacker.species,PBSpecies,:BUNJI) && attacker.form==0
         case rand(4)
          when 0; Audio.se_play("Audio/SE/bunji_cooking.ogg", 90)
          when 1; Audio.se_play("Audio/SE/bunji_spotHit.ogg", 90)
          when 2; Audio.se_play("Audio/SE/bunji_rich.ogg", 90)
          when 3; Audio.se_play("Audio/SE/bunji_niceJuicy.ogg", 90)
         end 
         attacker.form=1
         attacker.pbUpdate(false)
         @battle.scene.pbChangePokemon(attacker,attacker.pokemon)
         PBDebug.log("[Form changed] #{attacker.pbThis} changed to form #{attacker.form}")
        end
    I had this for Stockpile, and I swapped the other's for it's main move, Purge. Works like a charm.
     
    Back
    Top