Animations on multitasking, based on S. Hawking

Posted By: Ireng

Animations on multitasking, based on S. Hawking - 06/09/07 03:54

Stephen Hawking emailed me the other day with this email:
"Hey, Ireng!
Just emailed to remember you how cool you are.
And to ask you a lil' question.
You see, I'm making a small game in 3dgamestudio. No, seriously. Got bored of white holes and radiaton vortexs. And now my character in-game is animated in a While loop that when one of his skills is set to 1, it will play a different animation. It's like this:

Main action ----> Animate_me() // it makes the char run "stand" anim
When attacking ---- > skill=1 ----> Animate_me() // it makes the char run "attack" anim

The two different animations are played accordingly to the skill "Activity": if 0, it's "stand". If 1, it's "attack".

Code:
 function Animate_Me()
{
while(1)
{
// ANIMATION
MY._biped01_anim_dist+=time*7;
if (my._biped01_anim_dist>100) {MY._biped01_anim_dist=0;}

if(my.actividad==1) // Fire sequence
{
while(my.activity==1)
{
my.attack_speed=1;

if(my.activity==1)&&(my.attack_speed<=60)
{
MY._biped01_anim_dist+=time*3;
ent_animate(me,"attack",MY._biped01_anim_dist,ANM_CYCLE);
my.attack_speed+=time;
}
if(my.attack_speed>60){my.attack_speed=0;}
wait(1);
}
}

else
{
if (my.is_cMoveMode==is_cStopped) {ent_animate(me,"stand",MY._biped01_anim_dist-11*time,ANM_CYCLE);}
else{ent_animate(me,"run",MY._biped01_anim_dist,ANM_CYCLE);
}
}
wait(1);
}
}



But this code doesn't work. At all. I've tripled checked that the code is actually active using breakpoints, and it is, but it's run way too fast and I dunno how to control it. Any ideas?
Yours,
Stephen Hawking"

Guess I should help this laddie.
Posted By: testDummy

Re: Animations on multitasking, based on S. Hawkin - 06/09/07 18:11

Why are you sullying Stephen's good name while simultaneously asking that other users solve your easily solvable 3DGS questions? It's not a truckin riddle. The solution is obvious to many. Yes, I know you are kidding, but still I think you shouldn't lie about Stephen's involvement. Your ploy is 'dirty'.
Posted By: Ireng

Re: Animations on multitasking, based on S. Hawkin - 06/09/07 18:19

Ok, but the problem I face is real. And I can't seem to solve it, really.
Posted By: Xarthor

Re: Animations on multitasking, based on S. Hawkin - 06/09/07 18:26

Well why not just set your activity skill to the name of the animation which should be played?
Code:

my.activity = "stand";
//or:
my.activity = "walk";


Yes, this is possible.
Posted By: Ireng

Re: Animations on multitasking, based on S. Hawkin - 06/09/07 18:57

Dude, that seems... great. I never thought of that.
I'm currently trying to implement it.
Thanks in advance!
© 2024 lite-C Forums