Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: bx83 on Fri 02/07/2021 11:42:39

Title: I've .SetView for an object; how do I change Loop/direction later?
Post by: bx83 on Fri 02/07/2021 11:42:39
Character has Loop as non-readonly, and also has FaceDirection(eDirectionXXX) - how do I do this with an Object?
Title: Re: I've .SetView for an object; how do I change Loop/direction later?
Post by: Khris on Fri 02/07/2021 12:17:16
When you animate an object, you have to state the loop and (animation) direction?

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

What are you asking exactly?
Title: Re: I've .SetView for an object; how do I change Loop/direction later?
Post by: bx83 on Fri 02/07/2021 12:22:59
I have a multi-purpose object; it has X loops, each one representing an animation of a weapons pick-up.
When the character has 'walked over' this object, it defaults loop=0, the default animation (say an opened crates with nothing in it).
Do I just re-assert a new Loop with SetView()?

Also, can you use an object instead of a character you control? Eg. you hit arrow keys to control it's direction, acceleration etc. but it's still an object.
Title: Re: I've .SetView for an object; how do I change Loop/direction later?
Post by: Khris on Fri 02/07/2021 12:46:02
Again, I'm not sure what you're asking here. When you start the animation, you have to state the loop.
If you're using  oCrate.Animate(oCrate.Loop, ...);  then you have to use .SetView to set the loop, yes.

As for controlling an object with the arrow keys: it's possible but not natively supported by AGS. If the view assigned to the object has four walking loops, then the arrow key handling code has to make sure the object is animated using the proper loop.