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

Scripting Problems

Recommended Posts

I am having problems scripting an event when three different kinds of monsters die. These monsters are a CyberMastermind, a Cyberdemon, and a LordofHeresy.

I do not know how to script an event which checks to see if each is dead. I also do not know the thing ID's.

Share this post


Link to post

First of all, give them all the same TID (Thing ID).

Then, use this script (using 1 as the TID for this example)

Script 1 OPEN
{
while(thingcount(0,1) > 0)
{
Delay(35);
}
[whatever the event is goes here]
}

Share this post


Link to post

I didn't know how the thingcount worked so I did this:

#include "zcommon.acs"
int var = 3;

Script 1 (void)
{
var = var - 1;
if (var == 0)
{
Door_Open(1,64);
}
}

Each monster you kill will execute the script once, there might be better ways of doing this but this one worked for me.

Share this post


Link to post

Shtbag667 said:
I didn't know how the thingcount worked so I did this:

#include "zcommon.acs"
int var = 3;

Script 1 (void)
{
var = var - 1;
if (var == 0)
{
Door_Open(1,64);
}
}


Alternatively...

Replace "var = var - 1;" with "var-=1;".

Share this post


Link to post
Shtbag667 said:

I didn't know how the thingcount worked so I did this:

#include "zcommon.acs"
int var = 3;

Script 1 (void)
{
var = var - 1;
if (var == 0)
{
Door_Open(1,64);
}
}

Each monster you kill will execute the script once, there might be better ways of doing this but this one worked for me.


You solved the problem. Thanks a ton.

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  
×