Page 1 of 1

How to add item as reward to inventory?

Posted: Fri Apr 26, 2024 3:30 pm
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?

Re: How to add item as reward to inventory?

Posted: Fri Apr 26, 2024 3:38 pm
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.

Re: How to add item as reward to inventory?

Posted: Fri Apr 26, 2024 3:57 pm
by dkrusenstrahle
Worked like a charm, thank you!

Re: How to add item as reward to inventory?

Posted: Fri Apr 26, 2024 4:12 pm
by Tony Li
Glad to help!