Darkhaven4 Posted June 15, 2004 I have a problem with my scripts for a map I'm working on right now for Hexen. See, when I define my variable (now known as EttinsKill0) and when the player kills an Ettin near the front door, it adds 10 to the variable. This all works perfectly fine. However, when the counter reaches 20 (player kills two ettins) I make a call for a door to open. It may not be too serious, but it's still a problem; After the door opens, I get the message, "Runaway Script 3 Terminated." Problem with that is, I put an "ACS_Terminate(X, Y);" command at the end of the script but I still get this message. Here's the scripts that cause this: #include "zcommon.acs" int EttinsKill0 = 0; Script 1 (int arg0) { Thing_Activate(arg0); //Activate the Ettin "statues" } Script 2 open { //Animated Floors stuff Delay(10); ChangeFloor(2, "X_007"); Delay(10); ChangeFloor(2, "X_008"); Delay(10); ChangeFloor(2, "X_006"); Restart; } Script 3 (void) { EttinsKill0 = (EttinsKill0+10); while(EttinsKill0 >= 20) //When the counter reaches 20... { Ceiling_RaiseToNearest(4, 50); // Open the door with tag 4 } ACS_Terminate(3, 1); //Terminate Script 3 on MAP01 } Does anyone see anything wrong with this script? 0 Share this post Link to post
Graf Zahl Posted June 16, 2004 Replace the 'while' with an 'if'. 'While' causes the script to endlessly loop when the condition is true. 0 Share this post Link to post
boris Posted June 16, 2004 I'm pretty sure the problem is not the infinite loop (in general), but that there is no delay. That makes the script terminate. Try something like this: while(bla) { print(s:"kekeke"); delay(1); // <-- we have to delay at least one tic! } That should work. 0 Share this post Link to post
Graf Zahl Posted June 16, 2004 The problem is the infinite loop - which doesn't make any sense in this case! It should be an if so that the ceiling only rises once. 0 Share this post Link to post
boris Posted June 16, 2004 Of course it doesn't make sense. But that's a logic problem, not the reason why the script terminates. 0 Share this post Link to post
Darkhaven4 Posted June 17, 2004 It worked. #include "zcommon.acs" Script 1 (void) { While(Graf_ZahlIdea=1) { Print(s: "\cG Darkhaven4 sucks"); Delay(1); Print(s: "\cG I own yuo fagot"); Delay(1); } } Heh. 0 Share this post Link to post