A simple script to stop player's "sliding" physics

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Jekyll Grim Payne
Global Moderator
Posts: 1117
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)
Contact:

A simple script to stop player's "sliding" physics

Post by Jekyll Grim Payne »

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).

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;
}
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...
Attachments
movestop.wad
(590 Bytes) Downloaded 134 times
Locked

Return to “Editing (Archive)”