• 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

3
Posts
2
Years
    • Seen Apr 9, 2023
    (solved)
    Hi! just want to say how great this mod and collection of add-ons is, it really brings 2D pokemon to life in a very very special way.

    I wanted to ask about an issue I'm having regarding animations in aggressive encounters. I saw someone had a similar problem above and followed the same instructions on a fresh install. The only thing I changed was to set:

    Trying it out, the animation plays fine for when the Pokemon are aggrod, but I can't seem to get the Enc_Spawn_Animations and Perma_Enc_Animations to appear. I tried adding the Additional Animations script as well but it doesn't seem to be working. (Update: I understand now that the script for these animations are in Additional Animations and not in the base plugin.) Upon further testing with Additional Animations, it looks like Enc_Spawn_Animations and Perma_Enc_Animations for Shiny Pokemon works perfectly.

    Update:
    it seemed like the "VisibleEncounterSettings::Enc_Spawn_Animations.push(" in the Aggressive Encounters script wasn't getting called, and :aggressive wasn't being checked for in the "for anim in VisibleEncounterSettings::Enc_Spawn_Animations" loop. I was thinking maybe the definition in Additional Animations was overriding the AGG_ANIMATIONS array, but changing the file name didn't work. (The scripts were each in their own plugin folder, with the original names.)

    I managed to get the animations to work by adding the array directly into the Additional Animations script.
    Is there something I should have done differently?

    Once again, amazing suite of plugins, your notation especially is really really easy to follow and great to read
     
    Last edited:
    163
    Posts
    7
    Years
    • Seen yesterday
    A water encounter can always swim to the shore, no matter what settings you have. NO_SPAWN_ON_BORDER = true only forbids that a pokemon spawns directly on the shore. And BATTLE_WATER_FROM_GROUND = false forbids to trigger a battle with a water encounter from the beach.

    I hope I understood you correctly.

    Sorry for the delay in my reply. Indeed you understand correctly. The problem is that my configuration says "BATTLE_WATER_FROM_GROUND = false" and I can still have water encounters from the shore if I interact with the event. :C
     
    26
    Posts
    9
    Years
    • Seen Oct 23, 2023
    Hi all,

    I was recently trying this script for my own in Pokémon Essentials GSC (v18.1) and I got this error message.

    Here's the error:
    https://imgur.com/gallery/eTalFtI
    Visible Overworld Wild Encounter


    This is happening to me when the Pokémon vanished. When he makes all is steps before vanishing It works for me but when he is supposed to vanish that game error happens.
    So, as a possible solution for me would be set another type of STEPSBEFOREVANISHING method like a timer or something. Another possible solution would be in Game_Characters just making possible to vanish an event. Althought, I don't know how to do it.

    ¿Could anyone help me with this?
     
    Last edited:
    308
    Posts
    4
    Years
  • Sorry for the delay in my reply. Indeed you understand correctly. The problem is that my configuration says "BATTLE_WATER_FROM_GROUND = false" and I can still have water encounters from the shore if I interact with the event. :C

    Thank you for reporting the bug. I was able to reproduce your error and removed the bug in the new script version 20.0.0.3. Please replace your current Visible-Overworld-Wild-Encounters Plugin-In by the newest version.
     
    308
    Posts
    4
    Years
  • (solved)
    Hi! just want to say how great this mod and collection of add-ons is, it really brings 2D pokemon to life in a very very special way.

    I wanted to ask about an issue I'm having regarding animations in aggressive encounters. I saw someone had a similar problem above and followed the same instructions on a fresh install. The only thing I changed was to set:

    Trying it out, the animation plays fine for when the Pokemon are aggrod, but I can't seem to get the Enc_Spawn_Animations and Perma_Enc_Animations to appear. I tried adding the Additional Animations script as well but it doesn't seem to be working. (Update: I understand now that the script for these animations are in Additional Animations and not in the base plugin.) Upon further testing with Additional Animations, it looks like Enc_Spawn_Animations and Perma_Enc_Animations for Shiny Pokemon works perfectly.

    Update:
    it seemed like the "VisibleEncounterSettings::Enc_Spawn_Animations.push(" in the Aggressive Encounters script wasn't getting called, and :aggressive wasn't being checked for in the "for anim in VisibleEncounterSettings::Enc_Spawn_Animations" loop. I was thinking maybe the definition in Additional Animations was overriding the AGG_ANIMATIONS array, but changing the file name didn't work. (The scripts were each in their own plugin folder, with the original names.)

    I managed to get the animations to work by adding the array directly into the Additional Animations script.
    Is there something I should have done differently?

    Once again, amazing suite of plugins, your notation especially is really really easy to follow and great to read

    Thank you for reporting the bug in the aggressive encounters add-on. I found the source of that issue and removed it. The newest script version of the aggressive encounters add-on should work as intended now.
     
    308
    Posts
    4
    Years
  • Hi all,

    I was recently trying this script for my own in Pokémon Essentials GSC (v18.1) and I got this error message.

    Here's the error:
    https://imgur.com/gallery/eTalFtI
    Visible Overworld Wild Encounter


    This is happening to me when the Pokémon vanished. When he makes all is steps before vanishing It works for me but when he is supposed to vanish that game error happens.
    So, as a possible solution for me would be set another type of STEPSBEFOREVANISHING method like a timer or something. Another possible solution would be in Game_Characters just making possible to vanish an event. Althought, I don't know how to do it.

    ¿Could anyone help me with this?
    It seems, that you are not using the official version of Pokemon Essentials 18.1 (for short PEv18.1).

    For me, it seems that your customized PEv18.1 contains errors. Maybe you have some typing mistake in your Pokemon Essentials Development version and you must find that mistake and correct it.
    Therefor, Please open the stript editor of RPGMakerXP (Press F11) and go into the script with name "Game_Event". Then on line 139 the error happens. Try to compare that line in your custom PEv18.1 with the corresponding line in the official PEv18.1. I hope you will find the error. If you need help, then you can send me the lines 129-149 via direct message (but I'm not sure if I can help you with your customized version). But please don't send upcoming questions in this thread, since your current issue does not come from the visible overworld wild encounters script.

    By the way PEv18.1 is outdated and so it is with the visible overworld wild encounters script v18.0.8. Hence, it is recommanded to use the newest versions.
     
    Last edited:
    163
    Posts
    7
    Years
    • Seen yesterday
    Hi, I've been trying to implement solutions for the cutscenes, but I've only managed to stop the spawn encounters until the scene is over, but the Pokemon that already appeared before are still hanging around. I read the post and the suggestion of game_temp.in_menu = true but I would like to know (if I missed it somewhere), is there any command to just make all the Pokemon that have appeared on the map at that moment disappear?

    Thank you very much again for this fantastic script.
     
    308
    Posts
    4
    Years
  • Hi, I've been trying to implement solutions for the cutscenes, but I've only managed to stop the spawn encounters until the scene is over, but the Pokemon that already appeared before are still hanging around. I read the post and the suggestion of game_temp.in_menu = true but I would like to know (if I missed it somewhere), is there any command to just make all the Pokemon that have appeared on the map at that moment disappear?

    Thank you very much again for this fantastic script.

    If you want to remove all spawned pokemon on the map, then you can either
    • include the add-on "Remove Poke Events On Load Save Transfer - Overworld Encounters Add On" from the github folder, or
    • add the following code
      Spoiler:

      to your project.

    With both solutions, you can use the methods
    Code:
    pbRemovePokeEvents
    and
    Code:
    pbRemovePokeEventsInMap
    in script commands at the beginning of your cutscene (or your event) to remove all spawned pokemon on the map.

    Moreover, if you choose the first solution, then spawned pokemon will also vanish every time you reload the game (See
    https://www.pokecommunity.com/showpost.php?p=10395097&postcount=382 for more details).
     
    163
    Posts
    7
    Years
    • Seen yesterday
    If you want to remove all spawned pokemon on the map, then you can either
    • include the add-on "Remove Poke Events On Load Save Transfer - Overworld Encounters Add On" from the github folder, or
    • add the following code
      Spoiler:

      to your project.

    With both solutions, you can use the methods
    Code:
    pbRemovePokeEvents
    and
    Code:
    pbRemovePokeEventsInMap
    in script commands at the beginning of your cutscene (or your event) to remove all spawned pokemon on the map.

    Moreover, if you choose the first solution, then spawned pokemon will also vanish every time you reload the game (See
    https://www.pokecommunity.com/showpost.php?p=10395097&postcount=382 for more details).

    Thank you so much for this information. I love this script!!
     
    14
    Posts
    1
    Years
    • Seen Oct 19, 2023
    l believe the Ditto transforming into another Pokémon plugin isn't working, because the Ditto appear with their regular sprite instead of other Pokémon's sprites
     
    308
    Posts
    4
    Years
  • l believe the Ditto transforming into another Pokémon plugin isn't working, because the Ditto appear with their regular sprite instead of other Pokémon's sprites

    Do you use Essentials Deluxe [v20.1]? If so, then your error comes from that plugin. Essentials Deluxe [v20.1] overwrites code of the Ditto Transform add-on (namely the method "ow_sprite_filename"). Please inform the developer of Essentials Deluxe [v20.1] that its plugin causes incompatibality with the Visible Overworld Wild Encounters Add-On Ditto Transform.
    In additon, to make Ditto Transform still work you can copy all the code in the script file of Ditto Transform at the bottom of your Essentials Deluxe [v20.1] script.

    If you don't use Essentials Deluxe [v20.1], then please let me know, which version of Pokemon Essentials and which version of the visible overworld wild encounters plugin do you use. And what other plugins have you installed?
     
    163
    Posts
    7
    Years
    • Seen yesterday
    Hello! Me again...
    So far the script is still working quite well...
    However I have a mystery that I haven't managed to solve...

    There is one map in particular and only one... Where the spawn work (you see the grass animation and the Pokemon's cry) but the graphics don't appear.
    It's as if they were invisible spawn . However, it's enough to go to another map with encounters for everything to return to normal.

    I checked the map events to see if there is something causing the problem, but it seems I only have processes that already work correctly on other maps.
    Does anyone have any idea why this might be happening?

    Regards and thanks again
     
    308
    Posts
    4
    Years
  • Hello! Me again...
    So far the script is still working quite well...
    However I have a mystery that I haven't managed to solve...

    There is one map in particular and only one... Where the spawn work (you see the grass animation and the Pokemon's cry) but the graphics don't appear.
    It's as if they were invisible spawn . However, it's enough to go to another map with encounters for everything to return to normal.

    I checked the map events to see if there is something causing the problem, but it seems I only have processes that already work correctly on other maps.
    Does anyone have any idea why this might be happening?

    Regards and thanks again

    Well, it is quite hard to find out what causes the error, especially since the error has that strange behavior.

    Can you run into invisible spawned pokemon such that a poke battle triggers, or does the map remain empty until you do the trick with map transitions?
    Is the map where the error occures directly connected to other maps, or only connected via map transitions (such as through doors)? Do you have placed events on the map where the error occurs? Or is something different at this map?
    Which add-ons do you use additionally to the visible overworld wild encounters plugin?

    If you give me enough informations, then I can maybe rebuild it and reproduce your error.
     
    163
    Posts
    7
    Years
    • Seen yesterday
    Well, it is quite hard to find out what causes the error, especially since the error has that strange behavior.

    Can you run into invisible spawned pokemon such that a poke battle triggers, or does the map remain empty until you do the trick with map transitions?
    Is the map where the error occures directly connected to other maps, or only connected via map transitions (such as through doors)? Do you have placed events on the map where the error occurs? Or is something different at this map?
    Which add-ons do you use additionally to the visible overworld wild encounters plugin?

    If you give me enough informations, then I can maybe rebuild it and reproduce your error.

    Indeed, I can't start battles with the invisible Pokemon. I only see the animation of the grass and hear the sound, but my approaching the battle doesn't start.

    EDIT: Solved! It had to do with an erroneous handling of a common event and the
    Code:
    pbBridgeOn
    command. It's not to do with the script, it was a common event error by me :P.
    (I had activated a old mechanism every time a bridge was activated, so the appearances were not seen above the bridge : /. Now it is time to find a way to change the priority of encounters each time a bridge is used.).
     
    Last edited:
    14
    Posts
    1
    Years
    • Seen Oct 19, 2023
    Do you use Essentials Deluxe [v20.1]? If so, then your error comes from that plugin. Essentials Deluxe [v20.1] overwrites code of the Ditto Transform add-on (namely the method "ow_sprite_filename"). Please inform the developer of Essentials Deluxe [v20.1] that its plugin causes incompatibality with the Visible Overworld Wild Encounters Add-On Ditto Transform.
    In additon, to make Ditto Transform still work you can copy all the code in the script file of Ditto Transform at the bottom of your Essentials Deluxe [v20.1] script.

    If you don't use Essentials Deluxe [v20.1], then please let me know, which version of Pokemon Essentials and which version of the visible overworld wild encounters plugin do you use. And what other plugins have you installed?

    indeed i use that script!!
     
    3
    Posts
    1
    Years
    • Seen Jan 8, 2023
    I found a blip in the Ditto Transform plugin:
    - If the choose_wild_pokemon command returns Ditto (since it's in the encounter table), it stays as Ditto.

    Shouldn't it keep rerolling until it gets a non-Ditto encounter?
     
    308
    Posts
    4
    Years
  • I found a blip in the Ditto Transform plugin:
    - If the choose_wild_pokemon command returns Ditto (since it's in the encounter table), it stays as Ditto.

    Shouldn't it keep rerolling until it gets a non-Ditto encounter?

    If you choose that Ditto gets the overworld appearance of any other map encounter in your game, then it is possible that it could still remain as Ditto since it took the appearance of some other Ditto. This is totally normal behaviour of Ditto.

    Imagine there are only Dittos as encounters on a map and it would reroll every time choose_wild_pokemon returns Ditto, then the game would stuck in an infinite loop.

    However, if you want that rerolling, then try the following code instead of the original ditto transform code:
    Code:
    #===============================================================================
    # Ditto Transform - Overworld Encounters Add-On * by derFischae
    #===============================================================================
    
    # This is an add-on for the visible overworld wild encounter script.
    # It adds automatic pokemon spawning to the script.
    
    # FEATURES INCLUDED:
    #  - Like in Pokemon Go, transformable Pokemon such as Ditto get the overworld appearance of different species
    #  - Choose in settings if completely random, set by a list of candidates or set by the map encounters
    
    # INSTALLATION:
    # 1) Place the folder of this plugin in your plugins folder
    # 2) Open the file add_on_ditto_transform.rb and change the parameter TRANSFORMS to your liking in the settings section.
    
    
    #===============================================================================
    #    Settings
    #===============================================================================
    module VisibleEncounterSettings
        TRANSFORMS = [                      # default
          [:DITTO],                         # means - Ditto will have any overworld appearence of encounters of the map where you are
          [:MEW, nil],                      #       - Mew will have overworld appearence of any random species
          [:SMEARGLE, :BULBASAUR, :PIDGEY]  #       - Smeargle will have the overworld sprite of one of the following pokemon, i.e. bulbasaur and pidgey.
        ]
        # This parameter is used to change the overworld appearence of pokemon such as ditto.
        # The data is stored as an array of arrays. You can add your own arrays or change/remove the existing.
        # The first entry  - is the species that transforms its overworld appearence.
        # No more entries  - means the species have any overworld appearence of encounters of the map where the player is.
        # nil              - means the species will have overworld appearence of any random species.
        # species names    - means the species will have random overworld appearence of one of that following species.
    
        REAL_APPEARANCE_POSSIBLE = false # default true
        # This parameter is used to if pokemon can appear with there real appearance or will spawn always with a fake one.
        # true     - means the species (such as Ditto) can spawn with its real appearance
        # false    - means the species (such as Ditto) can't spawn with its real appearance (as long as there are other map encounters where Ditto can copy the appearance from).
    
      end
      
      
      #===============================================================================
      #    Script
      #===============================================================================
      
      #-------------------------------------------------------------------------------
      # Overwriting method ow_sprite_filename to include ditto transform 
      #-------------------------------------------------------------------------------
      alias ditto_ow_sprite_filename ow_sprite_filename
      def ow_sprite_filename(species, form = 0, gender = 0, shiny = false, shadow = false)
        for transform in VisibleEncounterSettings::TRANSFORMS
          next if transform[0] != species.to_sym
          enc_type = $game_temp.encounter_type
          if transform.size == 1
            enc_list = $PokemonEncounters.encounter_tables[enc_type]
            new_enc_list = []
            enc_list.each do |enc|
              new_enc_list.push(enc[1])  #enc[1] is species
            end
            enc_list = new_enc_list
          elsif transform.size == 2 && !transform[1]
            enc_list = GameData::Species.keys
          else
            enc_list = transform.shift
          end
          if VisibleEncounterSettings::REAL_APPEARANCE_POSSIBLE == false
            new_enc_list = enc_list-[transform[0]]
            enc_list = new_enc_list if new_enc_list.length > 0
          end
          k = rand(enc_list.size)
          species = enc_list[k]
          return ditto_ow_sprite_filename(species, form, gender, shiny, shadow)
        end
        return ditto_ow_sprite_filename(species, form, gender, shiny, shadow)
      end

    I haven't tested it. So, please let me know if it works as intended.
     
    Last edited:
    163
    Posts
    7
    Years
    • Seen yesterday
    Hi again!

    I am still exploring some things with this script and I have three questions, which may sound a bit obvious, but maybe they can contribute something if they have not been discussed.

    1. I'm trying to implement an animation for the vanish moment, so in that way is not just a simple dissipation of the graphic and nothing else. I assigned a value to, for example:
    Code:
    DEFAULT_VANISH_ANIMATION_ID
    I manage to activate the animation with
    Code:
    $scene.spriteset.addUserAnimation(VisibleEncounterSettings::DEFAULT_VANISH_ANIMATION_ID,x,y,true,1)
    but it takes place in the character since in
    Code:
    removeThisEventfromMap
    we don't have X and Y defined. Is there a way to define them? That way the animation can appear in the event and not in the player.

    2. I use Always inside Bushes - By Kotaro and it works well for making follower Pokémon sink in water, but I can't get it to make some aquatic Pokémon sink in water when they spawn (e.g. Psyduck, who is not a fish and seems to be walking on water). Would it be a good idea to implement a compatibility? Maybe it exists and I've lost sight of it in all the post of the thread?

    3. Is there a way to determine in battle if the aggressive encounter has been activated? I'm looking to make it so that, for example, maybe the aggressive Pokemon always attacks first or other mechanics like that.

    Thank you very much again for sharing this script (and sorry for my english)
     
    Last edited:
    308
    Posts
    4
    Years
  • Hi again!

    I am still exploring some things with this script and I have three questions, which may sound a bit obvious, but maybe they can contribute something if they have not been discussed.

    1. I'm trying to implement an animation for the vanish moment, so in that way is not just a simple dissipation of the graphic and nothing else. [...]

    2. I use Always inside Bushes - By Kotaro and it works well for making follower Pokémon sink in water, but I can't get it to make some aquatic Pokémon sink in water when they spawn (e.g. Psyduck, who is not a fish and seems to be walking on water). Would it be a good idea to implement a compatibility? Maybe it exists and I've lost sight of it in all the post of the thread?

    3. Is there a way to determine in battle if the aggressive encounter has been activated? I'm looking to make it so that, for example, maybe the aggressive Pokemon always attacks first or other mechanics like that.

    Thank you very much again for sharing this script (and sorry for my english)

    Concerning 1): I included animations for despawning pokemon in the additional animations add-on for you. Simply include the newest version of that add-on to your project, the parameter where you add the default animation for despawning is called DEFAULT_DESPAWN_ANIMATION_ID.

    Concerning 2): Long time ago, I made a modification of KleinStudio's "Always on bush" script for Pokemon Essentials 17.2. The modification made all events on water sink in. So, maybe this is what you are looking for. The link is https://www.pokecommunity.com/showthread.php?t=429020

    Concerning 3): Please note that you want your modifications for the battle only to trigger during wildbattle with spawned pokemon. To ensure that, you should always check that
    Code:
     PokemonGlobalMetadata::battlingSpawnedPokemon == true
    at the beginning of your new code. If you need more informations then you can read the subsection about "instructions on how to make your own Add-On [...]" in the main thread.

    In battle, there is definitely a way to determine if the aggressive encounter has been activated. It just depends on where you want to add your changes for battle.
    • If you want to add your modifications to the class Battle in file ".\Data\Scripts\011_Battle\001_Battle\001_Battle.rb", then you get access to the wild pokemon the following
      Code:
      spawned_pkmn = @opponent
    • If you want to modify the methods "self.start" or "self.start_core" in class WildBattle in file ".\Data\Scripts\012_Overworld\002_Battle triggering\001_Overworld_BattleStarting.rb", then you get access to the wild pokemon by
      Code:
      spawned_pkmn = foe_party[0]
      or
      Code:
      spawned_pkmn = battle.opponent
    In all situations, this pokemon is aggressive if and only if
    Code:
    spawned_pkmn.aggressive == true
     
    Last edited:
    163
    Posts
    7
    Years
    • Seen yesterday
    Concerning 1): I included animations for despawning pokemon in the additional animations add-on for you. Simply include the newest version of that add-on to your project, the parameter where you add the default animation for despawning is called DEFAULT_DESPAWN_ANIMATION_ID.

    Concerning 2): Long time ago, I made a modification of KleinStudio's "Always on bush" script for Pokemon Essentials 17.2. The modification made all events on water sink in. So, maybe this is what you are looking for. The link is https://www.pokecommunity.com/showthread.php?t=429020

    Concerning 3): Please note that you want your modifications for the battle only to trigger during wildbattle with spawned pokemon. To ensure that, you should always check that
    Code:
     PokemonGlobalMetadata::battlingSpawnedPokemon == true
    at the beginning of your new code. If you need more informations then you can read the subsection about "instructions on how to make your own Add-On [...]" in the main thread.

    In battle, there is definitely a way to determine if the aggressive encounter has been activated. It just depends on where you want to add your changes for battle.
    • If you want to add your modifications to the class Battle in file ".\Data\Scripts\011_Battle\001_Battle\001_Battle.rb", then you get access to the wild pokemon the following
      Code:
      spawned_pkmn = @opponent
    • If you want to modify the methods "self.start" or "self.start_core" in class WildBattle in file ".\Data\Scripts\012_Overworld\002_Battle triggering\001_Overworld_BattleStarting.rb", then you get access to the wild pokemon by
      Code:
      spawned_pkmn = foe_party[0]
      or
      Code:
      spawned_pkmn = battle.opponent
    In all situations, this pokemon is aggressive if and only if
    Code:
    spawned_pkmn.aggressive == true

    Oh my goodness, thank you so much for all these responses and updates.
    I love it when beautiful scripts like these lead to new mechanics and I appreciate the dedication in your answer and your work.
    Thanks again :). I'm running to implement this.

    EDIT: I have implemented some changes, but I get always
    Code:
    undefined method `aggressive' for nil:NilClass?
    What could be wrong with my approach?
     
    Last edited:
    Back
    Top