• 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!
  • It's time to vote for your favorite Pokémon Battle Revolution protagonist in our new weekly protagonist poll! Click here to cast your vote and let us know which PBR protagonist you like most.
  • 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.

[Question] How to give an NPC an item

I've gone through the Essentials wiki and I am still having an issue with removing an item from the bag, which is a KeyItem. I've got everything else set to where you can still advance in the game, however, Oak's Parcel is still in the KeyItems bag and the information on the wiki isn't helping. When I set a variable for it to be delivered, I can't talk to Prof. If I $bag.remove(:OAKSPARCEL), it says I can't use that here, but still proceeds with the dialogue and allows advancement. Really don't want the player to have to carry an item they delivered lol. Any help appreciated. Thank you.
 
I don't believe this item is anywhere in the Pokémon Essentials PBS so I assume you made it yourself?

Are you putting $bag.remove(:OAKSPARCEL) in "script" inside the event? (make sure it doesn't have a comma)

And the player has 1 Oak's Parcel in their bag before they click on that event?

Check if the item has any special flags/tags and try removing those.
 
Yes, I made it. I did that and I was still having issues. Could have been a misspelled word that I overlooked, so I'll check that out when I get a chance this weekend. I had that issue trying to give the player an Elixir because I spelled it as Elixer instead lol. Thank you for the advice.
 
I should note that Oak "receives" the Parcel
I don't believe this item is anywhere in the Pokémon Essentials PBS so I assume you made it yourself?

Are you putting $bag.remove(:OAKSPARCEL) in "script" inside the event? (make sure it doesn't have a comma)

And the player has 1 Oak's Parcel in their bag before they click on that event?

Check if the item has any special flags/tags and try removing those.

I've put it in the script section on the last page, but I also know that there's another page that has scripts under Conditional Branches. I am correct to put it in the scripts on the last page?
 
I should note that Oak "receives" the Parcel


I've put it in the script section on the last page, but I also know that there's another page that has scripts under Conditional Branches. I am correct to put it in the scripts on the last page?
Yes. Removing an item goes on its own script wherever in the event you want it to be removed.

If you were checking if an item was in the players bag you would put that script in a conditional branch.

Here are a couple examples from my game. Both check the players bag for a key item and then remove that key item.
 

Attachments

  • [PokeCommunity.com] How to give an NPC an item
    3ddee78924bfb18129a1c62d4f25bc23.png
    14.4 KB · Views: 2
  • [PokeCommunity.com] How to give an NPC an item
    d91da3d200b38af088f1b7f8f91b2326.png
    13.6 KB · Views: 2
Back
Top