How to add item as reward to inventory?

Announcements, support questions, and discussion for Quest Machine.
Post Reply
dkrusenstrahle
Posts: 39
Joined: Sat Apr 20, 2024 7:03 pm

How to add item as reward to inventory?

Post by dkrusenstrahle »

Hello,

I am looking into actions on successful state. I have integrated to MoreMountains Inventory Engine (via Topdown engine).
I see there is a way to insert an item into the inventory. How is it suppose to work? I added the name of the inventory then it asks me to add the name of the item. What name is it referring to and how is it suppose to find it?
Attachments
Screenshot 2024-04-26 at 21.27.37.png
Screenshot 2024-04-26 at 21.27.37.png (102.05 KiB) Viewed 1461 times
User avatar
Tony Li
Posts: 22085
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to add item as reward to inventory?

Post by Tony Li »

Hi,

You'll generally add an Add Inventory Engine Item quest action to a quest's Successful state > Actions list or to the Success node's or Return To NPC node's > True > Actions list. See the Inventory Engine integration's Get Apples quest -> Return node -> True state > Actions list. It adds a blue shirt and removes 3 apples.

Inventory Engine identifies inventories by GameObject name. In the example, the inventory is named "RogueMainInventory".

The Add Inventory Engine Item quest action identifies items by their Item ID, which you can see if you inspect the item ScriptableObject asset in Resources/Items. You can have as many Resources folders as you want, but item assets must be in a subfolder named "Items" inside a Resources folder.
dkrusenstrahle
Posts: 39
Joined: Sat Apr 20, 2024 7:03 pm

Re: How to add item as reward to inventory?

Post by dkrusenstrahle »

Worked like a charm, thank you!
User avatar
Tony Li
Posts: 22085
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to add item as reward to inventory?

Post by Tony Li »

Glad to help!
Post Reply