Problem creating static background animation

Started by LaymeDuck, Thu 29/04/2004 00:41:04

Previous topic - Next topic

LaymeDuck

Hi,

I've been working with AGS for a few weeks and have created a small test area of three rooms that interconnect. I'd like to have some animations going on in the background (and foreground) in one of my rooms. For one room I just used the animated backgrounds option to solve my problem; however, I'm having trouble finding how to create an object on a loop. I've looked through the manual and can't believe I haven't found the solution to what must be a fairly novice question.

If anyone could either walk me through this procedure or point me to where I should be looking in the manual, I'd be very grateful. :)

Scummbuddy

From the manual:
-----------------------
AnimateObject
AnimateObject (int object, int loop, int delay, int repeat)

Starts the object number 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 REPEAT parameter sets whether the animation will continuously repeat the cycling through the frames. If REPEAT is zero, 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 REPEAT is 1, when the last frame is reached, it will go back to the first frame and start over again with the animation. If REPEAT is 2, 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).

Example:

AnimateObject(0,2,0,0);

will animate object 0 using loop 2 of its current view once.
See Also: AnimateCharacter, AnimateObjectEx, IsObjectAnimating, SetObjectView
-------------------------

Just use the repeat parameter,and set it high.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Ashen

Or use (in 'Repeatedly Execute')

if (IsObjectAnimating (2) == 0) {
 AnimateObject(2,5,0,0);
}

LaymeDuck

Hi,

Thanks for responding.

I read that part of the manual but couldn't figure out how it applied. The "object" I have is a single image, but I have a "view" that I want to use with 7 frames of animation. The GUI only allows me the ability to put down one of those static frames for the object. How can I put down the "view?"

Is this something where I need to go into the room's script editor?

Ashen

SetObjectView (int object, int view);

in the one of the 'Player Enters Screen' interactions.

LaymeDuck

Got it! Thanks so much - you guys rule.  ;D

SMF spam blocked by CleanTalk