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?
character[EGO].loop
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?
Save the loop to a variable and restore it afterwards...
Thanks TK, but I'm new to scripting ...could you go into more detail?
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...)