Advertiser Content
Male
Unova
Seen 3 Hours Ago
Posted 7 Hours Ago
137 posts
11.4 Years
I have been experimenting with Pokemon spawning in the over-world with much success, the only real issue I am running into is I don't know how to check the player coordinates on the map so I don't spawn a Pokemon on top of the player.

As for the Pokemon generated in the grass, I believe you can use a RNG to create modified encounters based on a number of variables.
This sounds like a fun project, shoot me a pm if you're interested in some help build a Wilds Area.
Developing Pokémon: World Saga
Male
Unova
Seen 3 Hours Ago
Posted 7 Hours Ago
137 posts
11.4 Years
RNG is Random Number Generator.

In the script editor find PField_EncounterModifiers.

Right underneath this.
Events.onWildPokemonCreate+=proc {|sender,e|
   pokemon=e[0]
   if $game_switches[SHINY_WILD_POKEMON_SWITCH]
     pokemon.makeShiny
   end
}
Paste this.
Events.onWildPokemonCreate+=proc {|sender,e|
   pokemon=e[0]
   if $game_switches[Your_Switch]
     pokemon.species=PBSpecies::BULBASAUR
   end
}
This will just turn the Pokemon into Bulbasaur, but you can choose which ever Pokemon you want.
However it doesn't end there, this will only change the species you will also need to adjust the nickname, moves, and various other elements to make the Pokemon look like they were spawned normally. For what you can change go here.
https://essentialsdocs.fandom.com/wiki/Editing_a_Pok%C3%A9mon

Now to use a RNG to get multiple kinds of Pokemon you would need to tweak the code like this.
Events.onWildPokemonCreate+=proc {|sender,e|
   pokemon=e[0]
   if $game_switches[Your_Switch] && $game_map.map_id == 5 #checks if your event switch is on and your are on the right map.
    r = rand(6) #set how many different outcomes you can have
    if r==1
      pokemon.species=PBSpecies::BULBASAUR
      pokemon.name="Bulbasaur"
      pkmn.resetMoves
      pokemon.pbLearnMove(:LEECHSEED)
    elsif r==2
      pokemon.species=PBSpecies::CHARMANDER
      pokemon.name="Charmander"
      pokemon.resetMoves
      pokemon.pbLearnMove(:EMBER)
    elsif r==3
      pokemon.species=PBSpecies::SQUIRTLE
      pokemon.name="Squirtle"
      pokemon.resetMoves
      pokemon.pbLearnMove(:BUBBLE)
    elsif r==4
      pokemon.species=PBSpecies::PIKACHU
      pokemon.name="Pikachu"
      pokemon.givePokerus
      pokemon.makeShiny
      pokemon.resetMoves
    elsif r==5
      pokemon.species=PBSpecies::EEVEE
      pokemon.name="Eevee"
      pokemon.setItem(:ORANBERRY)
      pokemon.resetMoves
    else
      pokemon.species=PBSpecies::MEOWTH
      pokemon.name="Meowth"
      pokemon.form=1         #spawns Alolan Meowth
      pokemon.resetMoves
   end
}
Developing Pokémon: World Saga
Male
Brazil
Seen 5 Days Ago
Posted 1 Week Ago
5 posts
5 Years
Hello, i messed with essentials scripts and combining it with a little bit of eventing managed to find a (pretty rustic way) of doing wild area like encounters
This is the script i created
Spoiler:
def spawnpoke
pokemon = 0
level = 0
enctype = EncounterTypes::StaticEncounter
encounter = $PokemonEncounters.pbEncounteredPokemon(enctype)
return false if !encounter
$PokemonTemp.encounterType = enctype
#(encounter[0],encounter[1]) are generated here?
pokemon = encounter[0]
level = encounter[1]
$PokemonTemp.encounterType = -1
$game_variables[34] = pokemon
$game_variables[35] = level
end

def resetecounters
if $game_map
for event in $game_map.events.values
if event.name[/WildPokemon/]
$game_self_switches[[$game_map.map_id,event.id,"A"]] = false
$game_self_switches[[$game_map.map_id,event.id,"B"]] = false
$game_self_switches[[$game_map.map_id,event.id,"C"]] = false
$game_self_switches[[$game_map.map_id,event.id,"D"]] = false
end
end
$game_map.need_refresh = true
else
#uhhhhh
end
end

but you also need to set some events on the map named "WildPokemon" to this work and with conditions to check what pokemon just "spawned"
and depending on what spawned activate one of the self variables, and in the new event page change the event's sprite and make it call a wild battle of the pokemon it is
call resetecounters wherever you want to reset the encounters (i wanted to find a way to call this on map reset or something)
also, you need to add an encounter type called "StaticEncounter" and probably just four possibilities (as there are only four self variables)
Advertiser Content