• 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 places on the 'net to talk Pokémon and more! Community members will not see the bottom screen advertisements.
  • Want to share your adventures playing Pokémon?
    Check out our new Travel Journals forum for sharing playthroughs of ROM Hacks, Fan Games, and other Pokémon content!
  • IMPORTANT: Following a takedown request, the following hacks have been delisted from PokéCommunity:

    • Pokémon Glazed
    • Pokémon: Giratina Strikes Back
    • Pokémon Flora Sky
    • Pokémon Stranded
    The downloads and discussion threads for these hacks will no longer be accessible, and staff will be unable to return questions regarding accessing this content.

Script: Visible Overworld Wild Encounter

297
Posts
4
Years
V21.1

After the first 2 images I removed the first 'do' (see below) but when I finally got it working it crashed, showing image 3.

Thank you for reporting the bug in Max Spawn Addon. I updated the code. It should work now. You can find the new version of the max spawn addon on the github repository.
 
297
Posts
4
Years
How would you keep events spawned on Transfer or Save Load?

The behaviour of spawned pokemon is basically the same as for ordinary events placed in the map editor. More precisely, this means
  1. If you save your game, then the position of spawned pokemon will also be saved on the current map (as it is for ordinary events such as trainers).
  2. Moreover, if you move to directly adjoining map then all spawned pokemon are still active and moving as usual. You also can go back to them.
  3. And if you transfer to a map that is not adjoined (for example by using a teleporter or a door event, or simply moving to far away) and return right back then all events are back on there starting position (and for overworld encounters that means not yet spawned).
However, If you want that spawned pokemon always wait on the map till the player comes back (even in situation 3) then you can add the following code to the bottom of your 001_visible overworld wild encounters script.rb file in your plugins folder.

Ruby:
class Game_PokeEvent < Game_Event
  attr_accessor :event
end

class Game_Map
  attr_accessor :events
end

class Game_Temp
  attr_accessor :overworld_pokemon_data

  alias o_initialize initialize
  def initialize
    @overworld_pokemon_data = {}
    o_initialize
  end
end

#===============================================================================
# Checks when moving between maps
#===============================================================================
EventHandlers.add(:on_leave_map, :save_overworld_pokemon,
  proc { |new_map_id, new_map|
    $game_temp.overworld_pokemon_data = {} if !$game_temp.overworld_pokemon_data
    old_map_id = $game_map.map_id
    $game_temp.overworld_pokemon_data[old_map_id] = []
    if $game_map.events
      for event in $game_map.events do
        event = event[1]
        if event.is_a?(Game_PokeEvent)
          $game_temp.overworld_pokemon_data[old_map_id].push(event)
        end
      end
    end
  }
)

EventHandlers.add(:on_enter_map, :load_overworld_pokemon,
  proc { |old_map_id|   # previous map ID, is 0 if no map ID
    map_id = $game_map.map_id
    game_map = $game_map
    if $map_factory
      game_map = $map_factory.getMap(map_id)
    end
    if $game_temp.overworld_pokemon_data.has_key?(map_id)
      for event in $game_temp.overworld_pokemon_data[map_id] do
        key_id = event.id
        conflict = false
        next if game_map.events.has_key?(key_id)
        for placed_event in game_map.events.values do
          if placed_event.x ==event.x && placed_event.y == event.y
            conflict = true
            break
          end
        end
        next if conflict == true

        gameEvent = Game_PokeEvent.new(map_id, event.event, game_map)
        gameEvent.id = key_id
        gameEvent.moveto(event.x,event.y)
        gameEvent.pokemon = event.pokemon
        gameEvent.remaining_steps = event.remaining_steps

        game_map.events[key_id] = gameEvent
        sprite = Sprite_Character.new(Spriteset_Map.viewport,game_map.events[key_id])
        $scene.spritesets[map_id]=Spriteset_Map.new(game_map) if $scene.spritesets[map_id]==nil
        $scene.spritesets[map_id].character_sprites.push(sprite)
      end
    end
  }
)
 
34
Posts
6
Years
  • Age 34
  • Seen yesterday
Hello derFischae,

first of all, your plugins are absolutely amazing!
Some of the players of my game occasionally report me a "stack level too deep" error they run into, caused by the "Additional Animations" addon. Do you have an idea what could cause it? Is seems to only happen to a handful of people 🤔
I am on Essentials v20.1, main plugin version 20.0.0.4, the addon is version 1.4.
IMG_5202.jpg
 
297
Posts
4
Years
Some of the players of my game occasionally report me a "stack level too deep" error they run into, caused by the "Additional Animations" addon. Do you have an idea what could cause it? Is seems to only happen to a handful of people 🤔
I am on Essentials v20.1, main plugin version 20.0.0.4, the addon is version 1.4.
The mysterious "stack level too deep" error was discussed before. Right now, There is only one reason known. That is if someone presses the F12 button during playtesting without closing the game window before. More about that can be read in
https://www.pokecommunity.com/showpost.php?p=10393908&postcount=378
Please let me know, if this (or something similar) was done by the handful of people, or if there seems to be another (yet unknown) reason.
 
34
Posts
6
Years
  • Age 34
  • Seen yesterday
Sorry, I did not go through all the pages of this thread :( I did test what you described and the F12 button is indeed the cause of the error! The reply you linked is from 2 years ago and seems to describe an old version of the particular section of code in the plugin, could you maybe indicate how the respective adjustment of the v20.0.0.4 version code would look like (see below the v.20.0.0.4 code)? Thank you for your quick help!

Ruby:
  alias original_increase_steps increase_steps
  def increase_steps
    if @remaining_steps <= 0
      removeThisEventfromMap
    else
      @remaining_steps-=1
      original_increase_steps
    end
  end
 
297
Posts
4
Years
Sorry, I did not go through all the pages of this thread :( I did test what you described and the F12 button is indeed the cause of the error! The reply you linked is from 2 years ago and seems to describe an old version of the particular section of code in the plugin, could you maybe indicate how the respective adjustment of the v20.0.0.4 version code would look like (see below the v.20.0.0.4 code)? Thank you for your quick help!

Ruby:
  alias original_increase_steps increase_steps
  def increase_steps
    if @remaining_steps <= 0
      removeThisEventfromMap
    else
      @remaining_steps-=1
      original_increase_steps
    end
  end
First of all, I suggest that the error with the F12 reload occurs only during playtesting in debug mode and not in the final version of a game anymore. (Please tell me if I'm wrong.) So, there is no really need to change any code. You can simply close the test game window and restart it instead of pressing F12. But if you want to change the code then the idea is the following
  1. Search for all appearences of the code command alias . Usually, it looks something like the following pseudocode.
    Code:
    alias renamed_method_name method_name
    def method_name
      # some code
      renamed_method_name
      # more code
    end
    This is used to overwrite an already existing method (called method_name in the pseudocode above) in such a way that it adds new code ( # some code and # more code ) but still runs the old original code of that method (at position of # renamed_method_name ). And by the way, this is used for various methods in pokemon essentials and not only in plugins.
  2. Now, search for the original method ( method_name in our example). This might look like the following pseudocode.
    Code:
    def method_name
      # here original code
    end
    Note, that the method might be overwritten more than ones.
  3. Combine everything to a single method. The original code needs to be placed at the position where the overwriting method calls the original method. In pseudocode, it looks something like that
    Code:
    def method_name
      # some code
      # here original code
      # more code
    end
Perhaps, the method that forces your stack overflow error was update beginning in line 124. But it could also be one of the other 3 methods that where renamed with alias and overwritten in the additional animations addon.
 
34
Posts
6
Years
  • Age 34
  • Seen yesterday
It actually does happen in the final version of the game, when you run it via the Game.exe.
Okay, just so I get this correctly: when you say "original method", you refer to the main Script within the Script Editor in RPG Maker? And I would have to combine everything by bringing the original method into the plugin's code as shown above?

Edit: Okay I was just playing around a bit and brought the original "update" method into the plugin - it solved the crash from happening, however now every overworld spawn disappears whenever it is supposed to move for the first time 😅
 
Last edited:
297
Posts
4
Years
It actually does happen in the final version of the game, when you run it via the Game.exe.
Okay, just so I get this correctly: when you say "original method", you refer to the main Script within the Script Editor in RPG Maker? And I would have to combine everything by bringing the original method into the plugin's code as shown above?
Yes, exactly. And combining everything really means combining every occurrence of that mathod in any script or plugin.
Edit: Okay I was just playing around a bit and brought the original "update" method into the plugin - it solved the crash from happening, however now every overworld spawn disappears whenever it is supposed to move for the first time
This is the same problem, but with the method increase_steps , which is overwritten in the visible overworld wild encounters script with the help of an alias . And possiblly this is not the last one. I recommand not to use F12, since this is a constant source for bugs in Pokemon Essentials, for example https://www.pokecommunity.com/showthread.php?t=304195
 
Last edited:
34
Posts
6
Years
  • Age 34
  • Seen yesterday
Yes I will - I think the probability of me breaking something by trying to get all the way to the root of this one is higher than the benefit :) thank you for your help!
 
297
Posts
4
Years
looks like a fun plugin. only thing i want to ask at the moment is that under the v20 and v21 one of the addons was for the lavander town ghosts but the only script for them ive found is for pe17 is this the correct one still? just want to be sure before i break something using the wrong script since it seems to require a lot of editing
I removed that the overworld lavender town ghosts Add-On requires the original lavender town ghost plugin. Now, you can use the overworld version by its own without the full funtionality of the original plugin.
 
218
Posts
9
Years
Hello there! I have an error which i think that where it comes.

So i will give you as much detailed info as i can provide.


Where the error appeared?

I was on an outside map, ex: Route 1, and i was in battle using boons phenomena, in other words, a phenomenon grass encounters. When i run away from battle option, when the game was about "leaving/transiting" from the battle scene into the outside map, this error appeared, i was using the normal way to test my fan game and not using the debug mode, which it could be useful for this, but the error only appears at random and its hard to recreate it again.


I'm still using PEv20.1, i know that you may not give any support since thats PEv21 is out there, or if you can point me into the right direction, maybe my helper can help me fix it, currently we are both "blinded" about this.

Another thing, the map has a parallel process with this.

Sorry to bother you with that and thx for your time.

Spoiler:

Spoiler:

Spoiler:
 
65
Posts
3
Years
I updated the shiny hunting script and I think mine is better
Code:
#===============================================================================
# The Let's Go Shiny Hunting, inpired by Diego Mertens script
# - to make a chained pokemon shiny
#Edit done by lemiho19
#===============================================================================

# This is an add-on for the visible overworld wild encounter script.
# It adds shiny hunting by chaining a pokemon species to the script.
# This script is motified by Diego Mertens Lets's Go Catch Combo, see
# https://www.pokecommunity.com/showthread.php?p=10011513

# FEATURES INCLUDED:
# If you catch the same species in a row, then you increase the chance of
# spawning a shiny of that species.

# INSTALLATION:
# Copy this code and
# Paste it at the bottom of your visible wild overworld encounter script.

# PROPERTIES:
# You can choose how many encounters you have to catch to obtain the increased
# Shiny-Chance in parameter
#     CHAINLENGTH
# and the increased Shiny-Chance in parameter
#     SHINYPROBABILITY
# in the settings below.

# REMARK:
# If you want that killing instead of chaining has the effect on spawning shinies then replace "result == 4"
# at the bottom of the shiny chining script by "result==1".
# And If you want that killing and chaining also that effect then replace "result == 4" by "(result==1 || result == 4)".

#===============================================================================
# Settings
#===============================================================================
CHAINLENGTH      = 10 # default 10
#       number describes how many pokemon of the same species
#       you have to catch in a row to increase shiny propability

SHINYPROBABILITY = 80 # default 100 --> 10%
#       increasing this value decreases the probability of spawning a shiny

pokemon = 0
#===============================================================================
# adding a new instance variable to $PokemonTemp in script PField_Metadata to
# remember which pokemon and how many of that kind were caught in a row
#===============================================================================
class PokemonTemp
  attr_accessor :catchcombo # [chain length, species]
end

#===============================================================================
# adding a new event handler on pokemon create to make pokemon shiny on spawning
# and in instant battles if the chain is long enough
#===============================================================================
Events.onWildPokemonCreate+=proc {|sender,e|
   
  if !$PokemonGlobal.battlingSpawnedPokemon
    pokemon=e[0]
       
    next if pokemon.nil?
    $PokemonTemp.catchcombo=[0,0] if !$PokemonTemp.catchcombo
    if ($PokemonTemp.catchcombo[0]>=CHAINLENGTH && $PokemonTemp.catchcombo[1]==pokemon.species)
      if rand(SHINYPROBABILITY)<$PokemonTemp.catchcombo[0]
        pokemon.makeShiny
      end  
    end
 

    if pokemon.species != $PokemonTemp.catchcombo[1]
      if $PokemonTemp.catchcombo[0] < 10
        if rand(10) == 0
          next if $PokemonTemp.catchcombo[1] == 0
          pokemon.species = $PokemonTemp.catchcombo[1]
            if rand((SHINYPROBABILITY * 2))<$PokemonTemp.catchcombo[0]
              pokemon.makeShiny
            end  
          end
        end
     
         if $PokemonTemp.catchcombo[0] == 10
          if rand(5) == 0
            next if $PokemonTemp.catchcombo[1] == 0
            pokemon.species = $PokemonTemp.catchcombo[1]
            if rand((SHINYPROBABILITY * 2))<$PokemonTemp.catchcombo[0]
            pokemon.makeShiny
          end  
        end
        end
     
        if $PokemonTemp.catchcombo[0] > 10
          if rand(2) == 0
            next if $PokemonTemp.catchcombo[1] == 0
            pokemon.species = $PokemonTemp.catchcombo[1]
            if rand((SHINYPROBABILITY * 2))<$PokemonTemp.catchcombo[0]
            pokemon.makeShiny
          end  
          end
        end
      end
  end
}

#===============================================================================
# adding a new event handler on Battle end to update the catchchain (where the
# pokemon-catch-chain is saved)
#===============================================================================
Events.onWildBattleEnd+=proc {|sender,e|
   species=e[0]
   result=e[2]
   $PokemonTemp.catchcombo = [0,0] if !$PokemonTemp.catchcombo
   #if $PokemonTemp.catchcombo[1]!=species
     #$PokemonTemp.catchcombo=[0,species]
   #end
   if (result == 1 || result == 4) #&& species==$PokemonTemp.catchcombo[1]
     if $PokemonTemp.catchcombo[1]!=species
     $PokemonTemp.catchcombo=[0,species]
     end
     $PokemonTemp.catchcombo[0]+=1

     #$game_variables[145] = $PokemonTemp.catchcombo[0]#####################
     #$game_variables[144] = $PokemonTemp.catchcombo[1]#####################
     if result == 4 && $PokemonTemp.catchcombo[1]==species
        $PokemonTemp.catchcombo=[0,species]
     end
   end
}

This is for V18.1
my changes:
1. no longer will fights that you run from reset the counter
2. after you start a chain there is a 1 in 10 chance of the pokemon being forced to spawn
3. after you hit chain 10 theres a 50/50 chance to force spawn the chained pkmn
4. the chain resets after you catch any pkmn (including the chained pkmn) or battle the wrong pkmn (a nonchained pkmn) but you can run from any pkmn!
 
Back
Top