A simple script to stop player's "sliding" physics
Posted: Thu Sep 21, 2017 5:21 am
Just wanted to share this. I'm not great with ACS so this might be not especially optimized or pretty-looking, but it works.
It's for those who want to make the player feel different and possibly include some jump puzzles: as soon as the player stops pressing movement keys, they'll stop moving (provided they're also not falling down or flying up).
It doesn't really stop your acceleration from being inconsistent during movement, so this might feel a bit weird.
Now, if somebody could tell me how to make player move at full speed immediately after pressing a movement button instead of gaining it steadily...
It's for those who want to make the player feel different and possibly include some jump puzzles: as soon as the player stops pressing movement keys, they'll stop moving (provided they're also not falling down or flying up).
Code: Select all
#library "MOVESTOP"
#include "zcommon.acs"
Script "Movestop" Enter
{
int buttons;
buttons = GetPlayerInput(-1, INPUT_BUTTONS);
delay(3);
if ( buttons & BT_FORWARD || buttons & BT_BACK || buttons & BT_MOVELEFT || buttons & BT_MOVERIGHT || GetActorVeLZ (0) != 0)
{
restart;
}
else
{
Thing_Stop(0);
}
restart;
}
Now, if somebody could tell me how to make player move at full speed immediately after pressing a movement button instead of gaining it steadily...