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

Terminating a script instantly upon player death...

Recommended Posts

Assuming this can be done, of course, what would be the best way to do this?



Thanks guys.

Share this post


Link to post

int playerDies = 0;

script 1 DEATH
{
    playerDies = 1;
}

script 2 (void)
{
    while(1)
    {
        Delay(10);
        if (playerDies)
            terminate;
    }
}
Is one way of doing it, if I interpreted your question correctly.

Share this post


Link to post

Alternatively:

script 1 DEATH {
    ACS_Terminate (0, 2);
}
The above would terminate script 2 when the player dies unless the script was triggered with ACS_ExecuteAlways or was an ENTER script.

Share this post


Link to post
Guest

Thanks for the replies :)


btw, anyone, what is an ENTER script? I have always used (void) or OPEN scripts, and can't actually find out exactly what an ENTER script is. Probably the reason it doesn't seem to say on wiki is coz it is so obvious as to what it is, but heh, everything I know about scripting/programming I learned from ACS. Which means I missed all the basics.

Share this post


Link to post
Kyka said:

btw, anyone, what is an ENTER script? I have always used (void) or OPEN scripts, and can't actually find out exactly what an ENTER script is. Probably the reason it doesn't seem to say on wiki

http://zdoom.org/wiki/ACS

Subpages

  • A quick beginner's guide to ACS
  • Variables and data types
  • Unit definitions
  • Action Specials
  • Built-in ACS functions
  • FOR and WHILE loops
  • Doom Builder ACS Configuration
  • Libraries
  • Other useful functions
  • Rick Clark's Scripting Primer
  • Script types (OPEN, ENTER, etc)
  • About Multiplayer, Scripts, and TIDs

http://zdoom.org/wiki/Script_types

Share this post


Link to post

An ENTER script runs any time a player enters the map, whether by starting a new game, entering the level, joining a game in progress, or respawning. In single-player, it's functionally equivalent to an OPEN script, but in cooperative or other multiplayer modes, the distinction is important.

Share this post


Link to post
Guest

Thanks Gez (Heh, of course I missed that one) and essel. :)

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  
×