LUA - Detect if multiple units have been damaged or destroyed
Posted: Sun Jan 21, 2018 5:02 am
G'day all.
So despite my best detective work i've been unable to find a feasible way to have an action occur when multiple units have been destroyed within the same event, or find a LUA code to detect if a unit has been destroyed.
From what I gather, if you have multiple triggers in an event, the event doesn't wait for all triggers to have fired, it only requires one of the triggers to fire before an action (nothing in the conditions helps with this either) fires.
What I need is for an action to fire off only after multiple enemy units have been destroyed.
So say I have 3 enemy surface units that need to be sunk, I need a message to pop up once those 3 specific units have been sunk.
A bit of a visualisation of what I would ideally like to happen (I'm aware there is no 'and' function for triggers though):
EVENT - enemy SAG sunk
Triggers:
ship 1 destroyed
and
ship 2 destroyed
and
ship 3 destroyed
Action:
Message - enemy SAG has been sunk
Cheers.
So despite my best detective work i've been unable to find a feasible way to have an action occur when multiple units have been destroyed within the same event, or find a LUA code to detect if a unit has been destroyed.
From what I gather, if you have multiple triggers in an event, the event doesn't wait for all triggers to have fired, it only requires one of the triggers to fire before an action (nothing in the conditions helps with this either) fires.
What I need is for an action to fire off only after multiple enemy units have been destroyed.
So say I have 3 enemy surface units that need to be sunk, I need a message to pop up once those 3 specific units have been sunk.
A bit of a visualisation of what I would ideally like to happen (I'm aware there is no 'and' function for triggers though):
EVENT - enemy SAG sunk
Triggers:
ship 1 destroyed
and
ship 2 destroyed
and
ship 3 destroyed
Action:
Message - enemy SAG has been sunk
Cheers.