function repeatedly_execute_always()
{
if (player.Moving) {
switch (player.Loop) {
case 0: //Down
case 3: //Up
player.AnimationSpeed = 1;
break;
case 1: //Left
case 2: //Right
player.AnimationSpeed = 4;
break;
}
}
}
Animation speed determines how many frames delay there are between changing animation frames, but it only takes integers. You will need to adjust this based on how many frames are in your view. (I'm assuming some programming knowledge here, but if you need further help, feel free to ask.) Now, this is going to change the walking speed. You have 2 options. You can set the character's MovementLinkedToAnimation to false, in which case it will have more of a gliding effect (you'll need to also adjust MovementSpeed lower to get it to appear right), or you can keep it to true, but change it like so:
function repeatedly_execute_always()
{
if (player.Moving) {
switch (player.Loop) {
case 0: //Down
case 3: //Up
player.AnimationSpeed = 1;
player.SetWalkSpeed(2, 2);
break;
case 1: //Left
case 2: //Right
player.AnimationSpeed = 4;
player.SetWalkSpeed(4, 4);
}
}
}
I don't know exactly how the speed is calculated, but this appears somewhat good for me.
I have it set to repeatedly_execute_always so that if walking as a result of a script while blocking other inputs, it will still update the speeds.