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!
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.
I'm trying to remove an item from my bag using
"Conditional Branch: Script: $PokemonBag.pbDeleteItem(:POTION)"
And it keeps crashing my game.
If you know the solution to this problem please let me know!
I do but even if I didn't the Wiki says that it should just return to FALSE instead of giving me the error.
And I had no idea that option existed haha so thank you for that.
This is the error I keep getting.
It seems like me defining the item as "POTION" is throwing it off which makes no sense to me?
---------------------------
Pokemon Essentials
---------------------------
Exception: RuntimeError
Message: Script error within event 6, map 2 (Lappet Town):
Exception: NameError
Message: (eval):1:in `pbExecuteScript'uninitialized constant Interpreter:POTION
***Full script:
$PokemonBag.pbDeleteItem(POTION)
Oh! I just retried your suggestions and "$PokemonBag.pbDeleteItem(PBItems::POTION) " works!!
I must have accidently left out the period after "Bag" haha
Thank you very much.
No, your error was that you didn't include the colon before POTION. In the scripts, all internal names of things must be preceded by a colon. A colon denotes a symbol rather than a variable - your error occurred because the variable POTION was not defined yet you were using it.
For this particular method, you could have used either :POTION or PBItems::POTION - it's been coded to work that way. The former saves a little space, but it may be harder to ensure that colon is there.