Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Candle on Thu 04/11/2004 23:41:36

Title: Assign View
Post by: Candle on Thu 04/11/2004 23:41:36
How do you Assign view with code ? I knew how to do it but forgot now .
Trying to AnimateObject but keeps giving errors about Assigning a view .
Title: Re: Assign View
Post by: Candle on Fri 05/11/2004 00:15:05
Ok I found the setobjectview but now I get this error
---------------------------

(Room 3 script line 7)
Error: AnimateObject: invalid loop number specified

---------------------------
OK   
---------------------------
I have four frames in the loop ? the view is 7 .

Using this code ,
SetObjectView(0,7);
AnimateObject(0,2,0,0);
Title: Re: Assign View
Post by: TheJBurger on Fri 05/11/2004 01:07:45
I think your problem is that in AnimateObject, you're running the object animation on loop 2. On view 7 if the animation is on loop 0, AnimateObject should be:

AnimateObject(0, 0, 0, 0);

Your current script code says that object 0 is animating on view 7, loop 2, this should be corrected to view 7 loop 0.
Title: Re: Assign View
Post by: Candle on Fri 05/11/2004 01:14:04
Thank you . I was just going to post that I found what was wrong .. and it was the loop number ..
Been awhile  using AGS and in between I have had a mild stroke
so I'm having some memory problems .
Title: Re: Assign View
Post by: Goot on Fri 05/11/2004 02:03:00
Actually you want AnimateObject (0,0,x,0); x being the time each frame is shown.