How can I integrate the Quest Machine with the custom inventory module I developed?
How can I integrate the Quest Machine with the custom inventory module I developed?
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 (70.08 KiB) Viewed 116 times
Re: How can I integrate the Quest Machine with the custom inventory module I developed?
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.
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.