This page describes how to set up the Dialogue System with More Mountains' Inventory Engine. (Inventory Engine is required.)
Inventory Engine copyright © More Mountains.
Import the package Third Party Support/Inventory Engine Support
. This will unpack files into the folder Third Party Support/Inventory Engine Support
.
This package adds Lua functions to control inventory in conversations and quests.
Use these steps to set up an Inventory Engine scene for the Dialogue System:
In the Inventory Engine example scene, an NPC offers a quest: If you bring him 6 apples, he'll give you blue armor. The conversation uses Inventory Engine Lua Functions.
The quest itself also uses the mmGetQuantity() Lua function in its quest tracker text.
The player's inventory (RogueMainInventory) also has a Dialogue System Inventory Event Listener component that updates the quest tracker HUD whenever the player's inventory changes.
The example scene uses the default generic dialogue UI and quest tracker HUD, which you can swap out with more visually-appropriate UIs in your own scenes.
You can use these functions in any Lua fields, such as dialogue entries' Conditions and Script fields and Lua Trigger.
Lua Function | Description |
---|---|
mmAddItem(inventoryName, itemName, quantity) | Adds a quantity of an item to an inventory. |
mmRemoveItem(inventoryName, itemName, quantity) | Removes a quantity of an item from an inventory. |
mmGetQuantity(inventoryName, itemName) | Returns the current quantity of an item in an inventory. |
mmUseItem(inventoryName, itemName) | Uses an item in an inventory. |
mmDropItem(inventoryName, itemName) | Drops an item from an inventory. |
mmEquipItem(inventoryName, itemName) | Equips an item in an inventory. |
mmUnEquipItem(inventoryName, itemName) | Unequips an item. Note the capitalization of this function! |
mmEmptyInventory(inventoryName) | Empties an inventory. |
Notes:
Example: