Jump to content

Crouch sliding in ACS... Need help


DΞLTΛ

Recommended Posts

So here we some code cobbled together from other ACS code as an experiment to make crouch sliding possible

 

As you can see, I made a ultrakill style sliding system that when a certain cvar is set, switches to a nomal slide, and that's where the problem is..

 

The code beneath this:

 

if(GetCVAR("Slide") == 0  & (GetActorProperty(0, APROP_HEALTH) >= 1))

 

Should do a regular slide that won't happen again until the player stands up and presses crouch again. But it doesn't do that for some reason... Any ideas on how to make it work correctly?

#library "Slide"
#include "zcommon.acs"

script "ultraslide" enter
{
	int x, y, ang;
	while( true )
	{
	delay(1);
	if(getplayerinput(0, INPUT_BUTTONS) & BT_CROUCH)
	{
	if(GetCVAR("Slide") == 1  & (GetActorProperty(0, APROP_HEALTH) >= 1))
	{
		thing_stop(0);
		x = GetPlayerInput(-1, INPUT_FORWARDMOVE);
		y = -GetPlayerInput(-1, INPUT_SIDEMOVE);
		ang = getactorangle(0)+vectorangle(x, y);
		if(x || y) ThrustThing (ang>>8, 24, 1, 0);
		ThrustThingZ(0, -30, 0, 0);
		restart;
	}
	if(GetCVAR("Slide") == 0  & (GetActorProperty(0, APROP_HEALTH) >= 1))
	{
		thing_stop(0);
		ang = getactorangle(0);
		ThrustThing (getactorangle(0)/256, 24, 1, 0);
		ThrustThingZ(0, -30, 0, 0);
		Delay(10);
	}
	}
	}
}

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...