Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Darkhaven4

"Runaway Script 3 Terminated"

Recommended Posts

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?

Share this post


Link to post

Replace the 'while' with an 'if'. 'While' causes the script to endlessly loop when the condition is true.

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

Of course it doesn't make sense. But that's a logic problem, not the reason why the script terminates.

Share this post


Link to post

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.

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
Sign in to follow this  
×