Page 1 of 1
How can I integrate the Quest Machine with the custom inventory module I developed?
Posted: Wed Oct 09, 2024 12:05 am
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?
Re: How can I integrate the Quest Machine with the custom inventory module I developed?
Posted: Wed Oct 09, 2024 7:57 am
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.