I want to make a monster counter that works in real-time, in-game. I searched around for that and founded an example on ZDoom Wiki which unfortunately it does not work. For example, there are 24 monsters in E1M1 and the counter says "Defeat 1048 more monsters!" or just random numbers. It obviously does not work as intended.
The page: http://zdoom.org/wiki/ThingCount
The script:
Code: Select all
script 5 (int armytid)
{
Thing_Hate(armytid, 0, 0);
While (ThingCount(0, armytid) > 0)
{
HudMessage(s:"Defeat ", d:ThingCount(0, armytid), s:" more monsters!";
HUDMSG_PLAIN, 1, CR_RED, 0.5, 0.9, 2.0);
Delay(35);
}
HudMessage(s:"Victory!";
HUDMSG_PLAIN, 1, CR_GOLD, 0.5, 0.9, 2.0);
}
Thanks a lot.