Script [Essentials v17] Following Pokemon v 1.4.1 Page 18

Started by mej71 January 4th, 2016 7:53 PM
  • 130214 views
  • 437 replies

The cool Treecko

Wild Treecko appeared!

Male
Earth
Seen 1 Week Ago
Posted January 17th, 2022
147 posts
1.8 Years
it is not working in v18.1
Creator of Pokemon Megamax

Golisopod User

he/him
Alola Reigon
Seen July 6th, 2022
Posted July 4th, 2022
655 posts
5.7 Years
it is not working in v18.1
Does this work for V18 and V18.1?
The version of the script here is for v16.2 which is 4 years old now! I'd recommend not using this version and using

I've rewritten almost all of the original Following Pokemon script by help14 and mej71 to be compatible with v18 and take advantage of all the features of it. I've also fixed many of the bugs the original script, added several new features and improvements, and added built-in compatibility with a few common Essentials scripts, all to improve the script vastly from its predecessor.


You should use this version instead.


https://www.pokecommunity.com/showthread.php?p=10251509

Noticed something funny with following pokemon, when you have a pokemon with a form:

I had a galarian slowpoke and when I pressed "ctrl" to take back my galarian slowpoke and pressing "ctrl" again to put it outside he was a normal slowpoke x)
In the above mentioned link, I have linked a new script which fixes this bug.

EDIT: After nosing around in the script I found my answer.

Hello!

I was wondering if there was a way to have pokemon stop following you in certain areas (E.G when you enter a house the pokemon wont follow you inside but when you exit it will follow you again.)
is there a way to blacklist certain pokemon like legendaries so that they don't appear walking behind you I know most people probably like to have a huge legendary walking behind them but it looks weird to me in my game
The above mentioned script has all of this functionality inbuilt.

If you wanna add more exceptions then you can easily create new conditions. Many examples have been provided in the script. Make sure to check it out!

Golisopod User Challenges you to a Battle on his Discord! (Golisopod User#2006)

I've been working with Pokemon Essentials for about 2 years now. Check out my resources:

Seen 8 Hours Ago
Posted July 23rd, 2022
458 posts
5.5 Years
Am aware of the EX version for v18, and is super promising, but sort of in a midground using v17, as still get some annoying bugs (mostly the positioning and following breaking after any kind of transfer, even to the same map) and cant update to the v18/downgrade that as its got a ton of v18 stuff.

Spoiler:

The game footage is by Henry. You all can see that the follow pokemon happens to again get mis-aligned and don't follow Player as before after transfers.

Please suggest me and anyone who faced this, a better solution!!! Thanks in advance!!!
this mentions the main bugs from it, it fixes on reload but that cant be useful. it seems to like mimic the player one for one but cant be on the same tile so glitches when you move (?)
Seen 8 Hours Ago
Posted July 23rd, 2022
458 posts
5.5 Years
Am aware of the EX version for v18, and is super promising, but sort of in a midground using v17, as still get some annoying bugs (mostly the positioning and following breaking after any kind of transfer, even to the same map) and cant update to the v18/downgrade that as its got a ton of v18 stuff.

this mentions the main bugs from it, it fixes on reload but that cant be useful. it seems to like mimic the player one for one but cant be on the same tile so glitches when you move (?)
Good news for people not updated to the v18 version; i figured out the bug when transferring.

find where it mentions "$NeedFollowerUpdate = " (should be false by default)
remove this, and then in the "def command_end" remove the entire section of:
    if $NeedFollowerUpdate
      events=$PokemonGlobal.dependentEvents
      $PokemonTemp.dependentEvents.updateDependentEvents
      leader=$game_player
      for i in 0...events.length
        event=$PokemonTemp.dependentEvents.realEvents[i]
        $PokemonTemp.dependentEvents.pbFollowEventAcrossMaps(leader,event,false,i==0)
      end
      $NeedFollowerUpdate=true
    end
and boom! also in "command_201" just below remove the "$NeedFollowerUpdate=true"
that should fix it, and fix aswell for regular followers and not just pokemon (because it also broke them)
Seen July 8th, 2022
Posted February 24th, 2021
1 posts
1.7 Years
hola yo tengo este problema
---------------------------
Pokémon Essentials Esp v16.2
---------------------------
Excepción: RuntimeError

Mensaje: Script error within event 15, map 33 (Ciudad Alfa):

Exception: NoMethodError

Message: (eval):1:in `pbExecuteScript'undefined method `pbPokemonFolow' for #<Interpreter:0xd86aaa8>

***Full script:

pbPokemonFolow(14)


Interpreter:243:in `pbExecuteScript'

Interpreter:1606:in `eval'

Interpreter:243:in `pbExecuteScript'

Interpreter:1606:in `command_355'

Interpreter:494:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:103:in `follow_update'

Scene_Map:101:in `loop'



Interpreter:276:in `pbExecuteScript'

Interpreter:1606:in `command_355'

Interpreter:494:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:103:in `follow_update'

Scene_Map:101:in `loop'

Scene_Map:114:in `follow_update'

Acompañante:1554:in `update'



Esta excepción ha sido registrada en

C:\Users\JHOAMIT\Saved Games/Pokémon Essentials Esp v16_2/errorlog.txt.

Presiona Ctrl+C para copiar este mensaje al portapapeles.
---------------------------
Aceptar
---------------------------
Male
Seen 11 Hours Ago
Posted June 29th, 2022
282 posts
2.2 Years
hola yo tengo este problema
---------------------------
Pokémon Essentials Esp v16.2
---------------------------
Excepción: RuntimeError

Mensaje: Script error within event 15, map 33 (Ciudad Alfa):

Exception: NoMethodError

Message: (eval):1:in `pbExecuteScript'undefined method `pbPokemonFolow' for #<Interpreter:0xd86aaa8>

***Full script:

pbPokemonFolow(14)


Interpreter:243:in `pbExecuteScript'

Interpreter:1606:in `eval'

Interpreter:243:in `pbExecuteScript'

Interpreter:1606:in `command_355'

Interpreter:494:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:103:in `follow_update'

Scene_Map:101:in `loop'



Interpreter:276:in `pbExecuteScript'

Interpreter:1606:in `command_355'

Interpreter:494:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:103:in `follow_update'

Scene_Map:101:in `loop'

Scene_Map:114:in `follow_update'

Acompañante:1554:in `update'



Esta excepción ha sido registrada en

C:\Users\JHOAMIT\Saved Games/Pokémon Essentials Esp v16_2/errorlog.txt.

Presiona Ctrl+C para copiar este mensaje al portapapeles.
---------------------------
Aceptar
---------------------------
See you spelling of Folow it's should be Follow
Seen December 15th, 2021
Posted May 17th, 2021
15 posts
2.2 Years
---------------------------
Pokemon Essentials
---------------------------
[Pokémon Essentials version 18.1]

Exception: SystemStackError

Message: stack level too deep



Backtrace:

Acompañante:1200:in `follow_pbGetTerrainTag'

Acompañante:1200:in `follow_pbGetTerrainTag'

Acompañante:1200:in `follow_pbGetTerrainTag'

Acompañante:1200:in `follow_pbGetTerrainTag'

Acompañante:1200:in `follow_pbGetTerrainTag'

Acompañante:1200:in `follow_pbGetTerrainTag'

Acompañante:1200:in `follow_pbGetTerrainTag'

Acompañante:1200:in `follow_pbGetTerrainTag'

Acompañante:1200:in `follow_pbGetTerrainTag'

Acompañante:1200:in `follow_pbGetTerrainTag'



This exception was logged in

C:\Users\USERNAME\Saved Games\Pokemon Essentials\errorlog.txt.

Press Ctrl+C to copy this message to the clipboard.
---------------------------
Aceptar
---------------------------

How do I fix this?
Seen 1 Week Ago
Posted 1 Week Ago
1 posts
14 Days
Hello! ^^ , I'm new to this Script language but I'm trying to understand how to configure basic things, I'm using the Pokémon Follow script
I've been trying to modify this area because I want the accompanying Pokémon to be one more square behind the trainer and I haven't been able to, it would be very helpful to know what I should do to modify it.

¨class DependentEvents

def pbFollowEventAcrossMaps(leader,follower,instant=false,leaderIsTrueLeader=true)
d=leader.direction
areConnected=$MapFactory.areConnected?(leader.map.map_id,follower.map.map_id)
# Get the rear facing tile of leader
facingDirection=[0,0,8,0,6,0,4,0,2][d]
if !leaderIsTrueLeader && areConnected
relativePos=$MapFactory.getThisAndOtherEventRelativePos(leader,follower)
if (relativePos[1]==0 && relativePos[0]==2) # 2 spaces to the right of leader
facingDirection=6
elsif (relativePos[1]==0 && relativePos[0]==-2) # 2 spaces to the left of leader
facingDirection=4
elsif relativePos[1]==-2 && relativePos[0]==0 # 2 spaces above leader
facingDirection=8
elsif relativePos[1]==2 && relativePos[0]==0 # 2 spaces below leader
facingDirection=2
end
end
facings=[facingDirection] # Get facing from behind
facings.push([0,0,4,0,8,0,2,0,6][d]) # Get right facing
facings.push([0,0,6,0,2,0,8,0,4][d]) # Get left facing
if !leaderIsTrueLeader
facings.push([0,0,2,0,4,0,6,0,8][d]) # Get forward facing
end
mapTile=nil
if areConnected
bestRelativePos=-1
oldthrough=follower.through
follower.through=false
for i in 0...facings.length
facing=facings[i]
tile=$MapFactory.getFacingTile(facing,leader)
passable=tile && $MapFactory.isPassable?(tile[0],tile[1],tile[2],follower)
if !passable && $PokemonGlobal.bridge>0
passable = PBTerrain.isBridge?($MapFactory.getTerrainTag(tile[0],tile[1],tile[2]))
elsif passable && !$PokemonGlobal.surfing && $PokemonGlobal.bridge==0
passable=!PBTerrain.isWater?($MapFactory.getTerrainTag(tile[0],tile[1],tile[2]))
end¨