Tony Li wrote: ↑Sat Jan 27, 2024 11:46 pm
Hi,
You've probably already seen these links, but I'm including them here just in case:
In a conversation, you can use the Inventory Engine Lua functions to check if the player has a key and then remove that key. In the screenshot below, the responses "Here is key 1" and "Here is key 2" will only be shown to the player if they have the corresponding key. If the player selects that response, it will remove that key from the player's MainInventory:
keyConversation.png
Opening a separate UI to allow the player to select an item from their inventory is more complicated and somewhat out of the scope of the Dialogue System. However, the Dialogue System provides ways to interface with it using
sequencer commands. In the example below, the conversation activates a UI GameObject named "Key Selection UI". It's up to you to implement Key Selection UI. The conversation assumes that Key Selection UI will do the following:
- Show the keys that the player can select.
- When the player selects a key, set a variable named "SelectedKey" to the name of the selected key (e.g., "Key1"). For example, use the Dialogue System's "Set Variable" Playmaker action.
- When the player selects a key, send the sequencer message "Selected". The conversation waits for this message. For example, use the "Send Sequencer Message" Playmaker action.
keyConversation2.png
(The <Delay Evaluation> node is because
Conversations Evaluate Conditions One Extra Level Ahead.)
Hello, I was able to create a Key Item UI.
However, I ran to some problems.
-the way Inventory Engine works, I have to press "I" to open the inventory and be able to click/select the items
-If KeySelectionUI" is set to FALSE at beginning of RunTime, I can't add my KeyItems to the inventory
- The Inventory Engine discord suggested I duplicate the UI camera and then extend the GUI Manager?
------------------------------
I know that these are more questions for the Inventory Engine Discord, but I was wondering if there was alternative approach? Thank you.