• 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!
  • Akari, Selene, Mint, Solana - 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.

Implementing Vivillion's forms

rigbycwts

Hmm, hmm.
  • 94
    Posts
    12
    Years
    • Seen Feb 22, 2019
    In order to implement Vivillon's forms, first I modify the sample event that sets the player's location so that it downloads the country code to global variable 51:
    Spoiler:

    Next, in MultipleForms, I added the following:
    Code:
    MultipleForms.register(:SCATTERBUG,{
    "getFormOnCreation"=>proc{|pokemon|
       monsoonCountries = [] # Countries where this form can be obtained
       jungleCountries = ["PH"]
       oceanCountries = []
       sunCountries = []
       savannaCountries = []
       riverCountries = []
       sandstormCountries = []
       highPlainsCountries = []
       archipelagoCountries = []
       marineCountries = []
       modernCountries = []
       icySnowCountries = []
       elegantCountries = []
       gardenCountries = []
       continentalCountries = []
       tundraCountries = []
       polarCountries = []
       if monsoonCountries.include?($game_variables[51])
         next 17
       elsif jungleCountries.include?($game_variables[51])
         next 16
       elsif oceanCountries.include?($game_variables[51])
         next 15
       elsif sunCountries.include?($game_variables[51])
         next 14
       elsif savannaCountries.include?($game_variables[51])
         next 13
       elsif riverCountries.include?($game_variables[51])
         next 12
       elsif sandstormCountries.include?($game_variables[51])
         next 11
       elsif highPlainsCountries.include?($game_variables[51])
         next 10
       elsif archipelagoCountries.include?($game_variables[51])
         next 9
       elsif marineCountries.include?($game_variables[51])
         next 8
       elsif modernCountries.include?($game_variables[51])
         next 7
       elsif icySnowCountries.include?($game_variables[51])
         next 6
       elsif elegantCountries.include?($game_variables[51])
         next 5
       elsif gardenCountries.include?($game_variables[51])
         next 4
       elsif continentalCountries.include?($game_variables[51])
         next 3
       elsif tundraCountries.include?($game_variables[51])
         next 2
       elsif polarCountries.include?($game_variables[51])
         next 1
       else # Meadow - Default
         next 0
       end
    }
    })
    
    MultipleForms.copy(:SCATTERBUG,:SPEWPA)
    
    MultipleForms.copy(:SCATTERBUG,:VIVILLON)
    In this snippet, in order to test the form change (The form number in the Debug menu), I put the country code of my current location to the jungleCountries array.
    However, after capturing a wild Scatterbug, then selecting the "form" in the Pokemon's Debug menu, the form number is 0 instead of being set to, in this example, 16. Is $game_variables similar to the global variables that can be accessed in the event editor?
    EDIT: fixed internal name typo
     
    Last edited:
    You should be using the "get form on creation" proc instead of a regular one. Look at Basculin.
    I am using getFormOnCreation. I was only confused on the global variable part.

    EDIT: Turns out that I typo'd Vivillon's internal name, it now works.
     
    Last edited:
    Back
    Top