Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Squinky on Tue 24/02/2004 18:54:03

Title: Animating Objects...
Post by: Squinky on Tue 24/02/2004 18:54:03
One thing I've never understood is animating objects. According to the description of this function, you need to pick a view like animate character....but, objects don't have views...or do they?

Title: Re:Animating Objects...
Post by: SLaMgRInDeR on Tue 24/02/2004 19:20:08
well, there is nothing that says they are just character views, so i would imagine that you make another view in the normal view screen, but then i'm no veteran, you tell me...
Title: Re:Animating Objects...
Post by: Squinky on Tue 24/02/2004 19:23:30
From the manual:

AnimateObject (int object, int loop, int speed, 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 SPEED, where 0 is the fastest, and increasing numbers mean slower. The delay for each frame is worked out as SPEED + FRAME SPD, so the individual frame speeds are relative to this overall speed.

Theres my prob with it right there, what view? My objects don't have views...am I missing something, cause I've been using characters instead of objects for a while, but I'd like to figure this out...
Title: Re:Animating Objects...
Post by: SSH on Tue 24/02/2004 19:34:09
Maybe you could look at SetObjectView in the manual, too?  ;)

Title: Re:Animating Objects...
Post by: Squinky on Tue 24/02/2004 20:02:51
Bah!1111

Heh....so thats all there is to it huh? Heh, Thanks....

Now onto my next question, that I really should know by now.

Animating Characters:

When I animate, it always just sticks in the middle of the animation, dosen't go back to the state it was before the animations...anybody know what the hell I'm doing?

Title: Re:Animating Objects...
Post by: Mr_Frisby on Tue 24/02/2004 23:25:40
You can use AnimateObjectEx to make it a blocking call and/or get it to return to the start, and end at the end - which ever you want (there's also a repeat variable but you probably know aboot that one) and even play the anim backwards.

an example :

AnimateObjectEx (1, 7, 4, 2, 0, 1)

Object 1 animates from view 7 and speed 4 ,
it will play the animation once forward and then return to the first frame (the 2 does this - 0 will leave it at the end and 1 will repeat) and it will wait for the anim to finish before returning to the script.



Title: Re:Animating Objects...
Post by: RickJ on Wed 25/02/2004 10:51:30
Hey Squinker,

Object:
You need to use SetObjectViiew() or SetObjectFrame() before you use AnimateObject() or AnimateObjectEx().

Character:
Set the last parameter of AnimateCharacter(), repeat, to a value of 1.  From help:

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.