Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
DELTA256

Why is it that BT_RUN is not an identifier?

Recommended Posts

I'm trying to make a base for a wall running project, but for some reason when I try to compile it, it says "identifier has not been declared" right about the BT_RUN part.

Here's the code:

script 32767 ENTER
{
 int buttons;

	while (TRUE)
	{
		buttons = GetPlayerInput(-1, INPUT_BUTTONS);
   
		if (buttons & BT_RUN)
		{
			thrustthing(getactorangle(0) / 256, 32, 0, 0);
			delay (1);
		}
	}
}

I checked the wiki and bt_run is supposed to be a valid input but the compiler just doesn't see that for some reason..

A little help would be nice.

Share this post


Link to post

I believe it's a bug, cause I cannot make it work either, not in Slade and not in UDB

Share this post


Link to post

There is no BT_RUN in zdefs.acs. In the source code it's defined as 1<<25 (which is 33554432), so you can use that directly.

Share this post


Link to post

Well now I have another problem, I tried this but when I test it, it says "runaway script 32767 terminated", even though it should work...

script 32767 ENTER
{
 int buttons;

	while (TRUE)
	{
		buttons = GetPlayerInput(-1, INPUT_BUTTONS);
   
		if (buttons & bt_speed)
		{
			thrustthing(getactorangle(0) / 256, 32, 0, 0);
			delay (1);
			restart;
		}
	}
}

I should probably start learning zscript, or pretend I never had the idea to begin with...

Share this post


Link to post

Yes, the script gets terminated, because there is no Delay() in the while() loop. Just add Delay(1); and it should work. Basically, remove it from the if() check. Also tje restart; is not necessary here at all. It actually breaks the loop.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×