• 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

  • 62
    Posts
    6
    Years
    • Seen Aug 11, 2022
    Hello
    can you attach a screenshot to see what it looks like.
    Because I think the original is not bad too.
     
  • 195
    Posts
    7
    Years
    • Seen yesterday
    https://imgur.com/a/n109XZn
    Alright this is the third time I've had to ask for help, which I think is too many. There is no error on ice, like you thought. It's just this error that pops up after every f12 refresh. I'm starting to lose patience. Thanks in advance.
     
  • 62
    Posts
    6
    Years
    • Seen Aug 11, 2022
    https://imgur.com/a/n109XZn
    Alright this is the third time I've had to ask for help, which I think is too many. There is no error on ice, like you thought. It's just this error that pops up after every f12 refresh. I'm starting to lose patience. Thanks in advance.

    I don't know if it can help but I have the Script Following Pokémon.
    When I press F12, the follower Pokémon enters its pokéball.
    Maybe you don't have the Script Following Pokémon...
     
  • 308
    Posts
    4
    Years
    https://imgur.com/a/n109XZn
    Alright this is the third time I've had to ask for help, which I think is too many. There is no error on ice, like you thought. It's just this error that pops up after every f12 refresh. I'm starting to lose patience. Thanks in advance.
    Pay attention to your tone. Especially, since this is not the third time you asked. Because contrarily, you claimed in your second post that you had fixed your stack overflow issue by yourself.
    Following on from my last post, I think the stack overflow thing I was getting was fixed with a simple reinstall. This time I come with a slight oversight you may not have thought of: cave encounters. From what I'm seeing, they can spawn on impassable tiles (such as the black tile used to surround maps)
    https://imgur.com/a/6LubjmP
    All your other problems have been solved in this thread and even for your still unsolved (which we only know since your last post) issue we tried to help.
    I think you should show some gratitude instead of making demands.

    And now to your error message. The method "original_increase_steps" links to the allready defined method "increase_steps". This method is not defined in the visible overworld wild encounter script. It is defined in Pokemon Essentials or could be overwritten by any other script you installed. If you use f12 without closing the test window, then the game memory will not be cleared. This leads to the problem that the method "original_increase_steps" does not link to the original method "increase_steps" anymore, but to the later defined method "increase_steps" in the visible overworld wild encounter script. This behaviour leads to the stack overflow after using f12 without closing the window and, by the way, can occure in any arbitrary script which uses the "alias" command. That's why I do not recommand to use f12 without closing the window.

    However, if you want to continue with your workflow and use f12, then you can do so by modifying the code in the following way:
    Go find the following code in the visible overworld wild encounter script (it is the snippet where your errors occure)
    Code:
      alias original_increase_steps increase_steps
      def increase_steps
        if self.name=="vanishingEncounter" && @stepCount && @stepCount>=STEPSBEFOREVANISHING
          removeThisEventfromMap
        else
          @stepCount=0 if (!@stepCount || @stepCount<0)
          @stepCount+=1
          original_increase_steps
        end
      end
    and replace it by
    Code:
    def increase_steps
        if self.name=="vanishingEncounter" && @stepCount && @stepCount>=STEPSBEFOREVANISHING
          removeThisEventfromMap
        else
          @stepCount=0 if (!@stepCount || @stepCount<0)
          @stepCount+=1
          @stop_count = 0
          triggerLeaveTile()
        end
      end
    It will work, I tested it. However, if you use any other script that overwrites the Method "increase_steps" of Class "Game_Character" in Script section "Game_Character", then this new code above will neglect that changes of that other script and could lead to compatibly problems. The original code above will not due to the alias command.

    You're welcome.
     
  • 195
    Posts
    7
    Years
    • Seen yesterday
    Pay attention to your tone. Especially, since this is not the third time you asked. Because contrarily, you claimed in your second post that you had fixed your stack overflow issue by yourself.

    All your other problems have been solved in this thread and even for your still unsolved (which we only know since your last post) issue we tried to help.
    I think you should show some gratitude instead of making demands.

    And now to your error message. The method "original_increase_steps" links to the allready defined method "increase_steps". This method is not defined in the visible overworld wild encounter script. It is defined in Pokemon Essentials or could be overwritten by any other script you installed. If you use f12 without closing the test window, then the game memory will not be cleared. This leads to the problem that the method "original_increase_steps" does not link to the original method "increase_steps" anymore, but to the later defined method "increase_steps" in the visible overworld wild encounter script. This behaviour leads to the stack overflow after using f12 without closing the window and, by the way, can occure in any arbitrary script which uses the "alias" command. That's why I do not recommand to use f12 without closing the window.

    However, if you want to continue with your workflow and use f12, then you can do so by modifying the code in the following way:
    Go find the following code in the visible overworld wild encounter script (it is the snippet where your errors occure)
    Code:
      alias original_increase_steps increase_steps
      def increase_steps
        if self.name=="vanishingEncounter" && @stepCount && @stepCount>=STEPSBEFOREVANISHING
          removeThisEventfromMap
        else
          @stepCount=0 if (!@stepCount || @stepCount<0)
          @stepCount+=1
          original_increase_steps
        end
      end
    and replace it by
    Code:
    def increase_steps
        if self.name=="vanishingEncounter" && @stepCount && @stepCount>=STEPSBEFOREVANISHING
          removeThisEventfromMap
        else
          @stepCount=0 if (!@stepCount || @stepCount<0)
          @stepCount+=1
          @stop_count = 0
          triggerLeaveTile()
        end
      end
    It will work, I tested it. However, if you use any other script that overwrites the Method "increase_steps" of Class "Game_Character" in Script section "Game_Character", then this new code above will neglect that changes of that other script and could lead to compatibly problems. The original code above will not due to the alias command.

    You're welcome.

    Thank you. I thought it had fixed itself when I reinstalled the script but apparently that wasn't the case. I was at my wits end with it when I posted the other time, and I'm grateful for all the help you've given me.
     
  • 308
    Posts
    4
    Years
    I have tested multiple times but still the Overworld is not using the shiny sprite. All shiny sprites are properly placed in Graphics/Characters but still it is giving normal sprite.

    Strange, usually there are no problems with shiny overworld sprites.
    First of all, which version of Pokemon Essentials do you use and which version of this visible overworld wild encounter script have you installed?
    Moreover, we need some more details on what happens exactly.
    - Are there shiny pokemon moving on the overworld, but they are invisible? You can still detect them because of their grass rustleing, and if you move to that tile you get an encounter.
    - Are there no shiny pokemon sprites on the overworld. But if you fight with them, then some of them have shiny sprites in the battle scene?
    - Are there no shiny pokemon sprites on the overworld and even in battle the pokemon are not shiny?

    The first case can occure if you're missing some shiny sprites in the folder or if the shiny sprites are misspelled or not an png-picture. But your descriptions let me think that this is not your case. Right?
    The second case is quite a strange behaviour which should not be possible, I would say. But if it is the case, then there might be some bug or something else in the code.
    And the third case can have various reasons. I guess this is your case, isn't it?

    Moreover, we need to know, how you have tested the shiny spawning? It is well known that shinys are extremly rare. That's why you might not see any shiny durring normal play. But you can force spawning pokemon to be shiny by activationg the Shiny wild Pokemon Switch 31. Have you tested while this switch 31 was ON? Or have you tried to chain pokemon of one kind to increase the propabiliy of a shiny encounter of that species? This is a special feature in this visible overworld wild encounter script. Or did you just tried to spawn a shiny without specific precautions?
     
    Strange, usually there are no problems with shiny overworld sprites.
    First of all, which version of Pokemon Essentials do you use and which version of this visible overworld wild encounter script have you installed?
    Moreover, we need some more details on what happens exactly.
    - Are there shiny pokemon moving on the overworld, but they are invisible? You can still detect them because of their grass rustleing, and if you move to that tile you get an encounter.
    - Are there no shiny pokemon sprites on the overworld. But if you fight with them, then some of them have shiny sprites in the battle scene?
    - Are there no shiny pokemon sprites on the overworld and even in battle the pokemon are not shiny?

    The first case can occure if you're missing some shiny sprites in the folder or if the shiny sprites are misspelled or not an png-picture. But your descriptions let me think that this is not your case. Right?
    The second case is quite a strange behaviour which should not be possible, I would say. But if it is the case, then there might be some bug or something else in the code.
    And the third case can have various reasons. I guess this is your case, isn't it?

    Moreover, we need to know, how you have tested the shiny spawning? It is well known that shinys are extremly rare. That's why you might not see any shiny durring normal play. But you can force spawning pokemon to be shiny by activationg the Shiny wild Pokemon Switch 31. Have you tested while this switch 31 was ON? Or have you tried to chain pokemon of one kind to increase the propabiliy of a shiny encounter of that species? This is a special feature in this visible overworld wild encounter script. Or did you just tried to spawn a shiny without specific precautions?

    I am using PEv17.2 and Visible Overworld Encounter v1.9.2.
    My problem is related with Case 2. There no shiny pokemon sprites on the overworld. But if I fight with them, then some of them have shiny sprites in the battle scene.
    I also tested by setting the Shiny Rate to 65535 in Settings and 1 in your script. But, the error remain. I am getting Shiny Encounters but the sprite is not showing. I am also using the modification of side-by-side Original Encounter. Can it be the cause?
     
  • 308
    Posts
    4
    Years
    I am using PEv17.2 and Visible Overworld Encounter v1.9.2.
    My problem is related with Case 2. There no shiny pokemon sprites on the overworld. But if I fight with them, then some of them have shiny sprites in the battle scene.
    I also tested by setting the Shiny Rate to 65535 in Settings and 1 in your script. But, the error remain. I am getting Shiny Encounters but the sprite is not showing. I am also using the modification of side-by-side Original Encounter. Can it be the cause?

    Thank you for your report. Indeed, there was a bug in the script concerning shiny encounters. I would not have found that without your post. I never thought on raising the shiny rate in the settings section to test, used always the switch or chaining.

    Now, I updated the script to version 1.10. Needed to change the script on various places. The error should not occure anymore in version 1.10.

    By the way, I also updated the code in the spoiler section about overworld and normal encounters at the same time. The old code for version 1.2 is not compatible anymore to version 1.10.
     
  • 308
    Posts
    4
    Years
    If you want overworld encounters and normal encounters, but also want that the overworld and normal encounters are different. Then you can follow these instructions to gain this functionality.

    1) At first, modify the code of the visible overworld wild encounter script such that there are overworld encounter and normal encounter possible at the same time. Read above on how to do that.

    2) Add the following encounter types
    Code:
    OverworldLand, OverworldCave, OverworldWater, OverworldLandMorning, OverworldLandDay, OverworldLandNight, OverworldBugContest
    to the module EncounterTypes in script section PField_Encounters.
    For more informations on adding new encounter types you can watch Thundaga's Tutorial https://www.youtube.com/watch?v=kdtofAPuyxA beginning at round about 1 min 40 sec.
    If you don't want any special changes or add other encounter types, then it should look like this

    Spoiler:


    3) Find the method "pbEncounterTypeOnTile(x,y)" in the visible overworld wild encounter script and replace it by

    Code:
      def pbEncounterTypeOnTile(x,y)
        if PBTerrain.isJustWater?($game_map.terrain_tag(x,y))
          return EncounterTypes::OverworldWater if self.hasEncounter?(EncounterTypes::OverworldWater)
          return EncounterTypes::Water
        elsif self.isOverworldCave?
          return EncounterTypes::OverworldCave if self.hasEncounter?(EncounterTypes::OverworldCave)
          return EncounterTypes::Cave
        elsif self.isOverworldGrass?
          time = pbGetTimeNow
          enctype = EncounterTypes::Land
          enctype = EncounterTypes::OverworldLand if self.hasEncounter?(EncounterTypes::OverworldLand)
          enctype = EncounterTypes::LandNight if self.hasEncounter?(EncounterTypes::LandNight) && PBDayNight.isNight?(time)
          enctype = EncounterTypes::OverworldLandNight if self.hasEncounter?(EncounterTypes::OverworldLandNight) && PBDayNight.isNight?(time)
          enctype = EncounterTypes::LandDay if self.hasEncounter?(EncounterTypes::LandDay) && PBDayNight.isDay?(time)
          enctype = EncounterTypes::OverworldLandDay if self.hasEncounter?(EncounterTypes::OverworldLandDay) && PBDayNight.isDay?(time)
          enctype = EncounterTypes::LandMorning if self.hasEncounter?(EncounterTypes::LandMorning) && PBDayNight.isMorning?(time)
          enctype = EncounterTypes::OverworldLandMorning if self.hasEncounter?(EncounterTypes::OverworldLandMorning) && PBDayNight.isMorning?(time)
          if pbInBugContest? && self.hasEncounter?(EncounterTypes::BugContest)
            enctype = EncounterTypes::BugContest
            enctype = EncounterTypes::OverworldBugContest if self.hasEncounter?(EncounterTypes::OverworldBugContest)
          end
          return enctype
        end
        return -1
      end

    4) Add the following code below the method
    pbEncounterTypeOnTile(x,y) in class PokemonEncounters in the
    visible overworld wild encounter script

    Code:
      def isOverworldCave?
        return false if @density==nil
        return (@enctypes[EncounterTypes::Cave] || @enctypes[EncounterTypes::OverworldCave]) ? true : false
      end
    
      def isOverworldGrass?
        return false if @density==nil
        return (@enctypes[EncounterTypes::Land] ||
                @enctypes[EncounterTypes::LandMorning] ||
                @enctypes[EncounterTypes::LandDay] ||
                @enctypes[EncounterTypes::LandNight] ||
                @enctypes[EncounterTypes::BugContest] ||
                @enctypes[EncounterTypes::OverworldLand] ||
                @enctypes[EncounterTypes::OverworldLandMorning] ||
                @enctypes[EncounterTypes::OverworldLandDay] ||
                @enctypes[EncounterTypes::OverworldLandNight] ||
                @enctypes[EncounterTypes::OverworldBugContest]) ? true : false
      end

    5) Now, you can set the overworld encounters independently from the normal encounters in OverworldLand, OverworldWater etc.
    And if you don't set an overworld encounter type, then the corresponding original encounter type will automatically be used for overworld spawning.
     
  • 308
    Posts
    4
    Years
    I would like to make an exception for the legendary Pokémon.
    I wish they would not appear in overworld mode but only in the grass.
    (I use this method because I have both type of wild encounter in my game. Normal encounter and overworlds encounter as you mentioned in INSTANT_WILD_BATTLE_PROPABILITY

    Thanks in advance and I continue to enjoy your awesome scripts.

    If you want to forbid certain pokemon/legendaries/roaming encounters to spawn as overworld encounters, then there is are multiple ways to reach this.

    1) If you you want to forbidd roaming encounters to appear on the overworld, then you can simply remove the line
    Code:
      encounter = EncounterModifier.trigger(encounter)
    in the method "pbChooseEncounter(x,y,repel=false)" in the visible overworld wild encounter script.
    But this way has a huge disadvantage. You will also remove spawning of alternate forms on the overworld. Only the original form of pokemon can spawn. If this is okay for you, then you can use this way.

    2) With this second way, you can forbidd any pokemon you want from spawning as an overworld encounter. It is not restricted to roaming encounters.
    You can use a BANLIST, containing all numbers of pokemon which shall not spawn as overworld encounters. To do this, you have to do the following two substeps-
    2i) Add the following code
    Code:
    BANLIST = [36,150,162] # default []
    #contains the numbers of pokemon which shall not spawn as overworld encounters.
    above
    Code:
    RESTRICTENCOUNTERSTOPLAYERMOVEMENT = false
    in the settings section of the visible overworld wild encounter script.

    2ii) Now, find the method "pbChooseEncounter(x,y,repel=false)" and replace the following code snippet in that method
    Code:
      if !$PokemonEncounters.pbCanEncounter?(encounter,repel)
        $PokemonTemp.forceSingleBattle = false
        EncounterModifier.triggerEncounterEnd()
        return
      end
    by
    Code:
      if (!$PokemonEncounters.pbCanEncounter?(encounter,repel) || BANLIST.include? (encounter[0]))
        $PokemonTemp.forceSingleBattle = false
        EncounterModifier.triggerEncounterEnd()
        return
      end
    or maybe "BANLIST.include? (encounter))" without [0]. I haven't test it, but, I guess that it will work. I would be glad if you let me know if it works.

    3) And of course it is possible to follow the instructions on how to have different encounters for overworld and normal encountering, and simply add only allowed pokemon in the list of the overworld encounter types in encounters.txt.
    Note that roaming encounters can still appear as overworld encounters with this way.
     
  • 308
    Posts
    4
    Years
    And I'd like that during the double encounters, there is only one Pokémon and not two.
    To make it more realist.

    Using the visible overworld wild encounter script, a pokemon spawns in tall grass, but you will get into a double battle with it an another pokemon. If you want that both pokemon in double battle are from the same species, then you can replace the line
    Code:
        encounter2 = $PokemonEncounters.pbEncounteredPokemon($PokemonTemp.encounterType)
    by
    Code:
        encounter2 = [species,level]
    in method "pbSingleOrDoubleWildBattle(species,level,map_id,x,y,gender = nil,form = nil,shinysprite = nil)".
    I haven't tested it, but I guess that it should work. Note that the second pokemon also has the same level as the first one with this modification.
     
    Last edited:
  • 308
    Posts
    4
    Years
    Here is my error. Watch that Watchog and not Hoothoot(it is an event). Watchog dont show the always in grass script outcome. Thank you.

    So you have installed at least the scripts
    - "allways on bush" https://www.pokecommunity.com/showthread.php?t=429020
    - this visible overworld wild encounter script and
    - a third script which makes the grass look like it is bend down.
    Right? Can you give a link to the code of that third script? I'm asking because in my case (I use only the first two scripts) everything looks good. Maybe, the third script is producing the incompatibility.
     
    So you have installed at least the scripts
    - "allways on bush" https://www.pokecommunity.com/showthread.php?t=429020
    - this visible overworld wild encounter script and
    - a third script which makes the grass look like it is bend down.
    Right? Can you give a link to the code of that third script? I'm asking because in my case (I use only the first two scripts) everything looks good. Maybe, the third script is producing the incompatibility.

    That is Tall Grass Script by WolfPP. Link here- https://www.pokecommunity.com/showthread.php?t=421411
     
  • 308
    Posts
    4
    Years
    That is Tall Grass Script by WolfPP. Link here- https://www.pokecommunity.com/showthread.php?t=421411

    Thank you. I also noticed that Watchog's feet are higher than Hoothoot's feet with respect to the bottom of the tile they are standing on.
    Maybe, the bush depth is just a little bit to small. You can test that in an easy way. Go to the allways in bush script and replace every "return 12" to "replace 30" in method bush_depth in class Game_Character. Then the bush_depth should be so high that you can only see the head of the pokemon. Does the error still occure, can you still see the feet while movement?
     
    Back
    Top