Page 1 of 1

SetTimeout Callbacks

Posted: Mon Nov 30, 2020 7:58 pm
by ar4wy
Hi Tony!

Is there callbacks for...

Code: Select all

SetTimeout(5); Delay({{end}})
This kind of thing? I know I set something like this in the Conversations Editor, under Sequences.

However, I'm looking for callbacks like... "OnTimerStart" and "OnTimerEnd." This way, I can trigger sound files on each occasion, and more.

Thanks!
Remy

Re: SetTimeout Callbacks

Posted: Mon Nov 30, 2020 9:03 pm
by Tony Li
Hi,

The timer starts when the response menu starts, so you can use the OnConversationResponseMenu message for when the timer starts. Use OnConversationTimeout to be notified if/when the timer runs out.

More info: Script Messages

Re: SetTimeout Callbacks

Posted: Mon Nov 30, 2020 10:00 pm
by ar4wy
Hi Tony,

Apologies if this is documented somewhere -- if the Timer runs out, how do I redirect the dialogue branching towards another NPC Dialogue?

For example, a message that says something like, "What's taking you so long?" Do I have to do this manually with Conditions? Or is there something built in for this?

Thanks!

Re: SetTimeout Callbacks

Posted: Mon Nov 30, 2020 10:41 pm
by Tony Li
Hi,

If you set the Dialogue Manager's Display Settings > Input Settings > Response Timeout Action to anything except Custom, it will follow one of the response menu options (first, last, current, or random).

If you set it to Custom, add a script to the Dialogue Manager that has an OnConversationTimeout() method that does something. For example, when writing your conversation you could set the Title (or a custom field) of a dialogue entry to a specific value. In OnConversationTimeout(), find this dialogue entry and go to it. Rough example:

Code: Select all

void OnConversationTimeout()
{
    var conversation = DialogueManager.masterDatabase.GetConversation(DialogueManager.currentConversationState.subtitle.dialogueEntry.conversationID);
    var timeoutEntry = conversation.dialogueEntries.Find(entry => entry.Title == "OnTimeout");
    DialogueManager.conversationController.GotoState(DialogueManager.conversationMode.GetState(timeoutEntry));
}

Re: SetTimeout Callbacks

Posted: Tue Dec 01, 2020 1:17 am
by ar4wy
Thanks for this, Tony.

I've set Response Timeout Action to "Choose Current Response," but it keeps choosing the First Response anyways. I looked into the ConversationController Script, and it seems this occurs when selected response null?

I'm not using mouse, just WASD and Gamepad for my Dialogue system -- is there a reason why my "highlighted/selected" response is not registering?

Re: SetTimeout Callbacks

Posted: Tue Dec 01, 2020 11:23 am
by Tony Li
Hi,

Please import this fix for "Choose Current Response":

DS_TimeoutCurrentResponsePatch_2020-12-01.unitypackage

It isn't in the just-released version 2.2.14, so if you import 2.2.14 you'll want to import this patch on top of it. This fix will be in 2.2.15.

Re: SetTimeout Callbacks

Posted: Tue Dec 01, 2020 5:05 pm
by ar4wy
Thanks so much!

Re: SetTimeout Callbacks

Posted: Tue Dec 01, 2020 5:13 pm
by Tony Li
Happy to help!