• 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 Trading Card Game 2 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.

[Scripting Question] Form-specific wild encounters

Tigerfang98

Elite 4
  • 44
    Posts
    11
    Years
    • Seen Aug 28, 2017
    How do you make form-specific wild Pokemon encounters? For example, only a certain form of shells or unown
     
    Last edited by a moderator:
    Oh, I had to do this in my own game!
    Code:
    "getFormOnCreation"=>proc{|pokemon|
       maps=[5]   # Map IDs for form
       if $game_map && maps.include?($game_map.map_id)
         next 1
       else
         next 0
       end
    },
    Just add the ids of the maps that you want the second form to appear on.
    If you have multiple forms, you could either make multiple arrays, randomly select, or do a case block.
    I'm in the mood to code, so have some examples.
    Multiple arrays:
    Spoiler:
    Randomly selected on certain maps (random number)
    Spoiler:
    Randomly selected on certain maps (Personal ID)
    Spoiler:
    Case block of map ids:
    Spoiler:
    I didn't really test my examples, but the first one I pasted does work for a fact!

    EDIT: By the way, this is the code for Shellos:
    Code:
    MultipleForms.register(:SHELLOS,{
    "getFormOnCreation"=>proc{|pokemon|
       maps=[2,5,39,41,44,69]   # Map IDs for second form
       if $game_map && maps.include?($game_map.map_id)
         next 1
       else
         next 0
       end
    }
    })
    And this is the code for Unown:
    Code:
    MultipleForms.register(:UNOWN,{
    "getFormOnCreation"=>proc{|pokemon|
       next rand(28)
    }
    })
     
    Last edited:
    Back
    Top