Trouble making an object animation sequence

Started by , Sun 20/08/2006 06:50:01

Previous topic - Next topic

Mr. Whitman

I intend to have a character activate a teleporter.  The teleporter system is an object and is supposed to animate before the character walks onto it and is transported into another room.  However, I am unaware of how to get the object to animate.  I've checked the knowledge base and manual and I cannot find the information that I'm looking for.  Please, how can I get an object to animate?

Candle

Animate (object)
(Formerly known as AnimateObject, which is now obsolete)
(Formerly known as AnimateObjectEx, which is now obsolete)

Object.Animate(int loop, int delay, optional RepeatStyle,
               optional BlockingStyle, optional Direction)

Starts the object animating, using loop number LOOP of its current view. The overall speed of the animation is set with DELAY, where 0 is the fastest, and increasing numbers mean slower. The delay for each frame is worked out as DELAY + FRAME SPD, so the individual frame speeds are relative to this overall speed.
The RepeatStyle parameter sets whether the animation will continuously repeat the cycling through the frames. This can be eOnce (or zero), in which case the animation will start from the first frame of LOOP, and go through each frame in turn until the last frame, where it will stop. If RepeatStyle is eRepeat (or 1), then when the last frame is reached, it will go back to the first frame and start over again with the animation. If RepeatStyle is 2 then it will do the animation once, but then return the graphic to the first frame and stop (whereas repeat=0 will leave the graphic on the last frame).

For blocking you can pass either eBlock (in which case the function will wait for the animation to finish before returning), or eNoBlock (in which case the animation will start to play, but your script will continue). The default is eBlock.

direction specifies which way the animation plays. You can either pass eForwards (the default) or eBackwards.

You need to use SetView at some stage before this command, in order to set up the object's current view.

Example:

object[0].Animate(2, 5);
object[1].Animate(1, 3, eOnce, eBlock, eBackwards);

will animate object 0 using loop 2 of its current view, at speed 5, and play the animation once only. This happens in the background. Then, object 1 will animate backwards using loop 1 of its current view, at speed 3. The function won't return until the animation is finished.
See Also: Character.Animate, Object.Animating, Object.SetView, Object.StopAnimating


Mr. Whitman

Thank you, but this information doesn't truly help me.  I need to know if I have to go into the scripting menu to animate the object, and if I do which one?  The global scripting or simply the room scripting.  And either way, what part of the program does it need to be put in.

The knowledge base/manual is a little to unspecific for what I need.  Please give me an example.

Ashen

#3
BFAQ Entry: Placing Code

Basically, as has been said many times in relation to many different things: Where you put your code depends on when you want something to happen.
In your case it seems like you want the object to animate when it's interacted with, so it'd go in the Object's interaction list. Read the Tutorial that comes with the manual (lessons 3 and 4 - unfortunately, there's no on-line version I can link to) for more details on setting up interactions - I think the Tutorial uses a 'picking up a key' interaction, but the basic idea is the same.
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk