• 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
  • I have implemented some changes, but I get always
    Code:
    undefined method `aggressive' for nil:NilClass?
    What could be wrong with my approach?

    The pokemon you want to check out for aggressiveness is not a pokemon at all. Maybe there is some misspelling or any other mistake. It is not possible to decide what causes your error message without looking at your code.

    Edit: I found errors in my explainations above. Next try is:

    The wild pokemon can be found inside the array
    Code:
    spawned_pkmn = @party2
    in class Battle, and in array
    Code:
    spawned_pkmn = foe_party
    in the methods start and start_core in class WildBattle.
    By default, you can't get access to party2 outside class Battle and thus also not in WildBattle by
    Code:
    spawned_pkmn = battle.party2
    unless you add
    Code:
    attr_accessor :party2
    to class Battle.
     
    Last edited:
    163
    Posts
    7
    Years
    • Seen today
    The pokemon you want to check out for aggressiveness is not a pokemon at all. Maybe there is some misspelling or any other mistake. It is not possible to decide what causes your error message without looking at your code.

    Edit: I found errors in my explainations above. Next try is:

    The wild pokemon can be found inside the array
    Code:
    spawned_pkmn = @party2
    in class Battle, and in array
    Code:
    spawned_pkmn = foe_party
    in the methods start and start_core in class WildBattle.
    By default, you can't get access to party2 outside class Battle and thus also not in WildBattle by
    Code:
    spawned_pkmn = battle.party2
    unless you add
    Code:
    attr_accessor :party2
    to class Battle.

    Thank you so much.
    I'm trying to implement a priority boost to get an aggressive Pokemon to always attack first, I even tried to get it to attack before anything else. While I managed to check the aggressive Pokemon in
    Code:
    pbCalculatePriority
    with the following code:

    Code:
          foeParty = pbParty(1)
          spawned_pkmn = foeParty[0]
          if  $PokemonGlobal.battlingSpawnedPokemon == true
             if spawned_pkmn.aggressive == false && @turnCount == 0
               pri +=1000
            end
          end

    I can't get the wild Pokemon move priority to increase. I still don't know what I'm doing wrong, but I'll keep trying.
     
    308
    Posts
    4
    Years
  • Thank you so much.
    I'm trying to implement a priority boost to get an aggressive Pokemon to always attack first, I even tried to get it to attack before anything else. While I managed to check the aggressive Pokemon in
    Code:
    pbCalculatePriority
    with the following code:

    Code:
          foeParty = pbParty(1)
          spawned_pkmn = foeParty[0]
          if  $PokemonGlobal.battlingSpawnedPokemon == true
             if spawned_pkmn.aggressive == false && @turnCount == 0
               pri +=1000
            end
          end

    I can't get the wild Pokemon move priority to increase. I still don't know what I'm doing wrong, but I'll keep trying.

    Well, I wonder why you use
    Code:
    spawned_pkmn.aggressive == false
    and not
    Code:
    spawned_pkmn.aggressive == true
    But I have to say that I'm not familiar with that code section of Pokemon Essentials and thus not a good help anymore.
     
    163
    Posts
    7
    Years
    • Seen today
    Well, I wonder why you use
    Code:
    spawned_pkmn.aggressive == false
    and not
    Code:
    spawned_pkmn.aggressive == true
    But I have to say that I'm not familiar with that code section of Pokemon Essentials and thus not a good help anymore.

    Sorry, I was using
    Code:
    spawned_pkmn.aggressive == true
    , only for the example I was testing at the time I changed it. But, anyway...

    ##################################### EDIT

    In other matters. for some reason the DEFAULT_DESPAWN_ANIMATION_ID animation appears but under the character and not under the wild Pokemon.

    What could it be due to?
     
    Last edited:
    308
    Posts
    4
    Years
  • In other matters. for some reason the DEFAULT_DESPAWN_ANIMATION_ID animation appears but under the character and not under the wild Pokemon.

    What could it be due to?

    Thank you for reporting the bug. I updated the code for the additional animations add-on. The newest version should work as intended now.
     
    308
    Posts
    4
    Years
  • I don't know if it's me... But I don't see any change in the behavior of the script. :C

    That's odd. It works for me while playtesting and shows the grass-rustle animation on the tile of the wild pokemon.

    Have you deleted your code you implemented before and have you replaced the additional animations add-on by the newest version on github?

    In addition, there are two situations a pokemon despawns and hence the despawn animation shows up: at first after a battle with the overworld pokemon, and second after a pokemon went so many steps that it vanishes by its own.
    In which of these two situations the despawn animation shows up at the player position, and when does it appear on the pokemon?
     
    163
    Posts
    7
    Years
    • Seen today
    That's odd. It works for me while playtesting and shows the grass-rustle animation on the tile of the wild pokemon.

    Have you deleted your code you implemented before and have you replaced the additional animations add-on by the newest version on github?

    In addition, there are two situations a pokemon despawns and hence the despawn animation shows up: at first after a battle with the overworld pokemon, and second after a pokemon went so many steps that it vanishes by its own.
    In which of these two situations the despawn animation shows up at the player position, and when does it appear on the pokemon?

    Sorry, it was my mistake. It was a mistake in the animation settings on RPGXP. It works great, thank you!
     
    308
    Posts
    4
    Years
  • I've tried to uninstall this plugin. It sadly doesn't work too well for me. However, even after I've uninstalled it (deleted the scripts and everything), it's still working. I can't understand it. Can anyone help?
    Recompile your scripts by holding Shift while starting the game (or ctrl for all recompiling data).
     
    67
    Posts
    5
    Years
    • Seen Jan 9, 2024
    Love this resource. Do any of the plugins have settings relating to making it so overworld encounters can only appear/move on grass or other specific tiles only?
     
    308
    Posts
    4
    Years
  • Love this resource. Do any of the plugins have settings relating to making it so overworld encounters can only appear/move on grass or other specific tiles only?

    Concerning appearence: By default, pokemon spawn only on terrain that has registered encounters. If you don't want pokemon to spawn on grass or on water on a certain map, then simply do not register pokemon for grass or water on that map. If you want pokemon on other special tiles that are not default encounterable tiles (such as a mud tile or a desert tile), then you can add these terrain to your project and register encounters to that terrain. To do that, simply follow the instructions in the main post under modifications. The paragraph is called something like "How to add your own new custom overworld encounter types (such as "desert")". You can also look at add-on "Different Spawn And Normal Encounters" if you want normal encounters on some tile (for instance water) and overworld encounters on some other tile (such as grass).

    Concerning movement: By default, spawned pokemon can move like any other character (such as trainers or other npcs) in the game. Thus spawned pokemon can't walk on impassable tiles or switch between water and land. But they can leave grass tiles and move on the street. There is no add-on, as far as I know, that restricts the pokemon movement to, for instance, grass tiles.
     
    Last edited:
    308
    Posts
    4
    Years
  • How do I make Pokemon despawn animations match their terrain?

    Add the Additional Animations Add-On to your project. Inside that add-on, there are three lines containing
    Code:
    $scene.spriteset.addUserAnimation(VisibleEncounterSettings::DEFAULT_DESPAWN_ANIMATION_ID,x,y,true,1)
    If you replace VisibleEncounterSettings::DEFAULT_DESPAWN_ANIMATION_ID by the id of any other animation then that animation will be shown during despawning. Additionally, use an "if ... then ... else ..." clause where you check the terrain of the pokemon to make the animation match with the terrain.

    As an example, the following code can be used to play the animation with id 8 if the encounter type of the current pokemon is an land encounter
    Code:
    if encType.type  == :land
            $scene.spriteset.addUserAnimation(8,x,y,true,1)
          end
     
    7
    Posts
    7
    Years
    • Seen Nov 23, 2023
    I'm not sure where to put it of these 3. I put it here:

    alias original_removeThisEventfromMap removeThisEventfromMap
    def removeThisEventfromMap
    if $game_map.events.has_key?(@id) and $game_map.events[@id]==self
    x = $game_map.events[@id].oldX
    y = $game_map.events[@id].oldY
    # Show default spawn animation
    if encType.type == :land
    $scene.spriteset.addUserAnimation(VisibleEncounterSettings::5,x,y,true,1)
    end

    but it gave me this Syntax Error:

    [Pokémon Essentials version 20.1]
    [v20.1 Hotfixes 1.0.7]

    Error in Plugin: [Additional Animations - Overworld Encounters Add On]
    Exception: SyntaxError
    Message: [Additional Animations - Overworld Encounters Add On] 002_add_on_additional_animations.rb:182: syntax error, unexpected integer literal
    ...ion(VisibleEncounterSettings::5,x,y,true,1)
    ... ^
    [Additional Animations - Overworld Encounters Add On] 002_add_on_additional_animations.rb:182: Can't assign to true
    ...leEncounterSettings::5,x,y,true,1)
    ... ^~~~
    [Additional Animations - Overworld Encounters Add On] 002_add_on_additional_animations.rb:182: syntax error, unexpected ')', expecting '.' or &. or :: or '['
    ...ncounterSettings::5,x,y,true,1)
    ... ^
    [Additional Animations - Overworld Encounters Add On] 002_add_on_additional_animations.rb:202: syntax error, unexpected end-of-input, expecting `end'

    Backtrace:
    008:PluginManager:653:in `eval'
    008:PluginManager:653:in `block (2 levels) in runPlugins'
    008:PluginManager:643:in `each'
    008:PluginManager:643:in `block in runPlugins'
    008:PluginManager:634:in `each'
    008:PluginManager:634:in `runPlugins'
    386:Main:28:in `mainFunctionDebug'
    386:Main:18:in `block in mainFunction'
    014:Errors:80:in `pbCriticalCode'
    386:Main:18:in `mainFunction'
     
    308
    Posts
    4
    Years
  • I'm not sure where to put it of these 3. I put it here:
    but it gave me this Syntax Error:

    I updated the Additional Animations Add-On for you. Now, the Additional Animations Add-On includes to set despawn animations depending on the terrain_tag of the tile where the despawning pokemon stands. To set up the despawn animation, please open the Additional Animations Add-On in an editor and change the values in the parameter ENV_DESPAWN_ANIMATIONS similar to the parameter ENV_SPAWN_ANIMATIONS.

    I haven't tested it, so let me know if there are any syntax errors or bugs.
     
    23
    Posts
    3
    Years
    • Seen May 13, 2024
    This is a awesome resource but i wanted to know how you stop the water overworld encounters what i have to change in te script
     
    308
    Posts
    4
    Years
  • This is a awesome resource but i wanted to know how you stop the water overworld encounters what i have to change in te script
    It is not completely clear for me what you mean with stop, so I give a whole list of advices.
    • If you want to stop water encounters from spawning then simply don't list any water encounters on any map in your encounters pbs-file.
    • If you want to stop water encounters from spawning but also still want ordinary water encounters that instantly trigger a battle then add the add-on "Different Spawn And Normal Encounters - Overworld Encounters Add On" to your project. Moreover change the parameter "LET_NORMAL_ENCOUNTERS_SPAWN = true" to "LET_NORMAL_ENCOUNTERS_SPAWN = false" in the file "003_add_on_different_spawn_and_normal_encounters.rb". Now, you can add all your water encounters to your pbs-file as usual. These pokemon will trigger a normal pokebattle without spawning on the map before. Additionally, you can also add encounters of type :OverworldWater to your pbs-file. These pokemon will spawn on the overworld.
    • If you want to stop overworld water pokemon from walking then add
      Code:
          event.pages[0].move_type = 0 if GameData::EncounterType.try_get($game_temp.encounter_type) and GameData::EncounterType.try_get($game_temp.encounter_type).type == :water
      right below the line
      Code:
          event.pages[0].move_type = VisibleEncounterSettings::DEFAULT_MOVEMENT[2]
      in the file "001_visible overworld wild encounters script.rb" of the Visible Overworld Wild Encounters Script.

      I haven't tested the code above. So feel free to change it for your own if needed.
     
    Last edited:
    23
    Posts
    3
    Years
    • Seen May 13, 2024
    Thanks for the quick reply this helps me a lot. And i will definitely check your other resource out
     
    1
    Posts
    327
    Days
    • Seen Nov 16, 2023
    Hello! I'm sorry for asking about an error for a pretty old version of Essentials, but in Spanish community is the one we work the most with. The matter in here is that there's an overlaping of the wild Pokémon that spawn and the priorities on my tiles, as the wild Pokémon are shown above the tiles with priority above 1. I'd like to know if there's any possible solution to this error or it's just due to the Essentials version. Thanks in advance for even reading this comment and sorry again for asking about old versions.
     
    Back
    Top