Character Loop/Facing function?

Started by Sockmonkey, Tue 21/10/2003 00:44:30

Previous topic - Next topic

Sockmonkey

I have a question and I was unable to find an answer to it elsewhere...

Is there a command that will return a variable for the loop that the player character is in or the direction they are facing? I am trying to do a few different things, one of which is an idle animation. For example, a character scratching his head  -I would like to run one loop of this animation if the character is facing right, and another for the left. I can't find any functions that will do this, but I'm certain there must be a solution. It could be used for talking loops also...something like this:

if GetCharacterLoop ()==2 {SetCharacterIdle(EGO,12,30);}
if GetCharacterLoop ()==4 {SetCharacterIdle(EGO,13,30);}

Any help?

http://www.sockmonkeygame.com

"Never hold discussions with the monkey when the organ grinder is in the room." -Sir Winston Churchill

Gilbert


Sockmonkey

Perfect. Exactly what I was looking for.

However, after the animation runs the character returns to his (0) loop  - down view - instead of the direction he was facing before...how can i fix this?

http://www.sockmonkeygame.com

"Never hold discussions with the monkey when the organ grinder is in the room." -Sir Winston Churchill

Ishmael

Save the loop to a variable and restore it afterwards...
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Sockmonkey

Thanks TK, but I'm new to scripting ...could you go into more detail?

http://www.sockmonkeygame.com

"Never hold discussions with the monkey when the organ grinder is in the room." -Sir Winston Churchill

Gilbert

On top of script:
int temploop;

Before running the animation, save the loop:
temploop=character[EGO].loop;

After the animation, restore it back:
character[EGO].loop=temploop;

(note that it's not recommended to change the character's loop manually from the manual, but using those FaceLocation() functions for this would be such a mess...)

SMF spam blocked by CleanTalk