A Community discussion forum for Halo Custom Edition, Halo 2 Vista, Portal and Halo Machinima

Home  Search Register  Login Member ListRecent Posts
  
 
»Forums Index »Halo Custom Edition (Bungie/Gearbox) »Halo CE General Discussion »Script to check if an encounter has been killed.

Author Topic: Script to check if an encounter has been killed. (3 messages, Page 1 of 1)
Moderators: Dennis

Jobalisk
Joined: Feb 8, 2014

The haiku master。


Posted: Oct 25, 2014 06:57 PM    Msg. 1 of 3       
does anyone know a script to check if an encounter has been killed?

As in sleep until encounter jackles2 is dead.


teh lag
Joined: May 6, 2008


Posted: Oct 25, 2014 07:43 PM    Msg. 2 of 3       
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


Jobalisk
Joined: Feb 8, 2014

The haiku master。


Posted: Oct 25, 2014 08:50 PM    Msg. 3 of 3       
Thanks! This is just what I was looking for to finish off guardian forest.

 

 
Previous Older Thread    Next newer Thread







Time: Thu January 19, 2023 6:06 PM 141 ms.
A Halo Maps Website