• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • 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.

[Scripting Question] NPC Follow script problem

Giratina Musics

Road to Polyglot
  • 47
    Posts
    4
    Years
    • Seen Feb 24, 2024
    hello PokéCommunity,
    I'm here with a question again.
    I want a npc the follow me and not be able to fight (so I didn't put the pbaddpartner script) but I watched a tutorial from thundaga episode 43 but if I use that my npc just dissapears (my npc is a COOLTRAINER_F named Clara)
    then I looked it up at the pokemon essentials wiki and it says that instead of: pbAddDependency(@event_id,"Clara",3) I should use: Kernel.pbAddDependency(@event_id,"Clara",3) but now I'm getting this error
    ---------------------------
    Pokemon Essentials
    ---------------------------
    [Pokémon Essentials version 18.1]

    Exception: RuntimeError

    Message: Script error within event 1 (coords 11,3), map 81 (Longen):

    Exception: ArgumentError

    Message: (eval):1:in `pbAddDependency'wrong number of arguments(3 for 1)



    ***Full script:

    Kernel.pbAddDependency(@event_id,"Clara",3)




    Backtrace:

    Interpreter:197:in `pbExecuteScript'

    (eval):1:in `pbExecuteScript'

    Interpreter:1458:in `eval'

    Interpreter:197:in `pbExecuteScript'

    Interpreter:1458:in `command_355'

    Interpreter:359:in `execute_command'

    Interpreter:155:in `update'

    Interpreter:102:in `loop'

    Interpreter:158:in `update'

    Scene_Map:162:in `update'





    Backtrace:

    Interpreter:246:in `pbExecuteScript'

    Interpreter:1458:in `command_355'

    Interpreter:359:in `execute_command'

    Interpreter:155:in `update'

    Interpreter:102:in `loop'

    Interpreter:158:in `update'

    Scene_Map:162:in `update'

    Scene_Map:160:in `loop'

    Scene_Map:169:in `update'

    Scene_Map:229:in `main'



    This exception was logged in

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

    Press Ctrl+C to copy this message to the clipboard.
    ---------------------------
    OK
    ---------------------------
    please help me
     
    I didn't watch Thundaga's videos (I will, I promise) but I'm pretty sure he uses v17.2 in his tutorials.
    Your post is just a proof that this specific video is outdated, because the function now (in v18.1) takes only one argument:
    Code:
    def pbAddDependency(event)
    I didn't test it, but I think that, everytime Thundaga calls pbAddDependency(), you should call this function instead:
    Code:
    def pbAddDependency2(eventID, eventName, commonEvent)
    (with the same three arguments that you would use in the old pbAddDependency)

    Try it and tell us if that works :)
     
    Check all naming in PBS of trainers.txt & trainertypes.txt if there something or send me your problem screen in my discord
    My discord name -Maroof_v#3621
    Discord Server:- Click Here
     
    he uses pbdependecy2 and I changed it to Kernal.pbAddDependacy(@event_id,"Clara",3) it doesn't give me the error anymore but I can't see her following me.
    this command is in the same event as where the graphic of the npc is.
     
    I don't want that she battles with me so I didn't add her as a trainer.
    and thundage uses pbAddDependecy2()
     
    I don't want that she battles with me so I didn't add her as a trainer.
    and thundage uses pbAddDependecy2()
    Only give:
    pbAddDependency2(eventID, eventName, commonEvent)
    pbAddDependency2(eventID, eventName, commonEvent)
    +There is a bug in Pokemon essentials v18.1 which makes the dependent events to disappear. It has been fixed in the GitHub version.
     
    he uses pbdependecy2 and I changed it to Kernal.pbAddDependacy(@event_id,"Clara",3) it doesn't give me the error anymore but I can't see her following me.
    this command is in the same event as where the graphic of the npc is.
    Which essentials version you use, if v18.1 don't give kernel, it's usage has been removed in essentiaols v18.1
     
    just do what you were doing at first, don't do the addpartner script and use the normal pbadddependency it will work
    it worked for me, i am not very good at explaining
     
    I did that but I think I'm having that bug. Is there a way to get around that bug cause im scared if I download that githup version I lose all my progress and my sprites and trainers etc.
     
    I did that but I think I'm having that bug. Is there a way to get around that bug cause im scared if I download that githup version I lose all my progress and my sprites and trainers etc.

    I mean... if you just make a backup of your project before trying to do anything to it, why would you be scared about losing your progress at all?

    If you update your game to the GitHub version correctly, then you won't lose any progress at all. There is even a nice tutorial video on how to do so: https://www.youtube.com/watch?v=1QgylS7d3Ms&t=13s

    Or, if you aren't feeling up to it, then you can fix this specific bug by making the same changes as made here (in PField_DependentEvents): https://github.com/Maruno17/pokemon-essentials/commit/bfec896b46ae2e34c467b3e357931edc2750ae5d
     
    Back
    Top