Look Ma! No Timer!

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

Look Ma! No Timer! // Interactive Artwork

1  |  

Post by frootee // Apr 6, 2009, 4:24pm

Total Posts: 2667
Not sure if this will improve shared space animation performance or not but,
I found a way to get scripted animation in shared space without a timer
or paused activity loop. I guess it depends on what happens when several
people show up in the same portal / server.

Basically one object has a single keyframe; it does not have to move.
That object is connected to a watchdog event. The Watchdog watches for changes. In this case, it is connected to an object's WldMatrix (the object with the keyframe). When we press the Animation Play button, at each frame, I suspect the WldMatrix connector of the object is invalidated (even though we have one keyframe). This causes the Watchdog event to 'trigger'.

When the watchdog event triggers, we can connect the Control Out to a jscript command, to do whatever we want: move/rotate objects, amongst other things.

I have a simple scene in the scriptorium: portal 1212 if you want to have a look. Press the animation Play button to see what happens. :)

Change the animation End value on the timeline to extend the animation.

Basically, the script command uses the RsTime.GetCurrentTime() function, which gets us the current time on the Timeline.
But to get more generic, we can use the jscript 'time' type libraries to get the real world time instead.


Post by Jack Edwards // Apr 6, 2009, 4:47pm

Jack Edwards
Total Posts: 4062
Yeah, but Froo, doesn't the Watchdog event use a timer internally? :confused:

Post by frootee // Apr 7, 2009, 1:14am

Total Posts: 2667
I don't know; maybe it does. Perhaps that's a question for the developers.

Post by Wigand // Apr 10, 2009, 2:28am

Total Posts: 462
I remember that I saw a script object without a timer working.

It is in the examples library. It uses something like a infinite loop, or

a feedback. The control out was connected to control in.

I did not check the CPU load but it is an interesting idea.


I looked for and think it is the 'Dummy'-object of Pacman-scene

Post by frootee // Apr 10, 2009, 3:55am

Total Posts: 2667
Thanks Wigand. That may be an Activity Loop, maybe with a Pause node as part of the loop. I tested that in shared space and it does seem to work better than a timer. the Dw: value (download) is about 50% less than when a Timer is used.
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn