I'd do:
//Attach it inside WED to an object:
action playerscript()
{
while(1)
{
if (key_w)
{
anim_percentage += (10*time_step)%100; //%100 keeps it inside 100 value
ent_animate(me, "walk", anim_percentage, ANM_CYCLE); //animates the player
}else{ //If no button, do the idle or stand or whatever:
idle_precentage += (5*time_step)%100; //declare a second percentage variable for this!
ent_animate(me, "idle", idle_percentage, ANM_CYCLE); //animates the player
}
c_move(me,vector(10*time_step,0, 0), nullvector, GLIDE); //sets the player in movement
wait (1);
}
}
for movement I'd do a speed variable and make it's value according to buttons:
spdx = (key_w - key_a)*10*time_step;
The idea is that when you press W you get (1-0)*10*time_step which is like 10*timestep. Positive value to move forward. And when A is pressed you get
(0-1)*10*time which is -10*time_step a negative value to go backward f.i.
And then use it inside "relvector" x component in c_move.
Just go and search for tutorials. Such tricks and hints are covered there.
Cheers!