Joe123
11-08-2007, 01:35 PM
Basically just makes Link walk slower, the same as a Slow Walk combo would do. At this point, it's just applied to the whole screen. I suppose it's usefulness really would be if anyone else wanted to use it as part of another script, but I can see it being quite useful so I'm putting it up. It also applies to when Link is jumping, which I could've got rid of, but I thought it could possibly come in handy.
ffc script slowwalk{
void run(int speed){
int framedelay = 0;
if(speed == 0){speed = 1;}
while(true){
if(Link->Action != LA_FROZEN && Link->Action != LA_ATTACKING){
if(Link->InputLeft && Link->Dir == DIR_LEFT){
if(framedelay == speed){Link->X = Link->X+1; framedelay = 0;}
else{framedelay++;}
}
if(Link->InputRight && Link->Dir == DIR_RIGHT){
if(framedelay == speed){Link->X = Link->X-1; framedelay = 0;}
else{framedelay++;}
}
if(Link->InputUp && Link->Dir == DIR_UP){
if(framedelay == speed){Link->Y = Link->Y+1; framedelay = 0;}
else{framedelay++;}
}
if(Link->InputDown && Link->Dir == DIR_DOWN){
if(framedelay == speed){Link->Y = Link->Y-1; framedelay = 0;}
else{framedelay++;}
}
}
Waitframe();
}
}
}
Just stick on an ffc on the screen where you want it to take effect.
D0 is the amount you want Link to slow down by. 1 is the most, and numbers larger than that reduce his walking speed by less. If you set it to 0, it is set to 1 by default (at 0, Link cannot walk).
ffc script slowwalk{
void run(int speed){
int framedelay = 0;
if(speed == 0){speed = 1;}
while(true){
if(Link->Action != LA_FROZEN && Link->Action != LA_ATTACKING){
if(Link->InputLeft && Link->Dir == DIR_LEFT){
if(framedelay == speed){Link->X = Link->X+1; framedelay = 0;}
else{framedelay++;}
}
if(Link->InputRight && Link->Dir == DIR_RIGHT){
if(framedelay == speed){Link->X = Link->X-1; framedelay = 0;}
else{framedelay++;}
}
if(Link->InputUp && Link->Dir == DIR_UP){
if(framedelay == speed){Link->Y = Link->Y+1; framedelay = 0;}
else{framedelay++;}
}
if(Link->InputDown && Link->Dir == DIR_DOWN){
if(framedelay == speed){Link->Y = Link->Y-1; framedelay = 0;}
else{framedelay++;}
}
}
Waitframe();
}
}
}
Just stick on an ffc on the screen where you want it to take effect.
D0 is the amount you want Link to slow down by. 1 is the most, and numbers larger than that reduce his walking speed by less. If you set it to 0, it is set to 1 by default (at 0, Link cannot walk).