Use the Dialogue System bridge to query or change UIS Items and Currency from conversations. Dialogue System owns dialogue/quest state; UIS owns Inventory and balances.

This guide targets UIS Version 1 and Dialogue System 2.x. Pixel Crushers maintains the bridge independently. Choose a download matched to both installed products and verify the selected workflows before updating a project. See the provider’s UIS manual for its release-specific instructions.

Install the supported workflow

  1. Back up the project. Install/compile both products and confirm Inventory/Currency work without dialogue.
  2. Download the matched integration from Opsive Downloads. Keep one copy of the Opsive UIS Support files.
  3. For the Lua workflow, import UISLua, UISUtility and UIS Lua Function Info.asset. Support files belong beneath Assets/Pixel Crushers/Common/Third Party Support/Opsive UIS Support and Assets/Pixel Crushers/Dialogue System/Third Party Support/Opsive UIS Support.
  4. Add UIS Lua to the persistent Dialogue Manager through Pixel Crushers > Dialogue System > Third Party > Opsive > UIS Lua.
  5. Leave Unregister On Disable off for a persistent manager. Enable it when disabling this component should unregister its six functions.
  6. Open the Dialogue Editor’s Lua wizard and confirm the UIS condition/script functions appear.

Import Shop and Pixel Crushers-owned save adapters from a provider release matching the installed UIS UI/save API when adding those routes. Compile each selected route before configuring scenes. The Lua functions use the maintained UIS database and stable object names.

Example: trade a potion for Gold

Use a single-player test Inventory where the potion removal is unrestricted. Tag its owner Player, with Inventory and Currency Owner on that GameObject or children. Use exact definition/Currency names.

On a response entry, set Conditions to:

uisGetItemAmount("Health Potion", "") >= 1

In that entry’s Script, remove one potion and award five Gold:

uisRemoveItem("Health Potion", 1, "", "")
uisAddCurrency("Gold", 5, "")

Provide a no-potion response or let the unavailable response stay hidden. Empty owner strings resolve the Player tag. Inspect the actual Inventory and Currency after selection; the change functions return no Lua success value.

When restrictions, concurrent changes or repeat entry can prevent removal, use a project-owned atomic trade callback that confirms payment/removal before granting the reward. Keep UIS as the authoritative balance owner.

Lua functions and targets

Function Supported use
uisGetItemAmount(itemName, inventoryName) Read an Item Definition’s Inventory amount.
uisAddItem(itemName, amount, inventoryName, itemCollectionName) Create/add an integer Item amount through Inventory’s Main collection.
uisRemoveItem(itemName, amount, inventoryName, itemCollectionName) Remove a matching Item; supply an exact collection name for collection-specific removal.
uisGetCurrencyAmount(currencyName, currencyOwnerName) Read a numeric Currency balance.
uisAddCurrency(currencyName, amount, currencyOwnerName) Request a Currency addition.
uisRemoveCurrency(currencyName, amount, currencyOwnerName) Request a Currency removal. Check available funds before spending.

Blank owner names use Player. Named owners use the exact GameObject name, then locate Inventory/Currency Owner on that object or its children. Item and Currency names resolve through Inventory System Manager.

Use whole-number Item quantities; Currency follows its configured precision/conversion rules. Get functions return numbers; mutation functions return no value. Requery when a later conversation step depends on completion. Enable Dialogue System warning logging when diagnosing unresolved names or owners.

For a non-Main addition destination, provide a wrapper that calls the intended ItemCollection.AddItem directly. On removal, a missing collection match falls back to broader Inventory lookup, so validate the exact name and resulting collection. Use uisGetCurrencyAmount(...) >= price in Conditions before a spending script.

Quests and Shops

Dialogue System quests can use the same functions in entry Conditions/Scripts: check an Iron Sword requirement, then award Gold when advancing quest state. Use the separate Quest Machine integration for quests owned by that product.

For Shop sequences, obtain a SequencerCommandOpenShop matched to the installed UIS release. Configure/test Shop Menu directly, then follow that command’s Shop subject and client Inventory conventions. Verify the expected shop and customer from a conversation before using the sequence in production.

Choose one save owner

Owner Setup
UIS Save System Keep UIS Save System Manager/Savers. Register Pixel Crushers To UIS Saver to capture/apply Pixel Crushers saved-game data. Use this single disk-writing route.
Pixel Crushers Save System Use provider-matched UIS Saver and Save System Manager No Disk adapters for the installed UIS release. Compile and test that route before replacing the persistence setup.

Keep the two saver routes separate, use unique saver keys and test new slots before migrating existing saves. Exclude the demo’s Redirect Save Load Button To Test Menu from release content. See Save System.

Verify the conversation

  1. Start with one Health Potion and zero Gold. Confirm the trade response appears, then select it and observe one potion removed/five Gold added in UIS.
  2. Reenter the conversation without a potion; confirm the fallback path. Test misspelled names on a conversation copy and check warning logs and unchanged balances.
  3. For named owners, test the intended GameObject/child components and collection names. Verify a failed or restricted mutation through a follow-up query.
  4. Test a matched Shop command with the intended client Inventory.
  5. Save, change dialogue/quest state and UIS balances, then load. Both should restore together once. Reload the scene and repeat to detect duplicate managers or saver routes.