Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Sat 17/07/2004 21:21:07

Title: walking-animation that uses a "special" loop.
Post by: on Sat 17/07/2004 21:21:07
hi there, 
i've got a little problem.

i want a character to walk using a loop, that is NOT the
default walking loop, but instead one of the
"no special thing"-loops.

It looks something like this:

MoveCharacter(CHARID,x,y); // x is somewhere on the left
While (Character[CHARID].walking)
  {SetCharacterView(CHARID,int view);
    AnimateCharacter (CHARID,int loop, int delay, int repeat);}

where loop is f.e. 14 or so...
But it doesnt play Loop 14. It plays Loop 1 (which is left)...

Well, any suggestions ?
I already did a lot of code that i would have to change, if i cant   use this walking-animation in loop 14. I also don't want to use views, because everything i use in my game uses loops, so far...
So a SetCharacter(CHARID, int NEWview)-function wouldn't help me very much.
I should stop whining, i know ...
hope someone can help me...

menazerus

p.s. i believe a lot of people asked something before, but i searched the knowledge-base and forums and found nothing,
so please dont hit me for asking stupid things here  :(
Title: Re: walking-animation that uses a "special" loop.
Post by: Mr Flibble on Sat 17/07/2004 22:33:38
Off the top of my head, I believe there is
SetCharacterWalkingView.

EDIT: I checked the manual, but couldn't find it. How about
character[].walkview?

DOUBLE EDIT: On re-reading your post, I don't think my response is of any importance.

What values have you actually got in the int and CHARID etc. places?
Title: Re: walking-animation that uses a "special" loop.
Post by: on Sun 18/07/2004 12:10:16
My CHARID is GetPlayerCharacter() and the view is a variable.
Changing these values wouldnt solve it. Also the other values are correct.

Hmmm, maybe i can find something like that character[].walkview
but with control on loops.  Maybe there is a little work-around somebody already discovered ???
Title: Re: walking-animation that uses a "special" loop.
Post by: Snarky on Sun 18/07/2004 16:39:15
Instead of using the inbuilt AGS walk command, you could move the character manually by setting its X and Y coordinates. That way the walk animation won't interfere with the animation you set. You won't have the pathfinding, however.

I think part of your problem is that you're refusing to do it in the way intended in AGS. If you want to use a different walk animation, you should make a separate view. "I don't want to use views because everything in my game uses loops" is not a compelling argument.
Title: Re: walking-animation that uses a "special" loop.
Post by: Skio on Sun 18/07/2004 20:21:12
I think the answer is much simpler:

If you want to use this special loop to move towards a CERTAIN direction, create this loop and place it in the equivalent place in the view (i.e 0 for down, 1 for left etc).
When you want to use the loop, script:

  SetCharacterView (The view that contains the special loop);
  MoveCharacterBlocking (EGO, x, y, 0);
  ReleaseCharacterView;

The only problem with this is that you cannot stop the animation until it finishes.
In a game of mine I have a scene where the character moves backwards in terror with the hands covering its mouth. I have used this solution.

If you want, of course, the character to use the loop towards all directions, then you must use a full view that will set with SetCharacterView and ReleaseCharacterView.

If this doesn't help, post the exact scene that you want to achieve and will see at it.

Good luck!
Title: Re: walking-animation that uses a "special" loop.
Post by: on Sun 18/07/2004 22:53:03
Thank you very much everybody.
In the end i decided to use the default loops for the walking animations (what ags intends). at least i didnt waste views (what i intended  ;D )
@ snarky: you are right with AGS's intention. however, it was a little challenge for me to use loops instead of views here,  as i already have lots of functions based on this "system". You know, i'm trying to do some arcade-sequences where lots of characters are involved, which is very graphic-intensive. maybe
now you understand why i try to save space.  If i planned to make just a small 5-6 room game, i would totally agree with you.  ;)