• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Scottie, Todd, Serena, Kris - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

Giving Item

  • 264
    Posts
    8
    Years
    • Seen Nov 19, 2023
    I'm trying to give 5 Pokeballs to the hero from a professors aid. I copied the script that gives a poition and replaced the word potion with pokeball. but the game crashes. i get this error


    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 `update'
    Scene_Map:101:in `loop'
    Scene_Map:114:in `update'
    Scene_Map:68:in `main'
    Exception: RuntimeError
    Message: Script error within event 16, map 42 (Forestown):
    Exception: SyntaxError
    Message: (eval):2:in `pbExecuteScript'compile error
    (eval):2: syntax error
    ***Line '(PBItems::POKEBALL,5)' shouldn't begin with '('. Try
    putting the '(' at the end of the previous line instead,
    or using 'extendtext.exe'.
    ***Full script:
    Kernel.pbReceiveItem
    (PBItems::POKEBALL,5)


    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 `update'
    Scene_Map:101:in `loop'
    Scene_Map:114:in `update'
    Scene_Map:68:in `main'
     
    this is my script. it does not contain ' anywhere in the script.
    Kernel.pbReceiveItem
    (PBItems::POKEBALL,5)

    this is my script to give potion.
    Kernel.pbReceiveItem
    (PBItems::POTION)

    that script works for potion but not for pokeballs. i'm confused.
     
    this is my script. it does not contain ' anywhere in the script.
    Kernel.pbReceiveItem
    (PBItems::POKEBALL,5)

    this is my script to give potion.
    Kernel.pbReceiveItem
    (PBItems::POTION)

    that script works for potion but not for pokeballs. i'm confused.

    This isn't anything even close to code related in my eyes. Reading your error clearly says that you shouldn't put
    Code:
    (PBItems::POTION)
    on a new line.

    Besides that, the code is not looking for a ', apostrophe or single quote, but actually what's INSIDE it. That's this: ( - characters or strings (=Raw text) are most of the time referred to within double or single quotes to avoid confusion what precisely it means.

    This is what it should be:
    Code:
    Kernel.pbReceiveItem(PBItems::POTION)
    You could then add another parameter for the amount, making it:
    Code:
    Kernel.pbReceiveItem(PBItems::POTION,5)

    Do NOT break that stuff to a new line.
     
    thanks for the quick response and the explanation of what could be wrong and how code works. but when im writing the script for pokeballs it breaks the line on its own. because its too long to fit on one line i guess? the script for potion works because it remains on one line in essentials but pokeballs breaks to another line every time i write it.

    the error log mentioned extendtext.exe... how do i use it?
    i ran it but nothing happens.

    :EDIT: NVM!!! finally got it to work... i ran it as administrator and it worked!! thanks all for your help!!!
     
    Last edited:
    You have to run extendtext.exe while RPG Maker is running.
    It makes the textbox where you can enter scripts and text longer so it doesn't break to a new line.
     
    Alternatively, if you have to break a line/extendtext won't work for whatever reason(check xpsp3 compatibility and admin permissions in file properties), do it after the parenthesis starts, so something like
    Kernel.pbReceiveItem(
    :POTION)
     
    Back
    Top