I've .SetView for an object; how do I change Loop/direction later?

Started by bx83, Fri 02/07/2021 11:42:39

Previous topic - Next topic

bx83

Character has Loop as non-readonly, and also has FaceDirection(eDirectionXXX) - how do I do this with an Object?

Khris

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?

bx83

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.

Khris

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.

SMF spam blocked by CleanTalk