• 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 Conquest 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.

Script: Visible Overworld Wild Encounter

I made it yesterday but forgot to post. Sometimes, Late is Mate.
I edited just the animation code that you told, and it now only shows animation when the Pokémon is on Grass tile, weather be Tall Grass, Underwater Grass or normal one. And, no animation when Pokémon is on Water or Cave tile.
Code:
  if PBTerrain.isGrass?($game_map.terrain_tag(x,y))
  # Show grass rustling animations when on grass
    $scene.spriteset.addUserAnimation(RUSTLE_NORMAL_ANIMATION_ID,x,y,true,1)
  end

Nice work. Do you also want to add something like a water sprinkle or splash animation for pokemon spawning on water, or a dust or stone rustle animation for pokemon spawning in caves? Would look great.
 
can visible overworld pokemon generate wild pokemons before you enter the map? something similar to pokemon let's go gba
 
For short: If you want to run a procedure
- only when a pokemon spawns --> use: @@OnWildPokemonCreateForSpawning, used for changing the species, level, gender, alternative form and the shinyness of the overworld encounter
- only when you go into battle with a pokemon --> use: @@OnStartBattle, as usual
- in both situation --> use: @@OnWildPokemonCreate
Additionally, use the global variable $PokemonGlobal.battlingSpawnedPokemon to decide if you battle against an overworld encounter (true) or not (nil or false), including battling a normal encounter or not battling at all
- $PokemonGlobal.battlingSpawnedPokemon let's you add a procedure to the event @@OnWildPokemonCreate that runs only than battling or only on spawning.
lots of scripts out there work as suggested with this script. But for some scripts you might need to modify your additional scripts, such as Vendilys Rescue Chain or Joltiks Level Balance, to work properly with the visible overworld encounter script.


EVENTS AND VISIBLE OVERWORLD WILD ENCOUNTER

Concerning Wild Pokemon, there are 3 Events, which trigger before a wild overworld pokebattle.

At first, the event @@OnStartBattle triggers right before the battle.
You can add a procedure to this event, so that procedure runs when going into battle.
See the Pokemon Essentials manual if you want to read more on how to use it.

Another event is @@OnWildPokemonCreate, instructions in the Pokemon Essentials manual.
But with the visible overworld wild encounter script, the event @@OnWildPokemonCreate triggers twice, since we need to create a pokemon in two situation.
At first when the pokemon spawns to generate the pokemon species, level, shinyness, form and gender for the sprite.
And the second time it creates a pokemon is when you go into battle with an already spawned pokemon to set the ability, IVs and all the other things we need for the battle.

So, you can still use all your scripts which make use of the event @@OnwildPokemonCreate. But it might get an odd behavior since that event triggers twice.
To get rid of that the visible wild overworld encounter script introduces a new event @@OnWildPokemonCreateForSpawning.
It can be used the same way as the event @@OnWildPokemonCreate, but this event will only trigger when a pokemon spawns on the overworld and is not triggered in any other situations than for spawning.
If you want to add a procedure that modifies a pokemon only for spawning but not before battling then you can do it.
Simply add that procedure to the event @@OnWildPokemonCreateForSpawning.
Also make sure that the procedure only affects the species, level, alternative form, gender and shinyness of the pokemon.
All other changes of properties of the pokemon, such as the ability and the IVs, will be omitted, since they are not relevant for the sprite of the overworld encounter. (If you think, that there should be some other property changable then let me know.)
But all other properties of a pokemon can still be changed in @@OnWildPokemonCreate or @@OnStartBattle as usual.

Easy Example:
Spoiler:


Example: Modifications on already existing scripts, such as Joltiks Level Balance
Spoiler:


You can use the new global variable $PokemonGlobal.battlingSpawnedPokemon, which is true if you are in battle with an already spawned pokemon and nil or false in all other situations, including not battling at all.
This global variable let's you restrict a procedure added to @@OnWildPokemonCreate run only on creation for battling an already spawned pokemon or not to run then.
So, you can use this code snippet
Code:
Events.onWildPokemonCreate+=proc {|sender,e|
   if !$PokemonGlobal.battlingSpawnedPokemon
     #The actual code of your procedure you want to run only on spawning of overworld encounters and not battling them.
   end
}
will force that the procedure runs on spawning and not on battling an overworld encounter.
And
Code:
Events.onWildPokemonCreate+=proc {|sender,e|
   if $PokemonGlobal.battlingSpawnedPokemon == true
     #The actual code of your procedure you want to run only when battling overworld encounters.
   end
}
will force that the procedure only runs on battling with an overworld encounter.

EVENTS AND OVERWORLD ENCOUNTER AND NORMAL ENCOUNTER IN ONE GAME

You can have overworld encounters and events, placed by your own, which force a wild battle, which also counts somehow as a normal encounter.
Or you can use overworld encounters and normal encounters at the same time (see above if you want to include that).
So you might come to the point that you want to modify a pokemon or run a certain procedure in battle only for overworld encounters, only for normal encounters or for all encounters.
At first if you want to run a procedure for all encounters, then add that procedure to the event @@OnStartBattle as usual
But if not then you can use the new global variable $PokemonGlobal.battlingSpawnedPokemon, which is true if you are in battle with an already spawned pokemon and nil or false in all other situations, including not battling at all.
So, a procedure runs only for overworld encounters with this code snippet
Code:
Events.onStartBattle+=proc {|sender,e|
   if ($PokemonGlobal.battlingSpawnedPokemon == true)
     #The actual code of your procedure you want to run only when battling overworld encounters
   end
}
And a procedure runs only for normal encounters with this code snippet
Code:
Events.onStartBattle+=proc {|sender,e|
   if !$PokemonGlobal.battlingSpawnedPokemon
     #The actual code of your procedure you want to run only when battling normal encounters
   end
}

By the way,
Code:
Events.onWildPokemonCreate+=proc {|sender,e|
   if !$PokemonGlobal.battlingSpawnedPokemon
     #The actual code of your procedure you want to run only when battling normal encounters and on spawning of overworld encounters.
   end
}
will force that the procedure runs on spawning and on battling with an normal encounter, but not on battling with an overworld encounter.
And
Code:
Events.onWildPokemonCreate+=proc {|sender,e|
   if $PokemonGlobal.battlingSpawnedPokemon == true
     #The actual code of your procedure you want to run only when battling overworld encounters.
   end
}
will force that the procedure runs on battling with an overworld encounter.

Example: Shiny catchcombo for overworld and normal encounters
Spoiler:


Example: Modifications on Vendilys Rescue Chain for overworld and normal encounters at the same time
Spoiler:
 
I'm sorry it seems like i have 16.2 version 😅. So i'm still having the same error... When the defeated wild pokemon disappear, this error pops up.
https://ibb.co/30QZ8vX


Mensaje: disposed sprite
Spriteset_Map:29:in `src_rect'
Spriteset_Map:29:in `update'
Spriteset_Map:381:in `_animationSprite_update'
Spriteset_Map:378:in `each'
Spriteset_Map:378:in `_animationSprite_update'
AnimationSprite:86:in `update'
Scene_Map:51:in `updateSpritesets'
Scene_Map:45:in `each'
Scene_Map:45:in `updateSpritesets'
Scene_Map:115:in `update'


Hi i dont know if you find a solution, but i find a alternative

Code:
  def removeThisEventfromMap
    if $game_map.events.has_key?(@id) and $game_map.events[@id]==self
      #-------------------------------------------------------------------------
      # added to reduce lag by derFischae
      for sprite in $scene.spritesets[$game_map.map_id].character_sprites
        if sprite.character==self
          $scene.spritesets[$game_map.map_id].character_sprites.delete(sprite)
          #sprite.dispose
          break
        end
      end

the solution comment the line sprite.dispose.
and ADD this
sprite.bitmap.dispose

PS: sorry for my english.
 
Last edited:
Hi i dont know if you find a solution, but i find a alternative

Code:
  def removeThisEventfromMap
    if $game_map.events.has_key?(@id) and $game_map.events[@id]==self
      #-------------------------------------------------------------------------
      # added to reduce lag by derFischae
      for sprite in $scene.spritesets[$game_map.map_id].character_sprites
        if sprite.character==self
          $scene.spritesets[$game_map.map_id].character_sprites.delete(sprite)
          #sprite.dispose
          break
        end
      end

the solution comment the line sprite.dispose.
and ADD this
sprite.bitmap.dispose

PS: sorry for my english.

Thank you for your solution. Am I right, that the line "sprite.dispose" needs to be replaced by "sprite.bitmap.dispose" on 2 lines in the method removeThisEventFromMap?

And would you mind, if I add your solution to version 1.6 in the main post? So everyone would get the corrected version automatic there.
 
Last edited:
can visible overworld pokemon generate wild pokemons before you enter the map? something similar to pokemon let's go gba

I don't know exactly what you mean. Because I don't know Pokemon Let's go Pikachu/Eevee GBA. But I answer how I understood it.
In the visible overworld wild encounter script, pokemon only spawn on the same map where the player is on. Spawning on other maps is not possible, even if the map is already on screen and just one step away from the player.
If you want to let pokemon spawn on neighbor maps then we need to begin to modify the method
"pbChooseTileOnStepTaken".
Instead of checking
Code:
  #check if it is possible to encounter here
  return if x<0 || x>=$game_map.width || y<0 || y>=$game_map.height #check if the tile is on the map
we need to take the MapFactory into account and not just the $game_map.
This will lead into various modifications in the script in various code lines.
I would say that this is a possible modification, but it also takes som time to do it. And I would guess that a lot of user would never need this. By the way it could be possible that it slows down the script.
Is there a serious interest in that modification?

And what if I missunderstood it? Did you mean something different?
 
Last edited:
I don't know exactly what you mean. Because I don't know Pokemon Let's go Pikachu/Eevee GBA. But I answer how I understood it.
In the visible overworld wild encounter script, pokemon only spawn on the same map where the player is on. Spawning on other maps is not possible, even if the map is already on screen and just one step away from the player.
If you want to let pokemon spawn on neighbor maps then we need to begin to modify the method
"pbChooseTileOnStepTaken".
Instead of checking
Code:
  #check if it is possible to encounter here
  return if x<0 || x>=$game_map.width || y<0 || y>=$game_map.height #check if the tile is on the map
we need to take the MapFactory into account and not just the $game_map.
This will lead into various modifications in the script in various code lines.
I would say that this is a possible modification, but it also takes som time to do it. And I would guess that a lot of user would never need this. By the way it could be possible that it slows down the script.
Is there a serious interest in that modification?

And what if I missunderstood it? Did you mean something different?

Yes, i meant exactly that.
 
Last edited:
I'm popping in again, and felt id update the v16 version for you, not deeply checked for inconsistancies, but it should be all good.

Spoiler:


Only changes were forcesinglebattle, the cryspecies, doublebattle terrain tag and maybe the canencounter(?)

also, seen you've added the autospawn, and not sure if its 100% a feature but, if i do the modifier for both normal and overworld and make the chance 100%, with auto on, will it do auto normal battles or still spawn the overworlds? (basically want the almost SwSh with normal and overworlds being seperate pokemon pools, but dont rely on each other like this does by the base function, really like the new changes too! ^^ didnt cahnge it to saying v17 to v16 or anything at the start so, buit hope this is useful for someone.

edit: adding the changes for normal and overworlds, making it 100%, just have to have a new metadata (or switch but i use metadata's so save on switches) to toggle on when an autospawn triggers and add a check for the normal encounter chance it works. (still to do different encounter pools but still)
 
Last edited:
I'm popping in again, and felt id update the v16 version for you, not deeply checked for inconsistancies, but it should be all good.

Spoiler:


Only changes were forcesinglebattle, the cryspecies, doublebattle terrain tag and maybe the canencounter(?)

also, seen you've added the autospawn, and not sure if its 100% a feature but, if i do the modifier for both normal and overworld and make the chance 100%, with auto on, will it do auto normal battles or still spawn the overworlds? (basically want the almost SwSh with normal and overworlds being seperate pokemon pools, but dont rely on each other like this does by the base function, really like the new changes too! ^^ didnt cahnge it to saying v17 to v16 or anything at the start so, buit hope this is useful for someone.

edit: adding the changes for normal and overworlds, making it 100%, just have to have a new metadata (or switch but i use metadata's so save on switches) to toggle on when an autospawn triggers and add a check for the normal encounter chance it works. (still to do different encounter pools but still)

Thank you for downscaling v1.11.2 again. A lot of Pokemon Essentials v16 and v16.2 users will be thankful.
I included your new version in the main post. By the way, editing the first post becomes laggy, because of that much text, code and modifications listed in the first post.

You asked for autospawn, while you use 100% normal encounters. And indeedfor the implementation of autospawn in v1.11.2, as along as you are not standing on a grass tile, or any other tile where an encounter is possible, nothing will happen. But if you stand on such a tile, then an instant battle will trigger after some time, without moving the player. Overworld encounters will not spawn.
 
* Visible Overworld Wild Encounters Version 16.0.1.11.5 - by derFischae and ArchyTheArc (Credits if used please) *

UPDATED TO VERSION 16.0.1.11.5.

This script is for Pokémon Essentials V16.2. Originally written for PEv17 and PEv17.2 by me and downscaled to PEv16.2 by ArchyTheArc.

As in Pokemon Let's go Pikachu/Eevee or Pokemon Shild and Sword random encounters pop up on the overworld, they move around and you can start the battle with them simply by moving to the pokemon. Clearly, you also can omit the battle by circling around them.

FEATURES INCLUDED:
  • see the pokemon on the overworld before going into battle
  • no forced battling against random encounters
  • plays the pokemon cry while spawning
  • Choose whether encounters occure on all terrains or only on the terrain of the player
  • In caves, pokemon don't spawn on impassable Rock-Tiles, which have the Tile-ID 4
  • if you kill the same species in a row, then you increase the chance of spawning a shiny of that species or an evolved pokemon of that species family
  • choose whether pokemon spawn automatically or only while moving the player
  • Vendilys Rescue Chain, see https://www.pokecommunity.com/showthread.php?t=415524 for original script
  • If you want to add a procedure that modifies a pokemon only for spawning but not before battling then you can use the Event @@OnWildPokemonCreateForSpawning.
  • You can check if you are battleing a spawned pokemon with the global variable $PokemonGlobal.battlingSpawnedPokemon

INSTALLATION: It is as simple as it can be.
  1. You need sprites for the overworld pokemon in your \Graphics\Characters folder named by there number 001.png, 002.png, ..., For instance you can use Gen 1-7 OV SPrites or whatever you want for your fakemon.
    If you want to use shiny overworld sprites for shiny encounters, then make sure to also have the corresponding shiny versions in your \Graphics\Characters folder named by 001s.png, 002s.png, ....
    If you want to use alternative forms as overworld sprites, then make sure that you also have a sprite for each alternative form, e. g. for Unown 201_1.png, 201s_1.png, 201_2.png, 201s_2.png, ... Please note that Scatterbug has 18 alternative forms in Pokemon Essentials. But you will only see one form depending on your trainerID. So, you also have to include 664_1.png, ..., 664_19.png and 664s_1.png, ..., 664s_19.png. Same needs to be done for Pokemon Spewpa with number 665 and Vivillon with number 666.
    If you want to use female forms as overworld sprites, then make sure that you also have a female sprite for each pokemon named 001f.png, 001fs.png, 002f.png, 002fs.png, ... (excluding genderless pokemon of course)
  2. Insert a new file in the script editor above main, name it Overworld_Encounters and copy this code below into it.
  3. Set the properties for your pleasure in the properties section of the script. Most of you don't need to change anything.
  4. If you want, then you can install modifications for the script from below.
  5. If you want then you can also install the script always in bush and in water to obtain that the overworld encounter don't stand on water anymore but sink in. You can find it at https://www.pokecommunity.com/showthread.php?p=10109060

* Version 16.0.1.11.5 for Pokemon Essentials V16.2. THANKS to ArchyTheArc for downscaling to Pokemon Essentials V16.2. *
Spoiler:

Maybe, you also need this for Pokemon Essentials 16.2:
Spoiler:

Or maybe you also need this bug fix for pokemon essentials version 16.2 if you get a disposed sprite error message
Spoiler:


PROPERTIES:
  • If you want to have water encounters only while surfing, you also have to change the value of the upcoming parameter RESTRICTENCOUNTERSTOPLAYERMOVEMENT to
    RESTRICTENCOUNTERSTOPLAYERMOVEMENT = true
  • You can choose how many steps the encounter moves before vanishing in parameter
    STEPSBEFOREVANISHING
  • You can choose how many encounters you have to kill to obtain the increased Shiny-Chance in parameter
    CHAINLENGTH
    and the increased Shiny-Chance in parameter
    SHINYPROBABILITY
  • You can choose whether the overworld sprite of an shiny encounter is always the standard sprite or is the corrensponding shiny overworld sprite in parameter
    USESHINYSPRITES
  • You can choose whether the sprite of your overworld encounter is always the standard form or can be an alternative form in parameter
    USEALTFORMS
  • You can choose whether the sprites depend on the gender of the encounter or are always neutral in parameter
    USEFEMALESPRITES
  • You can choose whether the overworld encounters have a stop/ step-animation similar to following pokemon in the parameter
    USESTOPANIMATION
  • You can choose how many overworld encounters are agressive and run to the player in the parameter
    AGGRESSIVEENCOUNTERPROBABILITY
  • You can choose the move-speed and move-frequenzy of normal and aggressive encounters in parameters
    ENCMOVESPEED, ENCMOVEFREQ, AGGRENCMOVESPEED, AGGRENCMOVEFREQ
  • You can choose whether pokemon can spawn automatically or only while the player is moving and you can set the spawning frequency in the parameter
    AUTOSPAWNSPEED
  • You can activate or deactivate vendilys rescue chain in the parameter
    USERESCUECHAIN
    Moreover, you also have all settings of vendilys Rescue chain here.
  • If you have impassable tiles in a cave, where you don't want pokemon to spawn there. Then choose the Tile-ID 4 for that tile in the tile-editor.

MODIFICATIONS OF THIS SCRIPT: Read the whole thread https://www.pokecommunity.com/showthread.php?t=429019 for more features and modifications, including
  • randomized spawning
    Spoiler:
  • adding shiny sparkle animation to spawned overworld shinys, especially useful if you want to sign out the shiny encounters on the map without using overworld shiny sprites
    Spoiler:
  • removing grass rustle animation on water and in caves
    Spoiler:
  • how to change the movement of the overworld encounter
    Spoiler:
  • "aggressive encounters" only get aggressive when you are 2 tiles away from them, and not before.
    Spoiler:
  • instructions on how to include JoelMatthews Add-Ons for Vendilys Rescue Chain, concerning setting the probability of spawning with hidden abilities or with max IVs,
    see https://www.pokecommunity.com/showthread.php?t=422513 for original script
    Spoiler:
  • instructions on how to modify a pokemon on spawning but not on battling again, by using the events OnStartBattle, OnWildPokemonCreate and OnWildPokemonCreateForSpawning, including how to modifiy existing scripts, such as for the script level balancing by Joltik https://www.pokecommunity.com/showthread.php?t=409828, to work properly with this script
    Spoiler:
  • activating and deactivating overworld encounter spawning with switches
    Spoiler:
  • overworld spawning and original encounters at the same time
    Spoiler:
  • Instructions on how to use events with overworld and normal encounter in the same game, including how to make the shiny catchcombo and Vendilys rescue chain work also for normal encounter
    Spoiler:
  • forbidding pokemons to spawn on specific terrain tiles in caves
    Spoiler:
  • adding new encounter types, eg. desert, shallow water
    Spoiler:
  • instructions on how to have different encounters for overworld spawning and original encountering on the same map
    Spoiler:
  • error solutions
These modifications originally were tested with script version 1.11.2 for Pokemon Essentials 17 and 17.2. But they will probably work with script version 16.0.1.11.4 for Pokemon Essentials 16.2. Feel free to test it.

CHANGELOG
Spoiler:
 
Last edited:
* Visible Overworld Wild Encounters Version 17.0.8 - by derFischae (Credits if used please) *

UPDATED TO VERSION 17.0.8 FOR POKEMON ESSENTIALS V17 AND 17.2. This script is for Pokémon Essentials V17 and V17.2.

As in Pokemon Let's go Pikachu/Eevee or Pokemon Shild and Sword random encounters pop up on the overworld, they move around and you can start the battle with them simply by moving to the pokemon. Clearly, you also can omit the battle by circling around them.

FEATURES INCLUDED:
  • see the pokemon on the overworld before going into battle
  • no forced battling against random encounters
  • plays the pokemon cry while spawning
  • Choose whether encounters occure on all terrains or only on
    the terrain of the player
  • you can have instant wild battle and overworld spawning at the same time and set the propability of that by default
    and change it ingame and store it with a $game_variable
  • In caves, pokemon don't spawn on impassable Rock-Tiles, which have the Tile-ID 4
  • You can check during the events @@OnWildPokemonCreate, @@OnStartBattle, ... if you are battling a spawned pokemon with the global variable $PokemonGlobal.battlingSpawnedPokemon
  • You can check during the event @@OnWildPokemonCreate if the pokemon is created for spawning on the map or created for a different reason with the Global variable $PokemonGlobal.creatingSpawningPokemon
  • If you want to add a procedure that modifies a pokemon only for spawning but not before battling
    then you can use the Event @@OnWildPokemonCreateForSpawning.

INSTALLATION: It is as simple as it can be.
  1. You need sprites for the overworld pokemon in your \Graphics\Characters folder named by there number 001.png, 002.png, ..., For instance you can use Gen 1-7 OV SPrites or whatever you want for your fakemon.
    If you want to use shiny overworld sprites for shiny encounters, then make sure to also have the corresponding shiny versions in your \Graphics\Characters folder named by 001s.png, 002s.png, ....
    If you want to use alternative forms as overworld sprites, then make sure that you also have a sprite for each alternative form, e. g. for Unown 201_1.png, 201s_1.png, 201_2.png, 201s_2.png, ... Please note that Scatterbug has 18 alternative forms in Pokemon Essentials. But you will only see one form depending on your trainerID. So, you also have to include 664_1.png, ..., 664_19.png and 664s_1.png, ..., 664s_19.png. Same needs to be done for Pokemon Spewpa with number 665 and Vivillon with number 666.
    If you want to use female forms as overworld sprites, then make sure that you also have a female sprite for each pokemon named 001f.png, 001fs.png, 002f.png, 002fs.png, ... (excluding genderless pokemon of course)
  2. Insert a new file in the script editor above main, name it Overworld_Encounters and copy this code below into it.
  3. Set the properties for your pleasure in the properties section of the script. Most of you don't need to change anything.
  4. If you want, then you can install add-ons or modifications for the script from below.
  5. If you want then you can also install the script always in bush and in water to obtain that the overworld encounter don't stand on water anymore but sink in. You can find it at https://www.pokecommunity.com/showthread.php?p=10109060

HERE IS THE CODE OF THE VISIBLE OVERWORLD WILD ENCOUNTER SCRIPT
Spoiler:


PROPERTIES:
  1. If you want to have water encounters only while surfing, you also have to change the value of the upcoming parameter RESTRICTENCOUNTERSTOPLAYERMOVEMENT to
    RESTRICTENCOUNTERSTOPLAYERMOVEMENT = true
  2. You can choose how many steps the encounter moves before vanishing in parameter
    STEPSBEFOREVANISHING
  3. You can choose whether the overworld sprite of an shiny encounter is always the standard sprite or is the corrensponding shiny overworld sprite in parameter
    USESHINYSPRITES
  4. You can choose whether the sprite of your overworld encounter is always the standard sprite or can be an alternative form in parameter
    USEALTFORMS
  5. You can choose whether the sprites depend on the gender of the encounter or are always neutral in parameter
    USEFEMALESPRITES
  6. You can choose whether the overworld encounters have a stop/ step-animation similar to following pokemon in the parameter
    USESTOPANIMATION
  7. You can choose how many overworld encounters are agressive and run to the player in the parameter
    AGGRESSIVEENCOUNTERPROBABILITY
  8. You can choose the move-speed and move-frequenzy of normal and aggressive encounters in parameters
    ENCMOVESPEED, ENCMOVEFREQ, AGGRENCMOVESPEED, AGGRENCMOVEFREQ
  9. You can have normal and overworld encountering at the same time. You can set the default propability in percentage in the parameter
    INSTANT_WILD_BATTLE_PROPABILITY
  10. The actual propability of normal to overworld encountering during game is stored in
    $game_variables[OVERWORLD_ENCOUNTER_VARIABLE]
    and you can change its value during playtime.
  11. If you want to change the ID of the $game_variable that saves the current propability of normal to overworld encountering, then you can change it in parameter
    OVERWORLD_ENCOUNTER_VARIABLE
    Make sure that no other script uses and overrides the value of the game_variable with that ID.
  12. If you have impassable tiles in a cave, where you don't want pokemon to spawn there. Then choose the Tile-ID 4 for that tile in the tile-editor.

ADD-ONS OF THIS SCRIPT: In the post https://www.pokecommunity.com/threads/429019 you will also find add-ons, including
  • Vendilys Rescue Chain and JoelMatthews Add-Ons for Vendilys Rescue Chain,
    See https://www.pokecommunity.com/threads/415524 and
    https://www.pokecommunity.com/threads/422513 for original scripts
    Spoiler:
  • Simple Let's go shiny hunting by chaining a pokemon, inspired by Diego Mertens script
    https://www.pokecommunity.com/showthread.php?p=10011513
    Spoiler:
  • Automatic Spawning
    Spoiler:
  • Randomised spawning
    Spoiler:
  • all overworld encounters are shinys
    Spoiler:
  • instructions on how to make your own Add-On or to modify an already existing script to make it work with the visible overworld wild encounter script. This includes modifying a pokemon on spawning but not on battling again, by using the events OnStartBattle, OnWildPokemonCreate and OnWildPokemonCreateForSpawning
    Spoiler:
  • Joltiks Level Balance, see https://www.pokecommunity.com/threads/409828 for original post
    Spoiler:

MODIFICATIONS OF THIS SCRIPT: Read this thread https://www.pokecommunity.com/threads/429019 for more features and modifications, including
  • adding shiny sparkle animation to spawned overworld shinys, especially useful if you want to sign out the shiny encounters on the map without using overworld shiny sprites
    Spoiler:
  • removing grass rustle animation on water and in caves
    Spoiler:
  • how to change the movement of the overworld encounter
    Spoiler:
  • "aggressive encounters" only get aggressive when you are 2 tiles away from them, and not before.
    Spoiler:
  • forbidding pokemon to spawn on specific terrain tiles in caves
    Spoiler:
  • adding new encounter types, eg. desert, shallow water
    Spoiler:
  • instructions on how to have different encounters for overworld spawning and original encountering on the same map
    Spoiler:
  • error solutions

CHANGELOG
Spoiler:
 
Last edited:
When entering an area with set wild encounters, after plugging in this script, I get this error
---------------------------
Pokemon Essentials
---------------------------
[Pokémon Essentials version 17.2]

Exception: NoMethodError

Message: undefined method `catchcombo' for #<PokemonTemp:0x122f0df0>

Overworld_Random_Encounters 2.0:477:in `spawnEvent'

Overworld_Random_Encounters 2.0:398:in `pbPlaceEncounter'

Overworld_Random_Encounters 2.0:313:in `pbOnStepTaken'

Game_Player:461:in `update_old'

Game_Player_Visuals:71:in `follow_update'

Following Pokemon:1466:in `update'

Scene_Map:164:in `follow_update'

Scene_Map:161:in `loop'

Scene_Map:170:in `follow_update'

Following Pokemon:1534:in `update'



This exception was logged in

C:\Users\chanc\Saved Games\Pokemon Essentials\errorlog.txt.

Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------
I apologize if this error is a result of me being dumb but I haven't been able to figure out a way around this and decided to post it here.
 
When entering an area with set wild encounters, after plugging in this script, I get this error

I apologize if this error is a result of me being dumb but I haven't been able to figure out a way around this and decided to post it here.

Thank you for reporting that bug. Indeed, by cleaning up the code to make the Let's Go Shiny Hunting an additional feature I forgot one line. This produced the error message. I updated the code to make it version 2.0.1. You can either use the new version or you can search for the line 477
Code:
    $PokemonTemp.catchcombo=[0,0] if !$PokemonTemp.catchcombo
and remove it.
 
Hi, is it possible to remake the script for PSDK?

I'm not familar with PSDK. But I would guess that basically everything that can be done with RPGMakerXP and Ruby can also be done in PSDK. So almost every script can be remaked.
But the visible overworld wild encounter script uses RGSS2 to generate events (the spawning pokemon) during runtime. Well, infact I don't actually know that the script uses RGSS2 but I would guess since it uses the modules defined in the script section RGSS2Compatibility. By the way, the only other script I know that does a similar thing is KleinStudio's Phenomenon implemented in KleinStudio's Pokemon Essentials BW. Here is not a direct link, but they also talk about it at https://www.pokecommunity.com/threads/430794
Now, PSDK does not support that and uses LiteRGSS instead. So all parts concerning RGSS2 in the visible overworld wild encounter script need to be rewritten for LiteRGSS.

Here, I will tell you in detail how the visible overworld encounter script generates new Game_Events during runtime. So you can find out what you have to adjust to make it work with PSDK.

For the notation: A lot of things are called events but they all are of different types. That is
(1) that thing you can place on a map in the map editor.
(2) an object of the class Event defined in module RPG in script section RSGG2Compatiblity.
All the data you put in an Event of Type (1) in the Event editor, such as the graphic, the move route, the move speed or the list of event commands is stored in an event of class RPG::Event
(3) an object of the class Game_Event defined in script section Game_Event.
At the beginning of your playtesting, RPGMakerXP generates an game event for every event data of type (2) concerning the events of type (1) placed in the map editor.
By the way, a Game_Event contains the corresponding event of type (2) as an variable.
These game events are the one ruby works with during playtime, for instance checking if the player bounced into that event, etc.
(4) an event, such as OnWildBattleEnd, that triggers during playtime and defined in module Events in script section PField_Field. But this is not discussed here.

Actually, RPGMakerXP was designed in a way that you place an event in the map editor and that's it.
It was not intended to generate new events of type (3) during runtime.
But it is possible. And so the visible overworld wild encounter script does that in the method SpawnEvent by 4 Steps.

Step 1) Generate an RPG::Event of type (2)
Code:
event = RPG::Event.new(x,y)

Step 2) Put all the nessessary data into that RPG::Event event, for example
Code:
event.pages[0].graphic.character_name = "001s" # for a shiny bulbasaur saved as 001s.png
event.pages[0].move_type = 1 # means random movement of the spawned pokemon
event.pages[0].move_type = 3 # spawned pokemon follows player
event.pages[0].move_speed = 3 # means slow speed
event.pages[0].move_frequency = 5 # means higher frequency
event.pages[0].move_route.list[0].code = 10
event.pages[0].move_route.list[1] = RPG::MoveCommand.new
event.pages[0].step_anime = true # for step animation of the spawned pokemon
event.pages[0].trigger = 2 # means that event triggers on event touch
Then add all the event commands to the list, for example that a wild battle starts with the species encounter[0] with level encounter[1].
This can be done in 2 ways. Either use something like
Code:
pbPushScript(event.pages[0].list,sprintf(" pbWildBattle("+encounter[0].to_s+","+encounter[1].to_s+")"))
or use
Code:
event.pages[0].list[0].code = 355 # 355 stands for the event command script, check script section Interpreter for all commands
event.pages[0].list[0].indent = 0
parameter = " pbWildBattle("+encounter[0].to_s+","+encounter[1].to_s+")"
event.pages[0].list[0].parameters = [parameter]
event.pages[0].list[1] = RPG::EventCommand.new
For the latter way, note that it is nessessary to start with list index list[0] and don't forget the last line. If you want to add another command then do the same but with an list index increased by 1.
The parameter needs to be a string here since 355 is the command corresponding to the script command you use into the event command editor (page 3, last entry). See the script section Interpreter in the editor in Pokemon Essentials (press F11) for all commands and how they work.
Here some loosely skimmed over links:
https://forums.rpgmakerweb.com/index.php?threads/script-call-equivalents-of-event-commands.36438/
https://sites.google.com/site/zeriabsjunk/home/interpretercommand355rmxp

Step 3) Generate an Game_Event of type (3)
Code:
gameEvent = Game_Event.new(@map_id, event, self)

Step 4) Add that Game_Event gameEvent to the list @events of all Game_Events ruby and rpgMakerXP works with
Code:
    @events[key_id] = gameEvent
 
Last edited:
I got another bug that once again, I am not fully sure is a bug or my own error. But just to be safe I felt the need to report it here. There seems to be an issue with line 362 of your script, which states
Code:
return if $Trainer.ablePokemonCount==0   #check if trainer has pokemon
. Essentially this line seems to cause the game to crash if the player does not have any pokemon in their party. Basically, I can't even make a new game without it crashing. The error message goes as follows:
---------------------------
Pokemon Essentials
---------------------------
[Pokémon Essentials version 17.2]

Exception: NoMethodError

Message: undefined method `ablePokemonCount' for nil:NilClass

Overworld_Random_Encounters 2.0.1:362:in `pbChooseEncounter'

Overworld_Random_Encounters 2.0.1:943:in `update'

Scene_Map:140:in `updateMaps'

Scene_Map:139:in `each'

Scene_Map:139:in `updateMaps'

Scene_Map:148:in `miniupdate'

Scene_Map:147:in `loop'

Scene_Map:155:in `miniupdate'

Messages:155:in `pbUpdateSceneMap'

Messages:1266:in `pbMessageDisplay'



This exception was logged in

C:\Users\chanc\Saved Games\Pokemon Essentials\errorlog.txt.

Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------
for now it seems deleting the line is a temporary fix to the issue, but I'm sure it has some other function that will be missing if this line is deleted.
 
So no actual issue ig just a visual thing maybe(?) water encounters, atleast for when in 16.2, seem to still have the grass pop up animation (unless you fixed it in the versions since my downgrade) probably just a check of the terrain or smth and disable the animation/give a new one when its a water one
 
So no actual issue ig just a visual thing maybe(?) water encounters, atleast for when in 16.2, seem to still have the grass pop up animation (unless you fixed it in the versions since my downgrade) probably just a check of the terrain or smth and disable the animation/give a new one when its a water one

भाग्य ज्योति already gave instructions to modify this issue, see
https://www.pokecommunity.com/posts/10197592
This is also quoted in the main post under "modifications of this script".
 
I got another bug that once again, I am not fully sure is a bug or my own error. But just to be safe I felt the need to report it here. There seems to be an issue with line 362 of your script, which states
Code:
return if $Trainer.ablePokemonCount==0   #check if trainer has pokemon
. Essentially this line seems to cause the game to crash if the player does not have any pokemon in their party. Basically, I can't even make a new game without it crashing. The error message goes as follows:

for now it seems deleting the line is a temporary fix to the issue, but I'm sure it has some other function that will be missing if this line is deleted.

Hmm, odd. Basically, your error message says that Pokemon Essentials does not know what $Trainer is. It should be the Game_Player but it is nothing here. Unfortunately, I can not reproduce your error message.
Please, can you try the following: Remove all code in the script section you denoted by Overworld_Random_Encounters, start a new game and move in grass. Does the error still occure? I would guess that but who knows.
By the way, what version of Pokemon Essentials and what version of the visible overworld wild encounter script do you use? Do you also use other scripts or modifications?

The line
Code:
return if $Trainer.ablePokemonCount==0   #check if trainer has pokemon
makes sure that no overworld pokemon spawn until you own a pokemon. Otherwise, it could be problematic to go into a battle with a wild pokemon without having a party. But you can test it and let us know the game experience.
 
Last edited:
Back
Top