Quote: --- Original message by: Jobalisk
does anyone know a script to check if an encounter has been killed?
As in sleep until encounter jackles2 is dead.
depending on what exactly you're looking to do, one of the following functions is probably what you want:
(ai_living_count <ai>)
;; return the number of living actors in the specified encounter and/or squad.
(ai_living_fraction <ai>)
;; return the fraction [0-1] of living actors in the specified encounter and/or squad.
(ai_strength <ai>)
;; return the current strength (average body vitality from 0-1) of the specified encounter and/or squad.
note that ai_living_fraction has some quirks to it if you migrate or spawn new units into or out of an encounter / squad / platoon. as a result, i've found that living_count is usually easier to control.
so you'd have in your script:
(ai_place jackles2)
;; do some stuff
;; await jackal death
(sleep_until (= 0 (ai_living_count jackles2)))
;; do some more stuff