So I see conditional logic is now supported in timelines. My newest task is to implement popup windows for a tutorial and I am looking at possibly using timelines for this task.
I need to create a popup object that will direct the user and then disappear when he fulfills a condition. After the popup disappears, the next popup in the series should appear.
I was wondering if there's a way to achieve this using timeline logic. Something like the following (which doesn't work, of course):
[tr-popup]
0 = > Config.GetValue Rules PlaysLeft #
> Logic.AreEqual < 4 #
EvalIf < "Object.SetLifeTime ^ 1; Object.Create o-popup2"
Comments
I think it should works! Execpt one thing, Evalif can exec only one command for the true condition, and one for the false, not a command list.
If you want to exec more commands, you can store your commands in a new track and call it with Object.AddTrack
If you want the execution immediatly, don't forget to set the property Immediate to true on you timeline.
The result can be something like:
[tr-popup]
0 = > Config.GetValue Rules PlaysLeft #
> Logic.AreEqual < 4 #
EvalIf < "Object.AddTrack create-popup2"
[create-popup2]
0 = > SetLifeTime ^ 1 # Object.Create o-popup2
Immediate = true
It's kind of like a function call.
It would be nice to be able to execute multiple commands in the if blocks for simple things, though.
I've added a few improvements I'd like to do here too: https://bitbucket.org/orx/orx/issue/57/improve-commands-tracks-to-obtain-a
I'll be focusing on higher priority things first, but in time that shall happen.