How can I integrate the Quest Machine with the custom inventory module I developed?

Announcements, support questions, and discussion for Quest Machine.
Post Reply
hhyu
Posts: 11
Joined: Fri Jul 05, 2024 9:31 am

How can I integrate the Quest Machine with the custom inventory module I developed?

Post by hhyu »

For example, for the counter here, I don’t want to use messages for counting anymore. Instead, I want to use the item quantities in the inventory system for counting. How should I do this?
Attachments
微信图片_20241009120436.png
微信图片_20241009120436.png (70.08 KiB) Viewed 78 times
User avatar
Tony Li
Posts: 22034
Joined: Thu Jul 18, 2013 1:27 pm

Re: How can I integrate the Quest Machine with the custom inventory module I developed?

Post by Tony Li »

Hi,

Duplicate the script QuestConditionTemplate.cs, move the duplicate to your own scripts folder, and rename it to something like InventoryQuestCondition.cs.

Then add your inventory code where the comments indicate. Your new quest condition will appear in dropdowns just like the built-in Quest Machine conditions.

To see an example, temporarily import one of the existing inventory system integrations, such as for Inventory Engine, and examine its quest condition script(s). The script won't compile unless you have that inventory asset, but you can look at it as a model and then delete it.
Post Reply