• 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.

[Error] Error Help! When I lose to a trainer the game crashes.

26
Posts
5
Years
    • Seen Oct 17, 2023
    ---------------------------
    ZUD Gen 8 Game
    ---------------------------
    [Pokémon Essentials version 18.1.dev]

    Exception: RuntimeError

    Message: Script error within event 13 (coords 19,53), map 96 (Route 301):

    Exception: ArgumentError

    Message: Follower_Main:88:in `removeAllButFollower'wrong number of arguments(0 for 1)



    ***Full script:
    pbTrainerBattle(:LASS,"Gaby")


    Backtrace:
    Interpreter:197:in `pbExecuteScript'
    Follower_Main:88:in `pbRemoveDependenciesExceptFollower'
    Follower_Main:773:in `pbStartOver'
    PField_Battles:645
    PField_Battles:626:in `call'
    Event_Handlers:51:in `trigger'
    Event_Handlers:46:in `each'
    Event_Handlers:46:in `trigger'
    PField_Battles:599:in `_ZUD_pbAfterBattle'
    ZUD_01_Settings_Misc:462:in `pbAfterBattle'


    Backtrace:
    Interpreter:246:in `pbExecuteScript'
    Interpreter:658:in `command_111'
    Interpreter:272:in `execute_command'
    Interpreter:155:in `update'
    Interpreter:102:in `loop'
    Interpreter:158:in `update'
    Scene_Map:162:in `follow_update'
    Scene_Map:160:in `loop'
    Scene_Map:169:in `follow_update'
    Follower_Main:1296:in `update'



    This exception was logged in
    C:\Users\USERNAME\Saved Games\ZUD Gen 8 Game\errorlog.txt.
    Press Ctrl+C to copy this message to the clipboard.
    ---------------------------
    OK
    ---------------------------

    I'm using:
    -ZUD Scripts (https://www.pokecommunity.com/showthread.php?t=444917)
    -Pokemon Followers EX ((broken link removed))
    -Gen 8 Essentials ((broken link removed))
    -Mid Battle Dialogue (https://www.pokecommunity.com/showthread.php?t=441756)
    -Name Windows Scripts ((broken link removed))

    I don't understand what's going on, and I really need help, I've been trying to make a fan game for so long and errors are always what stop me when I get an idea going, I don't want this idea to be ruined.

    My progress is up just after getting the Starter Pokemon, there's one required fight first set up to have the player be fine even if they lose. Then the other battles so far are just general battles. I do not have a Pokemon Center defined yet but I have a Home set in the metadata.

    I also attempted to heal at a Pokemon Center then lose and I got this error.

    ---------------------------
    ZUD Gen 8 Game
    ---------------------------
    [Pokémon Essentials version 18.1.dev]

    Exception: ArgumentError

    Message: wrong number of arguments(0 for 1)



    Backtrace:

    Follower_Main:88:in `removeAllButFollower'

    Follower_Main:88:in `pbRemoveDependenciesExceptFollower'

    Follower_Main:749:in `pbStartOver'

    PField_Battles:645

    PField_Battles:626:in `call'

    Event_Handlers:51:in `trigger'

    Event_Handlers:46:in `each'

    Event_Handlers:46:in `trigger'

    PField_Battles:599:in `_ZUD_pbAfterBattle'

    ZUD_01_Settings_Misc:462:in `pbAfterBattle'



    This exception was logged in

    C:\Users\USERNAME\Saved Games\ZUD Gen 8 Game\errorlog.txt.

    Press Ctrl+C to copy this message to the clipboard.
    ---------------------------
    OK
    ---------------------------
    I have a screenshot of "Follower_Main:88" if anyone wants to see it, please if anyone knows how this could be fixed tell me, I really don't want to have to give up on this project.
     

    StCooler

    Mayst thou thy peace discover.
    9,301
    Posts
    4
    Years
    • Seen May 5, 2024
    I'm using:
    -ZUD Scripts (https://www.pokecommunity.com/showthread.php?t=444917)
    -Pokemon Followers EX ((broken link removed))
    -Gen 8 Essentials ((broken link removed))
    -Mid Battle Dialogue (https://www.pokecommunity.com/showthread.php?t=441756)
    -Name Windows Scripts ((broken link removed))

    I don't understand what's going on, and I really need help, I've been trying to make a fan game for so long and errors are always what stop me when I get an idea going, I don't want this idea to be ruined.

    My progress is up just after getting the Starter Pokemon, there's one required fight first set up to have the player be fine even if they lose. Then the other battles so far are just general battles. I do not have a Pokemon Center defined yet but I have a Home set in the metadata.

    I also attempted to heal at a Pokemon Center then lose and I got this error.


    I have a screenshot of "Follower_Main:88" if anyone wants to see it, please if anyone knows how this could be fixed tell me, I really don't want to have to give up on this project.

    There is a bug with the use of the function removeAllButFollower in the Follower script. Its definition states that it's supposed to get one argument, and yet this argument is not taken into account.
    Just find any occurrence of "removeAllButFollower" and add a nil argument, like this:
    Code:
    <Something here>.removeAllButFollower(nil)
     
    26
    Posts
    5
    Years
    • Seen Oct 17, 2023
    Thank you so much that fixed it! Also thank you for creating the ZUD plugin it's been fun to play with and I'm excited to fully incorporate it into my Fan Game
     
    13
    Posts
    6
    Years
    • Seen Jun 6, 2022
    I have the same issue, how exactly do you fix this? I don't know very much about scripting.
     
    1,408
    Posts
    10
    Years
    • Seen today
    I have the same issue, how exactly do you fix this? I don't know very much about scripting.

    StCooler's post explains what to do already, there's not much more that needs to be explained. Use CTRL+F to find every instance of .removeAllButFollower and then add nil at the end as his post demonstrates.
     
    13
    Posts
    6
    Years
    • Seen Jun 6, 2022
    Is this what I'm meant to do?

    #-------------------------------------------------------------------------------
    # Script Command for removing every dependent event except Following Pokemon
    #-------------------------------------------------------------------------------
    def pbRemoveDependenciesExceptFollower
    $PokemonTemp.dependentEvents.removeAllButFollower(nil)
    end
     
    13
    Posts
    6
    Years
    • Seen Jun 6, 2022
    Clearly I messed up something the first time I tried to fix it. After some messing around, I got it to work. At first, I was misunderstanding what the solution meant, thanks for your help!
     
    Back
    Top