DELTA256 Posted October 23, 2022 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. 0 Share this post Link to post
Kan3 Posted October 23, 2022 I believe it's a bug, cause I cannot make it work either, not in Slade and not in UDB 0 Share this post Link to post
boris Posted October 23, 2022 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. 0 Share this post Link to post
DELTA256 Posted October 24, 2022 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... 0 Share this post Link to post
ramon.dexter Posted October 24, 2022 (edited) 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. 0 Share this post Link to post