Hi there,
I'm using the Backtracker script on the Extras page for debugging purposes (not actual gameplay), and I was wondering if it could be modified so it detects if the node is going to backtrack to will continue instantly and if that's the case, it also skips that one.
I ask this because I have a lot of entries whose sole purpose is to run sequencer commands and instantly continue, and when I push the Back button after one of those, I can't really 'jump' back over them.
Thanks.
Extras Backtrack script
Extras Backtrack script
Unity 2019.4.9f1
Dialogue System 2.2.15
Dialogue System 2.2.15
Re: Extras Backtrack script
What sequencer command(s) do you use to continue instantly?
We could add a "best effort" version of that, but it won't be able to catch every single possibility. For example, say you have a Lua variable named "duration" and a dialogue entry has this Sequence:
If the "duration" variable is 0, it will continue instantly. But if "duration" is 5, it will wait 5 seconds. We can't know that ahead of time.
We could add a "best effort" version of that, but it won't be able to catch every single possibility. For example, say you have a Lua variable named "duration" and a dialogue entry has this Sequence:
Code: Select all
Continue()@[var=duration]
Re: Extras Backtrack script
I think the vast majority of them are continued with a Continue(); command at the end of the sequence field.
And in the small number of cases that it has a duration, I'd just click the Back button again, no problem.
And in the small number of cases that it has a duration, I'd just click the Back button again, no problem.
Unity 2019.4.9f1
Dialogue System 2.2.15
Dialogue System 2.2.15
Re: Extras Backtrack script
Change line 40 from this:
to this:
Code: Select all
while (!destination.subtitle.speakerInfo.IsNPC && stack.Count > 0)
Code: Select all
while ((!destination.subtitle.speakerInfo.IsNPC || destination.subtitle.sequence == "Continue()") && stack.Count > 0)
Re: Extras Backtrack script
I've just modified the thing a bit:
while ((!destination.subtitle.speakerInfo.IsNPC || destination.subtitle.sequence.Contains("Continue();")) && stack.Count > 0)
Because I'm running more commands along Continue().
And this made me think that maybe I could use an alternative way to identify entries that should always be skipped back, so I've added another conditional so it also skips back if it encounters "//SkipBack" in the Sequence. That way I can cover more scenarios.
Thank you, Tony!
while ((!destination.subtitle.speakerInfo.IsNPC || destination.subtitle.sequence.Contains("Continue();")) && stack.Count > 0)
Because I'm running more commands along Continue().
And this made me think that maybe I could use an alternative way to identify entries that should always be skipped back, so I've added another conditional so it also skips back if it encounters "//SkipBack" in the Sequence. That way I can cover more scenarios.
Thank you, Tony!
Unity 2019.4.9f1
Dialogue System 2.2.15
Dialogue System 2.2.15
Re: Extras Backtrack script
Good ideas! Glad to help.