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

Giving Item

265
Posts
7
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'
     
    265
    Posts
    7
    Years
    • Seen Nov 19, 2023
    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.
     
    971
    Posts
    7
    Years
    • Age 21
    • Seen Nov 28, 2022
    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.
     
    265
    Posts
    7
    Years
    • Seen Nov 19, 2023
    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:
    320
    Posts
    14
    Years
    • Seen Dec 27, 2021
    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.
     
    59
    Posts
    8
    Years
    • Seen Aug 9, 2020
    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