• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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

308
Posts
4
Years
  • This is the error showing up for me. It happens when I lose a wild battle and get sent to the Poke Center.
    I don't appear to be missing anything, and I can't seem to find a fix to it on my own. Thoughts?
    This is with the latest update to the script, I didn't change anything that I shouldn't have.

    Exception: NoMethodError

    Message: (eval):13:in `pbExecuteScript'undefined method `removeThisEventfromMap' for nil:NilClass

    Thank you for reporting your issue. There was a bug in the script. I removed the bug and I will update this script to a new version v1.9 for all the other users.
    Here is the working script:

    Spoiler:
     
    62
    Posts
    6
    Years
    • Seen Aug 11, 2022
    View attachment 90535

    * Visible Overworld Wild Encounters Version 1.9 - by derFischae (Credits if used please) *

    UPDATED TO VERSION 1.9. NOW INCLUDING VENDILYS RESCUE CHAIN AND DOWNSCALE OF VERSION 1.6 FOR POKEMON ESSENTIALS V16.2 BY ARCHYTHEARC.

    This script is for Pokémon Essentials V16.2, V17 and V17.2. Originally written for V17 and 17.2 by me and VERSION 1.6 downscaled to V16.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
    - 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

    NEW FEATURES IN VERSION 1.1:
    - less lag
    - supports sprites for alternative forms of pokemon

    NEW FEATURES IN VERSION 1.2:
    - supports sprites for female/male/genderless pokemon

    NEW FEATURES IN VERSION 1.3:
    - bug fixes for roaming encounter and double battles

    NEW FEATURES IN VERSION 1.4:
    - more options in settings

    NEW FEATURES IN VERSION 1.5:
    - roaming encounters working correctly

    NEW FEATURES IN VERSION 1.6:
    - did some runtime optimization, i.e. faster despawning of pokemon after battle

    NEW FEATURES IN VERSION 1.7:
    - included automatic spawening of pokemon, i.e. without spawning without having to move the player

    NEW FEATURES IN VERSION 1.8:
    - included vendilys rescue chain, i. e. if pokemon of the same species family spawn in a row and will be battled in a row, then you increase the chance of spawning an evolved pokemon of that species family. Link: https://www.pokecommunity.com/showthread.php?t=415524

    NEW FEATURES IN VERSION 1.9:
    - removed bug occuring after fainting against wild overworld encounter
    - for script-developers, shortened the spawnEvent method for better readablitiy

    INSTALLATION:
    Installation as simple as it can be.
    Step 1) You need sprites for the overworld pokemon in your \Graphics\Characters folder named by there number 001.png, 002.png, ..., with the corresponding shiny versions 001s.png, 002s.png, .... For instance you can use Gen 1-7 OV SPrites or whatever you want for your fakemon.
    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, ...
    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)
    Step 2) Insert a new file in the script editor above main, name it Overworld_Random_Encounters and copy this code into it.

    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 how many encounters you have to kill to obtain the increased Shiny-Chance in parameter
    CHAINLENGTH
    and the increased Shiny-Chance in parameter
    SHINYPROBABILITY
    4) You can choose whether the sprite of your overworld encounter is always the standard form 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 choose whether pokemon can spawn automatically or only while the player is moving and you can set the spawning frequency in the parameter
    AUTOSPAWNSPEED
    10) You can activate or deactivate vendilys rescue chain by in the parameter
    USERESCUECHAIN
    Moreover, you also have all settings of vendilys Rescue chain here.

    THANKS to BulbasaurLvl5 for bringing me to pokemon essentials and the super productive time

    THANKS to ArchyTheArc for downscaling to Pokemon Essentials V16.2.

    * For Pokemon Essentials V17 and V17.2. *
    Spoiler:


    * Version 1.6 for Pokemon Essentials V16.2. Downscale by ArchyTheArc *
    Spoiler:


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

    I have one last proposal for you.
    Can we introduce the chances that the pokémon you're looking for will have the MAX IVs or that it has its hidden ability?
    I think it will complement the script.

    PS: With your latest updates, the pokémon's shape doesn't appear. This is the standard form that appears.

    Thank you in advance.
     
    13
    Posts
    8
    Years
    • Seen Mar 22, 2024
    Hi, I'm using the 17.2 version of pokemon essentials and the 16.2 version of your script because the 17.2 version didn't work correctly for me. the error does not happen when I combat a wild pokemon without your script. About the missing terrain tags i added those in PBTerrain. I had some of them missing like TallGrass or Waterfall.
    #===============================================================================
    # Terrain tags
    #===============================================================================
    module PBTerrain
    Ledge = 1
    Grass = 2
    Sand = 3
    Rock = 4
    DeepWater = 5
    StillWater = 6
    Water = 7
    Waterfall = 8
    WaterfallCrest = 9
    TallGrass = 10
    UnderwaterGrass = 11
    Ice = 12
    Neutral = 13
    SootGrass = 14
    Bridge = 15
    Puddle = 16
    Puddle = 17
     
    421
    Posts
    9
    Years
  • Well, now there appears to be a different bug, it seems to be random, so I can't pinpoint it, but it happens when I'm simply walking around in grassy areas.
    It looks to be similar to last time, but in a different area. Using the latest version again. (1.9)

    Exception: NameError

    Message: undefined local variable or method `removeThisEventfromMap' for #<Game_Event:0xf05cc48>

    Overworld_Random_Encounters:788:in `increase_steps'

    Game_Character:435:in `move_down'

    Game_Character:542:in `move_random'

    Game_Character:296:in `move_type_random'

    Game_Character:237:in `update'

    Game_Event:238:in `update'

    Game_Map:474:in `original_update'

    Game_Map:471:in `each'

    Game_Map:471:in `original_update'

    Overworld_Random_Encounters:838:in `update'
     
    308
    Posts
    4
    Years
  • PS: With your latest updates, the pokémon's shape doesn't appear. This is the standard form that appears.

    Thank you in advance.

    Well, now there appears to be a different bug, it seems to be random, so I can't pinpoint it, but it happens when I'm simply walking around in grassy areas.
    It looks to be similar to last time, but in a different area. Using the latest version again. (1.9)

    Thanks for your remarks. Should be fixed now, in the following version 1.9.1
    Spoiler:
     
    308
    Posts
    4
    Years
  • Hi, I'm using the 17.2 version of pokemon essentials and the 16.2 version of your script because the 17.2 version didn't work correctly for me. the error does not happen when I combat a wild pokemon without your script. About the missing terrain tags i added those in PBTerrain. I had some of them missing like TallGrass or Waterfall.
    #===============================================================================
    # Terrain tags
    #===============================================================================
    module PBTerrain
    Ledge = 1
    Grass = 2
    Sand = 3
    Rock = 4
    DeepWater = 5
    StillWater = 6
    Water = 7
    Waterfall = 8
    WaterfallCrest = 9
    TallGrass = 10
    UnderwaterGrass = 11
    Ice = 12
    Neutral = 13
    SootGrass = 14
    Bridge = 15
    Puddle = 16
    Puddle = 17

    It is not recommanded to use the visible wild overworld encounter script version for Pokemon Essentials 16.2 while using Pokemon Essentials 17.2.
    The older versions were buggy. Please try the newest version 1.9.1. Probabily, it will work for you now.
    Spoiler:

    If your error still occurs, then please post the error message (and use the CODE brackets for better readability) and let us know what you did ingame before the error occurs.

    Concerning your adding of Terrain tags: It does not seem to be correct, that you have Puddle twice in the enumeration, I guess.
    Code:
    module PBTerrain
      [...]
      Puddle          = 16
      Puddle          = 17
     
    308
    Posts
    4
    Years
  • I have one last proposal for you.
    Can we introduce the chances that the pokémon you're looking for will have the MAX IVs or that it has its hidden ability?
    I think it will complement the script.

    Thank you in advance.

    Can you please explain more precisely what you mean? Do you mean that we simply code that every 10th, 50th... encounter automatically has MAX IVs? Or do you what a catch or kill combo which increases the IVs of the encounter of the same type?
     
    62
    Posts
    6
    Years
    • Seen Aug 11, 2022
    Can you please explain more precisely what you mean? Do you mean that we simply code that every 10th, 50th... encounter automatically has MAX IVs? Or do you what a catch or kill combo which increases the IVs of the encounter of the same type?

    It is true that the method to meet the Pokemon sought with the IVs is not well defined.
    In fact it's up to you to choose what's best for you.
    I personally think you have to model yourself on the Rescue Chain script - By Vendily.
    That is, the more we hunt the same Pokémon, the more the chance to see the MAX IVs or hidden ability appears.
    A can like the S.O.S battle method.

    What do you think?

    If you have another solution...
     
    62
    Posts
    6
    Years
    • Seen Aug 11, 2022
    Can you please explain more precisely what you mean? Do you mean that we simply code that every 10th, 50th... encounter automatically has MAX IVs? Or do you what a catch or kill combo which increases the IVs of the encounter of the same type?

    But I think this should be added to the Rescue Chain script - By Vendily rather than in yours.

    Your script is made to make wild Pokémon appear on the map.

    Adding max IVs and hidden ability are just options that need to be in another script.
    The one from Rescue Chain - By Vendily for example.

    It's an option.
    It's up to you to see if it needs to be added.

    Right now I'm looking for a script to mimic the S.O.S battle scene like in Pokemon Sun and Moon, I'm looking for a script for the battle hordes and finally a script to show the size and weight of the pokemon captured as in Pokemon Let's Go.

    All this is work and it takes a lot of time.
    I hope I can make them happen.

    Tanks!
    (sorry for my English)
     
    13
    Posts
    8
    Years
    • Seen Mar 22, 2024
    Hello again 😅. With the last version i'm getting this error.

    Excepción: ArgumentError
    Mensaje: wrong number of arguments(2 for 1)
    Overworld_Random_Encounters:337:in `pbCanEncounter?'
    Overworld_Random_Encounters:337:in `pbChooseEncounter'
    Overworld_Random_Encounters:280:in `pbOnStepTaken'
    Game_Player:484:in `update_old'
    Walk_Run:76:in `update'
    Scene_Map:104:in `update'
    Scene_Map:101:in `loop'
    Scene_Map:114:in `update'
    Scene_Map:68:in `main'
    Scene_Map:65:in `loop'
     
    308
    Posts
    4
    Years
  • Hello again 😅. With the last version i'm getting this error.

    Excepción: ArgumentError
    Mensaje: wrong number of arguments(2 for 1)
    Overworld_Random_Encounters:337:in `pbCanEncounter?'
    Overworld_Random_Encounters:337:in `pbChooseEncounter'
    Overworld_Random_Encounters:280:in `pbOnStepTaken'
    [...]

    Have you done any modifications on the overworld wild encounters script? Have you installed other scripts? Well, I'm sure you did. So, it seems that you use a script, which is not compatible with the overworld wild encounter script. Or you changed something unintentionally.

    Can you please send me all lines from the 334th line to the 340th line of your script "Overworld_Random_Encounters". Please, also search every script in the editor for the following code:
    Code:
    def pbCanEncounter?
    and post every result. I'm interested in the words that stand in backets behind that "def pbCanEncounter?( ... )" and I want to know the script name (i. e. in the left column) for each result.

    I predict that there will be at least one searching result where there is only one word in brackets.
     
    13
    Posts
    8
    Years
    • Seen Mar 22, 2024
    Hi, thanks for your patience and sorry for causing so much trouble.

    Lines from the 334th to the 340th
    encounter = $PokemonEncounters.pbGenerateEncounter(encounterType)
    encounter = EncounterModifier.trigger(encounter)
    if !$PokemonEncounters.pbCanEncounter?(encounter,repel)
    $PokemonTemp.forceSingleBattle = false
    EncounterModifier.triggerEncounterEnd()
    return
    end


    Scripts with "def pbCanEncounter?"
    https://ibb.co/jg1h5MV


    It contains this

    def pbCanEncounter?(encounter)
    return false if $game_system.encounter_disabled
    return false if !encounter || !$Trainer
    return false if $DEBUG && Input.press?(Input::CTRL)
    if !pbPokeRadarOnShakingGrass
    return false if $PokemonGlobal.repel>0 && $Trainer.ablePokemonCount>0 &&
    encounter[1]<=$Trainer.ablePokemonParty[0].level
    end
    return true
    end
     
    308
    Posts
    4
    Years
  • Hi, thanks for your patience and sorry for causing so much trouble.

    Lines from the 334th to the 340th
    Code:
      encounter = $PokemonEncounters.pbGenerateEncounter(encounterType)
      encounter = EncounterModifier.trigger(encounter)
      if !$PokemonEncounters.pbCanEncounter?(encounter,repel)
        $PokemonTemp.forceSingleBattle = false
        EncounterModifier.triggerEncounterEnd()
        return
      end

    Scripts with "def pbCanEncounter?"
    https://ibb.co/jg1h5MV


    It contains this

    Code:
      def pbCanEncounter?(encounter)
        return false if $game_system.encounter_disabled
        return false if !encounter || !$Trainer
        return false if $DEBUG && Input.press?(Input::CTRL)
        if !pbPokeRadarOnShakingGrass
          return false if $PokemonGlobal.repel>0 && $Trainer.ablePokemonCount>0 &&
                          encounter[1]<=$Trainer.ablePokemonParty[0].level
        end
        return true
      end

    It seems, that you are not using the current Pokemon Essentials version 17.2.

    The code for pbCanEncounter? in the script "PField_Encounters" should be the following instead:
    Code:
      def pbCanEncounter?(encounter,repel)
        return false if $game_system.encounter_disabled
        return false if !encounter || !$Trainer
        return false if $DEBUG && Input.press?(Input::CTRL)
        if !pbPokeRadarOnShakingGrass
          return false if ($PokemonGlobal.repel>0 || repel) &&
                          $Trainer.firstAblePokemon &&
                          encounter[1]<$Trainer.firstAblePokemon.level
        end
        return true
      end
    Replace all of your "pbCanEncounter?(encounter)" method by the code I posted above. If it still doesn't work, then you will have to update your pokemon essentials version or search for help in other threads about that issue. Your problems don't come from my overworld wild encounter script. So I can't help you here in future.
     
    Last edited:
    13
    Posts
    8
    Years
    • Seen Mar 22, 2024
    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'
     
    308
    Posts
    4
    Years
  • 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

    I can't help you with Pokemon Essentials 16.2, since I don't have it. Use 17.2 or learn to code and optimize the script for your outdated version. Good luck and study hard.
     
    68
    Posts
    4
    Years
    • Seen Nov 9, 2023
    For some reason, Scatterbug's overworld sprite won't show up when it spawns, even though I have its overworld sprites in the Characters folder. Do you know how I can fix this?
     
    13
    Posts
    8
    Years
    • Seen Mar 22, 2024
    I'll try it! Thanks for your time!
     
    Last edited by a moderator:
    308
    Posts
    4
    Years
  • For some reason, Scatterbug's overworld sprite won't show up when it spawns, even though I have its overworld sprites in the Characters folder. Do you know how I can fix this?

    Normally Scatterbug has 18 alternative forms. But you will only see one form depending on your trainerID.
    if you disable alternative forms in the settings, then it will work correctly.
    If you want to use alternative forms, then you also have to include 664_1.png, ..., 664_19.png and 664s_1.png, ..., 664s_19.png. Then it will show the alternative forms.

    Edit: You can simply copy and rename 664.png and 664s.png. Same is true for Pokemon with number 665 and 666.
     
    Last edited:

    Luxintra

    Pokémon trainer
    64
    Posts
    6
    Years
    • UK
    • Seen May 6, 2024
    Is it possible to get this scrip to work with EncounterModifiers? As currently it will only spawn the overworld sprite for whatever is in the maps encounter list.
     
    Back
    Top