Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: rollo on March 26, 2013, 12:23:57 PM

Title: Changescene animation
Post by: rollo on March 26, 2013, 12:23:57 PM
Hi. I have created a scene where the player drops a bomb and is set to explode after so long. My question is 2 part. Are there any examples of timer functions and if so where and secondly, I have created a scene in 3dsmax of an exploding barrel. How do I incorporate this into a new scene. In which I mean in what format. From what I can see there are 2 options. Avi or image sequence. Are they the only options. Thanks
Title: Re: Changescene animation
Post by: keybone on March 27, 2013, 03:30:05 PM
hi,
for ani use png sequence is best if the animation is only for barrel..

i think for the timer u can use "sleep" on entity,

cya :)
Title: Re: Changescene animation
Post by: rollo on March 27, 2013, 04:47:12 PM
cheers keybone. will check it out.
Title: Re: Changescene animation
Post by: anarchist on March 27, 2013, 06:27:49 PM
The WME book covers this quite well: http://res.dead-code.org/doku.php/wmebook:ch3 (http://res.dead-code.org/doku.php/wmebook:ch3)
Search for the line "Let’s move on to the last part of this chapter, which will cover the daemon issue." and start reading from there. Interestingly, the example that metamorphium used is a bomb :)

In a few words, in WME you can attach/detach any script you want at any time. Attaching a script will execute any code inside (be it event handlers, functions/procedures or just simple code). In the code inside you will have a loop that will exit when the time comes for the bomb to explode. Right after the loop (which must contain the Sleep() command so your game is not frozen) you will place the code that explodes the bomb (or executes any timed event you wish).
Title: Re: Changescene animation
Post by: rollo on March 28, 2013, 07:08:19 PM
anarchist. Thanks for reply. So there is no command for a timer so just use a for loop? Will check out that link. Thx