v18 Alternate Forms and Regular Forms in same encounter table?

This thread pertains to v18 of Pokémon Essentials.

ValiantSoul

World Traveller
Member
Joined
Sep 12, 2020
Posts
27
Age
26
Hey again!

I was wondering if there was some way to have both a Pokemon, and it's alternate form, defined on the same encounter table at different odds?

Example:
Ruby:
LandDay
    TAILLOW,3,4
    CATERPIE,2,4
    CATERPIE,5
    TAILLOW,6
    PARAS,4,5
    PARAS,4,5
    BURMY,4,5
    PACHIRISU,5,6
    METAPOD,7
    KLINK,3,5
    PARAS,3,5
    PACHIRISU_1,5,6

So far it doesn't seem to work, and I'm not sure how to code it in such a way that it does. Any help hugely appreciated!
 

NettoHikari

Trainer
Member
Joined
Jan 4, 2019
Posts
97
You could try making the Pachirisu defined as a regular Pachirisu in encounters.txt, then making an "encounter modifier" at the bottom of the script section PField_EncounterModifiers:
Ruby:
Events.onWildPokemonCreate += proc { |_sender, e|
  pokemon = e[0]
  if $game_map.map_id == YOUR_MAP_ID && pokemon.isSpecies?(:PACHIRISU) && rand(60) < 10
    pokemon.form = 1
  end
}
Where YOUR_MAP_ID is the ID of the map where you defined the encounters you listed above. When this code runs, it will check that "pokemon" is indeed a Pachirisu encountered on the map of your choosing, and if so it has a 1/6 chance of turning it into form 1 (which makes it 5% Pachirisu and 1% form 1 overall).
 

ValiantSoul

World Traveller
Member
Joined
Sep 12, 2020
Posts
27
Age
26
If you're using Essentials v18 then doing RATTATA_1 will work.
Hey bud,

I figured that would be true, but having Pachirisu_1 on the encounter table makes it appear as a blank slot once the game boots up. I don't believe I have changed the enconuter table since creating the save either, so that shouldn't be an issue.
 

ValiantSoul

World Traveller
Member
Joined
Sep 12, 2020
Posts
27
Age
26
You could try making the Pachirisu defined as a regular Pachirisu in encounters.txt, then making an "encounter modifier" at the bottom of the script section PField_EncounterModifiers:
Ruby:
Events.onWildPokemonCreate += proc { |_sender, e|
  pokemon = e[0]
  if $game_map.map_id == YOUR_MAP_ID && pokemon.isSpecies?(:PACHIRISU) && rand(60) < 10
    pokemon.form = 1
  end
}
Where YOUR_MAP_ID is the ID of the map where you defined the encounters you listed above. When this code runs, it will check that "pokemon" is indeed a Pachirisu encountered on the map of your choosing, and if so it has a 1/6 chance of turning it into form 1 (which makes it 5% Pachirisu and 1% form 1 overall).

And thanks for the advice dude! I haven't tried it yet due to the above post (so I gotta try and figure out what's wrong here) but I will if that fails!
 
Top