• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Cyndy, May, Hero (Conquest), or Wes - 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] Multiple forms and movesets

  • 224
    Posts
    9
    Years
    • Seen Feb 20, 2025
    I am trying to define several movesets for species based on a criteria of differentiation (for example, between a shiny and a non-shiny).
    Is there a way to make something like this work:

    Code:
    MultipleForms.register(:SANDSHREW,{"getMoveList"=>proc{|pokemon|
      movelist=[[1,:DRAGONHAMMER],[1,:SEEDBOMB],[1,:BARRAGE],[1,:HYPNOSIS],
                [1,:CONFUSION],[17,:PSYSHOCK],[27,:EGGBOMB],[37,:WOODHAMMER],
                [47,:LEAFSTORM]]
      for i in movelist
        i[1]=getConst(PBMoves,i[1])
      end
      next movelist [COLOR="Red"]if pokemon.isShiny?[/COLOR]
    }

    When I give the player 2 Sandshrews, one of them being shiny and not the other:

    Code:
    $Trainer.party=[]
    pkmn=PokeBattle_Pokemon.new(:SANDSHREW,46)
    pkmn.makeShiny
    $Trainer.party.push(pkmn)
    pkmn2=PokeBattle_Pokemon.new(:SANDSHREW,46)
    $Trainer.party.push(pkmn2)

    ... BOTH Sandshrews always acquire the same moveset!

    I've tried small variations such as this one:
    Code:
    "getMoveList"=>proc{|pokemon|
      [COLOR="Red"]next if !pokemon.isShiny?[/COLOR]
      movelist=[[1,:DRAGONHAMMER],[1,:SEEDBOMB],[1,:BARRAGE],[1,:HYPNOSIS],
                [1,:CONFUSION],[17,:PSYSHOCK],[27,:EGGBOMB],[37,:WOODHAMMER],
                [47,:LEAFSTORM]]
      for i in movelist
        i[1]=getConst(PBMoves,i[1])
      end
      next movelist
      movelist=[]
    },

    I always got the same results. Either the 2 Sandshrews, the shiny and the non-shiny one, learn this moveset, or they don't.

    This part of code is used in various Delta/Alolan custom scripts and seem to never work properly.

    Does someone know a way to make this work (other than updating to v17?)
     
    Back
    Top