
Xoronatus
Joined: Dec 6, 2010
Taking a break
|
Posted: Dec 24, 2010 03:15 PM
Msg. 1 of 3
Hi, Xoronatus here,
So I am making a great firefight map, the problem is that sometimes one of my ai will get stuck on the dropship when it goes away and he will escape to well... who knows where. But anyways, I need a script to make a kill barrier using a trigger volume to kill any ai if they get to high above the map.
here's what I'm thinking:
(script continuous bar (ai_kill wave1) (if volume_test_barrier true) )
er... something like that.
|

d4rfnader
Joined: Jul 16, 2010
Open mouth, insert sandwhich.
|
Posted: Dec 24, 2010 06:31 PM
Msg. 2 of 3
(script continuous killbarrier (if (volume_test_objects killer (ai_actors encountername/squadname) 15) (ai_erase encounter/squad) ) )
this might work, i didn't test it so, who knows.
|

Gamma927
Joined: Jun 12, 2008
Steam: gamma927
|
Posted: Dec 24, 2010 09:28 PM
Msg. 3 of 3
The issue with that script is that it'll kill the entire encounter, rather than just the AI stranded outside of the kill area. A "for each" styled script would work best.
Pseudocode (since I'm not at home right now, and lack the time to whip up the actual script)
Initialize a short to the amount of AI in the squad - 1. For the intent of this "tutorial", I'll assume it's called squadlength. Sleep until after AI is placed and after the dropship is high above (with all the AI in the kill box) Use a counter that loops a number between 0 and squadlength. We'll assume the short being looped is called counter. For each unit in the squad, (hint: (list_get (ai_actors [encounter name]) counter)) check if it's in the trigger volume. If so, kill it. Leave no else condition.
|