Hi Xray! I was wondering, but is there a way to make a "wait" command with scripts? By that I mean that a script runs as normal, but when it reaches the "wait" it pauses for a period of time before continuing.
JP - Yes, you can write a delay that will hold off a single command or procedure for N number of seconds. I do it all the time in many of my own scenes.
I see that you have a lot of questions concerning Thyme Scripting, so I suggest that you check out the heading "Thyme Scripting" in the Algodoo Forum. There's a lot of good information there but you will have to put in the time and effort that's required to do the research.
Awesome! I usualy use timeToLive as my "wait" command, like this:
(e)=>{
timeToLive=<1?{
timeToLive=1.25;
[script here]}:{}
Although I don't know how to make it a bit shorter, something like "e.this.wait (value)" or something.
There are many different ways to make a time delay, and using timeToLive is probably the simplest.
I'm not sure what you mean by "a bit shorter". If you mean less than one second, that's easy to do. For example:
Set timeToLive = 1.0
Then where you need the delay do this:
timeToLive <= 0.25 ? {timeToLive = +inf; Do whatever you need here after delay period}:{}
NOTES: 1. You need to stop the timeToLive by setting it to infinity before it reaches zero if you don't want the geometry to die.
2. Never test for an exact time. Always use <= or >=. If you do only =, Algodoo might skip over the exact value you are waiting for and the timer will continue to run down until it times out. By using <= it ensures that the timer will stop when you need it to.
There are other ways to make timers which you can find by digging through my scenes or others that use a lot of Thyme Scripting.