Page 1 of 1

newbie question - how to use trigger event after continue

Posted: Wed Oct 02, 2024 2:24 pm
by sensyup
hi. I'm using dialogue system for unity to build a rpg game. There're lots of npc, and some of them are vendors. I want to chat with them and after a specific text , a shop ui will appear. So the point is ,
Question1: how to trigger a event after the conversation?
Question2: how to trigger a event after player clicking continue.
Because there are some vendors with different shop, I hope the event may contains params to distinct each vendor npc.
I tried use script to trigger event but it will trigger right the text start. Alse seqeunce "continue(); SendMessage()" This will automaticlly contine. What I need is "after player click continue", not jump continue.
Thanks a lot !

Re: newbie question - how to use trigger event after continue

Posted: Wed Oct 02, 2024 3:49 pm
by Tony Li
Hi,

These two forum posts explain how to show an inventory window during conversations: post 1, post 2.

The posts discuss a third party asset called Inventory Engine, but the same idea applies even if you're not using Inventory Engine.

My suggestions are:

1. Read those posts.

2. Write a custom sequencer command that opens a vendor's shop UI. Or, if the vendor has a script with a specific method such as OpenShopUI(), then you can use the built-in SendMessage() sequencer command. Example:

Code: Select all

SendMessage(OpenShopUI, , Bob The Vendor)
3. If you want to open the shop UI after the player clicks continue, use a sequencer command like:

Code: Select all

required SendMessage(OpenShopUI, , Bob The Vendor)@Message(Continued)
4. Use WaitForMessage() if you want the current dialogue entry to wait for the player to close the shop UI.

5. See also: How To: Pause Dialogue In Non-Dialogue System Menus. This might be helpful.

Re: newbie question - how to use trigger event after continue

Posted: Wed Oct 02, 2024 8:34 pm
by sensyup
"required SendMessage(OpenShopUI, , Bob The Vendor)@Message(Continued) " This command works for me, thanks again!

Sorry I still have a silly question though...
I read the following document(https://www.pixelcrushers.com/dialogue_ ... rence.html) but found no information about "@Message(Continued)". Did I miss something? I really tried to solve the problem by myself but I failed. I mean , is there any document list all the messages I can use?
Sorry for bothering you. :shock: :shock: :shock:

Re: newbie question - how to use trigger event after continue

Posted: Wed Oct 02, 2024 9:28 pm
by Tony Li
Hi,

Please see this link: Sequencer Command Sequence

This command is actually kind of complex:

Code: Select all

required SendMessage(OpenShopUI, , Bob The Vendor)@Message(Continued)
The "required" part tells the Dialogue System to play the command even if the player skips ahead before it's normally supposed to play. For example, if you have this command:

Code: Select all

Audio(Beep)@3
It will normally wait 3 seconds and then play the audio clip "Beep". But if the player clicks the continue button before 3 seconds have elapsed, this Audio() command won't play. However, if you use this command:

Code: Select all

required Audio(Beep)@3
and if the player clicks continue button 3 seconds have elapsed, the Audio() command will play as soon as the player clicks continue. But if the player doesn't click continue before 3 seconds have elapsed, the Audio() command will play at the 3-second mark as intended.

The "@Message()" part tells the command to wait until it receives a sequencer message instead of waiting for a specific number of seconds.

However, despite the message name "Continued", nothing actually sends that message. It's all a lie. ;-) This means it will normally wait forever, since nothing sends the message "Continued". However, since the "required" keyword is in front, it's guaranteed to play as soon as the player clicks continue.

Re: newbie question - how to use trigger event after continue

Posted: Wed Oct 02, 2024 9:44 pm
by sensyup
Understood! Really really really appreciate!!

Re: newbie question - how to use trigger event after continue

Posted: Wed Oct 02, 2024 9:58 pm
by Tony Li
Happy to help!