Quasar
Moderator

Posts: 2202
Registered: 08-00 |
Right now, the only way to start an action after a particular set of monsters died would be to have all such monsters use a StartScript in their death frames like Joel suggested.
The trick is to create a global variable in your script that counts the number of deaths, but only if the trigger object's TRUE tid (not _TID_TRIGGER) is a certain value. It could look something like this:
code:
enum
{
DEMON_TID_1 = 999,
DEMON_TID_2,
DEMON_TID_3,
NUM_DEMONS = 3
}
new NumDemonsDead = 0;
public OnDemonDeath()
{
new tid = _GetThingSrc();
// NOTE: switch statements do not
// fall through cases in Small!
switch(tid)
{
case DEMON_TID_1:
++NumDemonsDead;
case DEMON_TID_2:
++NumDemonsDead;
case DEMON_TID_3:
++NumDemonsDead;
}
if(NumDemonsDead == NUM_DEMONS)
// Do anything here
}
I suggest using some special TID value like I have here if you intend to put this into the GlobalScript and use it on multiple maps. Otherwise, the behavior will be bound to an individual map's data, which may not be what you want.
(BTW, by having monsters call LevelScripts, you can certainly have differing monster behavior per map, but you must be sure to define all the scripts for all your maps)
|