Page 1 of 1

How to wait for an inventory selection

Posted: Sun Apr 21, 2024 11:25 pm
by Syoka
Hello
I want to make a dialogue that:
NPC gives some hints for an item, and pop up the inventory window for player to select item.
then NPC responses according to player showing the right item or not

How to achieve: the dialogue pause when the inventory window pop up, and continue dialogue when player selected an item?
Assume that I made custom Lua function "PopInventoryWindow" to pop up the inventory window

Re: How to wait for an inventory selection

Posted: Mon Apr 22, 2024 9:19 am
by Tony Li
Hi,

I recommend using a sequencer command instead of a Lua function for this. Since the conversation waits for the dialogue entry's sequence to end, the sequencer command can wait until the player has selected an item.

Here's an explanation: post 1, post 2. It refers to Inventory Engine, but you can use the same concept with any inventory system/script.

Re: How to wait for an inventory selection

Posted: Mon Apr 22, 2024 1:23 pm
by Syoka
Thank you! it works by sending Message to inventory, SetVariable by script, and then send back message to dialogue database.

Re: How to wait for an inventory selection

Posted: Mon Apr 22, 2024 4:40 pm
by Tony Li
Glad to help!