• 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: [Essentials v17] Following Pokemon v 1.4.1

JustKenneth

Developer Pokemon The Kingdom of Meralas
8
Posts
14
Years
  • Hey all,

    first, thanks for the script! Very helpful.
    I ran into an issue while playtesting, when I lose a battle the follower doesn't reappear, it's still there but invisible.
    When I interact with it an error shows up.

    edit:
    Also while pressing 'CTRL' the player is able to walk through walls.

    ---------------------------
    Zircon and Citrine
    ---------------------------
    Exception: NoMethodError

    Message: undefined method `-' for nil:NilClass

    Follow pokemon:743:in `talk_to_pokemon'

    Follow pokemon:1559:in `update'

    Scene_Map:68:in `main'

    Scene_Map:65:in `loop'

    Scene_Map:72:in `main'

    Main:49:in `mainFunctionDebug'

    Main:27:in `mainFunction'

    Main:27:in `pbCriticalCode'

    Main:27:in `mainFunction'

    Main:59






    Any ideas?
     
    Last edited:
    3
    Posts
    7
    Years
    • Seen Oct 4, 2017
    It Will not show a unfainted Pokemon
    You may need to add pbPokemonFollow to any event with a start over switch attached. I find blacking out may turn the pbPokemonFollow script off.
    Use "D" to cycle through Pokemon or set a unfainted Pokemon to you first party slot.
    see Line 25
    "ALLOWFIELDSWITCHING = true # Allow the player to cycle through pokemon"
    "Ctrl" in playtest will toggle "no collision" if held. it will toggle your following Pokemon if pressed

    I am having a problem with the
    Line 915
    #===============================================================================
    # * Auto add Script to Kernel.pbCanUseHiddenMove, fix HM bug
    # * Fixed so non-pokemon follower dependent events will return false
    #=============================================================================== section of the follower script
    If the follower script is NOT activated any Partner Dependency will cause the player not able to surf..etc as normal.
    But if the follower script IS activated the player can surf and the any Partner Dependency will walk on water. I have tested this in Playtest as well as game mode on a fresh V16 to find the same issues.
     
    Last edited:
    3
    Posts
    7
    Years
    • Seen Oct 4, 2017
    Update
    If in playtest while follower script installed, if no Pokemon are in the players party when surf is called
    it gives the error

    ---------------------------
    Pokemon Essentials
    ---------------------------
    Exception: NoMethodError

    Message: undefined method `hp' for nil:NilClass

    Follower:419:in `check_surf'

    Follower:880:in `pbSurf'

    PField_HiddenMoves:560

    PField_HiddenMoves:555:in `call'

    Event:54:in `trigger'

    Event:49:in `each'

    Event:49:in `trigger'

    Scene_Map:175:in `follow_update'

    Follower:1552:in `update'

    Scene_Map:68:in `main'
     

    Venomous_Zero86

    Pokemon Chosen Ones (Coming Soon)
    120
    Posts
    8
    Years
    • Seen Feb 11, 2022
    can i get what were suppose to put in a text or script file i dont know how to add the script code in the event
     

    FallenStorm

    Pokemon Hyperion Developer
    17
    Posts
    7
    Years
  • How can I make it where even if my Pokemon is fainted, it's still following me? (or make the next non-fainted Pokemon follow me)
     
    1,682
    Posts
    8
    Years
    • Seen today
    How can I make it where even if my Pokemon is fainted, it's still following me? (or make the next non-fainted Pokemon follow me)

    You could change all instances of $Trainer.party to $Trainer.ablePokemonParty, which is the party, minus eggs and fainted pokemon.
     
    3
    Posts
    7
    Years
    • Seen Oct 4, 2017
    can i get what were suppose to put in a text or script file i dont know how to add the script code in the event

    This info is the VERY FIRST post of this forum
    Make blank event (x) " (x) is the number of any script on said page"
    add"pbPokemonFollow(x)" to a trigger script ..ie starter choice, blackout,poke center,mom, prof, trainer, cut-table tree, player touch, event touch ,auto run ..etc
    you could just use pbPokemonFollow(1) given you have some sort of event on the page ..say a door
     
    Last edited:

    Venomous_Zero86

    Pokemon Chosen Ones (Coming Soon)
    120
    Posts
    8
    Years
    • Seen Feb 11, 2022
    This info is the VERY FIRST post of this forum
    Make blank event (x) " (x) is the number of any script on said page"
    add"pbPokemonFollow(x)" to a trigger script ..ie starter choice, blackout,poke center,mom, prof, trainer, cut-table tree, player touch, event touch ,auto run ..etc
    you could just use pbPokemonFollow(1) given you have some sort of event on the page ..say a door

    ---------------------------
    Pokemon Chosen Ones
    ---------------------------
    Exception: NoMethodError

    Message: undefined method `length' for nil:NilClass

    Following Pokemon:1779:in `update'

    Scene_Map:51:in `updateSpritesets'

    Scene_Map:45:in `each'

    Scene_Map:45:in `updateSpritesets'

    Scene_Map:96:in `miniupdate'

    Messages:145:in `pbUpdateSceneMap'

    Messages:1519:in `pbMessageDisplay'

    Messages:1005:in `pbMessage'

    Messages:649:in `command_101'

    Interpreter:304:in `execute_command'



    This exception was logged in

    C:\Users\Mike\Saved Games/Pokemon Chosen Ones/errorlog.txt.

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

    this keeps comming up
     
    150
    Posts
    8
    Years
    • Seen Jul 13, 2023
    Movement Frame Limitation on Follow Script

    I have been using the follow script very successfully and all that, but I've noticed it as a major flaw at the moment: the following character will only ever use movement frames 1 and 2.

    This is because the script forces them to move one space each time the player does, but does not account for when the player is walking continuously, which means that every other step uses movement frames 3 and 4.

    This causes the follower sprite's movement to look very janky and out of place, since they're basically only doing 1/2 of a normal walking gait (left foot forward, left foot forward, left foot forward, etc.).

    I've been scratching my head trying to think of a way to alter the script to stop this from happening, but I just don't know enough about both Ruby, and what the limitations of RPG Maker XP are concerning what base functions are avaliable for use. The script uses "move_down", "move_up", "move_left", and "move_right", but I can't think of any way to have it detect when the player is moving continuously, and the only way to force the follower to use frames 3 and 4 would be to have the script be able to tell that the player is holding down the movement key...

    To show an example of what I mean, I set up a Character sprite that uses the numbers 1, 2, 3, and 4 in place of each movement frame (color coded for easy viewing):

    eyynecu.gif


    As you can see, only frames 1 and 2 are ever used, even when the player is moving continuously (and making use of the PC sprite's 3 and 4 frames).

    Script:
    Spoiler:

    Can anyone think of a way to fix this behavior? I'm stumped. :L
     
    Last edited:
    150
    Posts
    8
    Years
    • Seen Jul 13, 2023
    I have been using the follow script very successfully and all that, but I've noticed it as a major flaw at the moment: the following character will only ever use movement frames 1 and 2.

    This is because the script forces them to move one space each time the player does, but does not account for when the player is walking continuously, which means that every other step uses movement frames 3 and 4.

    This causes the follower sprite's movement to look very janky and out of place, since they're basically only doing 1/2 of a normal walking gait (left foot forward, left foot forward, left foot forward, etc.).

    I've been scratching my head trying to think of a way to alter the script to stop this from happening, but I just don't know enough about both Ruby, and what the limitations of RPG Maker XP are concerning what base functions are avaliable for use. The script uses "move_down", "move_up", "move_left", and "move_right", but I can't think of any way to have it detect when the player is moving continuously, and the only way to force the follower to use frames 3 and 4 would be to have the script be able to tell that the player is holding down the movement key...

    To show an example of what I mean, I set up a Character sprite that uses the numbers 1, 2, 3, and 4 in place of each movement frame (color coded for easy viewing):

    eyynecu.gif


    As you can see, only frames 1 and 2 are ever used, even when the player is moving continuously (and making use of the PC sprite's 3 and 4 frames).

    Script:
    Spoiler:

    Can anyone think of a way to fix this behavior? I'm stumped. :L

    Alright nevermind - I fixed it by doing what was mentioned here:
    https://www.pokecommunity.com/showthread.php?p=9133551#post9133551
     
    13
    Posts
    6
    Years
    • Seen Aug 11, 2017
    As you can see in the image in that specific map my follow pokemon walks in front of me or on the same tile the the player does, it works perfectly on other maps. How can this be solved?
    POKEFOLLOWPROBLEM.png
     

    Venomous_Zero86

    Pokemon Chosen Ones (Coming Soon)
    120
    Posts
    8
    Years
    • Seen Feb 11, 2022
    this error comes up i did it properly even watch a video

    ---------------------------
    Pokemon Chosen Ones
    ---------------------------
    Exception: NoMethodError

    Message: undefined method `length' for nil:NilClass

    Following Pokemon:1779:in `update'

    Scene_Map:51:in `updateSpritesets'

    Scene_Map:45:in `each'

    Scene_Map:45:in `updateSpritesets'

    Scene_Map:115:in `follow_update'

    Following Pokemon:1551:in `update'

    Scene_Map:68:in `main'

    Scene_Map:65:in `loop'

    Scene_Map:72:in `main'

    Main:74:in `mainFunctionDebug'



    This exception was logged in

    C:\Users\Mike\Saved Games/Pokemon Chosen Ones/errorlog.txt.

    Press Ctrl+C to copy this message to the clipboard.
    ---------------------------
    OK
    ---------------------------
     
    23
    Posts
    11
    Years
    • Seen Aug 29, 2019
    Hi, I followed these instructions on a clean install of version 17 and got the following error when trying to run the game
    Script 'Followme' line 1431: Name Error Ocurred

    undefined method `pbSwitch' for class `PokemonScreen'

    This is my first time editing the script in essentials.

    Edit: Apparently someone over on Relic Castle is having the same issue, so it is an issue with v17?
     
    Last edited:
    2
    Posts
    6
    Years
  • I don't know if anyone will reply to this but I have a bug when blacking out from a trainer battle.
    I've tried disabling the Following script in the Starting Over event with pbToggleFollowingPokemon and then re-enabling it with pbPokemonFollow. However the issue still occurs. What happens is that there is an invisible pokemon that I can talk to still next to me and it causes a loop that will end up making my game crash. Is there any fix to this? Thanks!


    This is the same thing that happened.

    Hey all,

    first, thanks for the script! Very helpful.
    I ran into an issue while playtesting, when I lose a battle the follower doesn't reappear, it's still there but invisible.
    When I interact with it an error shows up.

    edit:
    Also while pressing 'CTRL' the player is able to walk through walls.

    ---------------------------
    Zircon and Citrine
    ---------------------------
    Exception: NoMethodError

    Message: undefined method `-' for nil:NilClass

    Follow pokemon:743:in `talk_to_pokemon'

    Follow pokemon:1559:in `update'

    Scene_Map:68:in `main'

    Scene_Map:65:in `loop'

    Scene_Map:72:in `main'

    Main:49:in `mainFunctionDebug'

    Main:27:in `mainFunction'

    Main:27:in `pbCriticalCode'

    Main:27:in `mainFunction'

    Main:59






    Any ideas?
     
    Last edited:

    Ceddy

    Apprentice Fan Game Creator
    1
    Posts
    6
    Years
    • Seen Sep 17, 2018
    Hey dudes,
    First of all...good job with this huge script.
    But my problem is that I follow all the steps just like you did in your pictures but I still get a huge error message when I try to turn it on. I will send the error message as well. Please somebody needs to help me...pls...
    Exception: RuntimeError
    Exception: NoMethodError
    Message: Section184:1274:in `pbFollowEventAcrossMaps'undefined method `bridge' for #<PokemonGlobalMetadata:0xcc2de68>

    ***Full script:

    pbPokemonFollow(4)


    Interpreter:243:in `pbExecuteScript'

    Following Pokemon:1268:in `each'

    Following Pokemon:1268:in `pbFollowEventAcrossMaps'

    PField_DependentEvents:359:in `pbMoveDependentEvents'

    PField_DependentEvents:357:in `each'

    PField_DependentEvents:357:in `pbMoveDependentEvents'

    Following Pokemon:762:in `Come_back'

    Following Pokemon:1222:in `pbPokemonFollow'

    (eval):1:in `pbExecuteScript'

    Interpreter:1606:in `eval'



    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'

    Following Pokemon:1551:in `update'



    This exception was logged in

    C:\Users\Cedric\Saved Games/Pokemon Essentials Gen 6/errorlog.txt.

    Press Ctrl+C to copy this message to the clipboard.
    ---------------------------
    OK
    ---------------------------
     
    Last edited:
    9
    Posts
    8
    Years
    • Seen Sep 8, 2018
    Does anyone happen to know the script to toggle off and on the follower?
    I wanted to make it so that during certain events it is hidden.
     
    178
    Posts
    10
    Years
  • Code:
    ALLOWTOGGLEFOLLOW = true             # Allow the player to toggle followers on/off

    Be sure to read the script. Most questios are already answered in the top section of the script.
     

    Pokemon Knight

    Pokemon Knight
    8
    Posts
    6
    Years
    • Seen Jan 19, 2024
    I kind of did all you said but I gut a Syntax Error when I enter the game and says that the syntax error is in line 1432, can you help me?
     
    2
    Posts
    6
    Years
  • Hey so im getting this error when I try to put my pokemon away or go into a building Help me!


    Script 'RPG__Sprite' line 123: NoMethodError occurred.

    undefined method `>' for nil:NilClass
     
    Back
    Top