Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
40oz

Doom monster kill counter

Recommended Posts

Guest DILDOMASTER666

Use this to group a number of objects with Thing ID #200, and keep track of how many are active. To change the ThingID that is kept track of, change the line "#define SPECIALTHING 200". Assign action 80 with Script #900 to each Thing with the ID you are keeping track of.

#include "zcommon.acs"
#define SPECIALTHING 200

int SpecialCount;

Script 255 (void)
{
  if(!ThingCount(0,SPECIALTHING))
  {
    //Add your scripted events for when there are no more SpecialThings left
  }
}

Script 900 OPEN
{
  SpecialCount=ThingCount(0,SPECIALTHING);
}
Alternatively, if you wish to count how many of a certain thing are currently alive, you may do the following. For each Thing with the ID you wish to keep track of, simply assign Action #80 with Script #255. It will activate when the Thing becomes "dead". You should change the print() statement in Script 255 to a HudMessage command instead for a better effect.
#include "zcommon.acs"
#define SPECIALTHING 200

int ThingsCounted=ThingCount(0,SPECIALTHING);

Script 255 (void)
{
  if(!ThingCount(0,SPECIALTHING))
  {
    //Add your scripted events for when there are no more SpecialThings left
  }
}
Script 900 OPEN
{
  Print(d:ThingsCounted-ThingCount(0,SPECIALTHING,s:"Things killed.");
  Delay(5);
  Restart;
}

Share this post


Link to post
Guest DILDOMASTER666

If you want it to be global to all maps, you can do the following:

1. Compile this script by itself
2. Import the .o file into your WAD between A_START and A_END markers
3. Add a text lump named "LOADACS" and add the name of the imported script by itself

Then you just label all the things you want to be counted with ID 200 (or whatever you choose).

Share this post


Link to post

I know that this thread is very old, but to anyone who is searching for something akin to what the OP was looking for, I found something that could scratch that itch in a manner of speaking.

WarTrophies

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

×