Page 1 of 1

Required+Delayed sequencer command is fired immediately on conversation end

Posted: Mon Jul 15, 2019 9:14 am
by Fenda
I have a conversation set up that and its last node has a Sequence defined as follows:
required MyCustomCommand(foo, bar)@4;

If the player clicks the Continue button on the last node then the command is fired immediately. Is it possible to respect that 4 second delay?

Re: Required+Delayed sequencer command is fired immediately on conversation end

Posted: Mon Jul 15, 2019 10:13 am
by Tony Li
Hi,

That's what "required" does. It ensures that a command runs immediately even if the player skips ahead before its scheduled time.

If you want to wait for a full 4 seconds no matter what, you can write a custom sequencer command that schedules the action to happen after 4 seconds. Then the syntax might look something like this:

MyCustomCommand(foo, bar, 4)

Note that the command script itself will be killed as soon as the player clicks continue. So you'll need to offload the work to a script that will stick around

Code: Select all

public SequencerCommandMyCustomCommand : SequencerCommand
{
    void Start()
    {
        MyTaskScheduler.Schedule(GetParameter(0), GetParameter(1), GetParameterAsFloat(2));
    }
}
where MyTaskScheduler.Schedule looks something like:

Code: Select all

public static void MyTaskScheduler(string foo, string bar, float timeToRun) {...}

Re: Required+Delayed sequencer command is fired immediately on conversation end

Posted: Tue Jul 16, 2019 1:48 am
by Fenda
Gotcha! That makes sense. I've actually ended up going the route of calling a Timeline from a sequence command instead and adding a Bark track to that. I'm passing in both nowait and nostop and that seems to do the trick. :D