OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: The-Architect on 13 Dec 2004, 13:24:49

Title: Randomly kill 3 guys
Post by: The-Architect on 13 Dec 2004, 13:24:49
I have a group which needs to board a chopper with limited seats. I have 11 men, chopper has 8 seats.

How can I have a script which will check how many units I have, and then, if I have more than 8, kill 3 ramdomly with a bmp shell?
Title: Re:Randomly kill 3 guys
Post by: macguba on 13 Dec 2004, 13:49:17
Condition:   randKill and "alive _x" count units grp1 > 8

As for the Activation line, that's a bit trickier.   What are the circumstances?    Is the player in the area?     Why is the group too big?   Could you use two choppers?     Or have the second one crash and the extra guys have to walk home.
Title: Re:Randomly kill 3 guys
Post by: Artak on 13 Dec 2004, 13:55:54
#start
_units = units groupname
_unitcount = count units groupname

#loop
~2
?_unitcount < 9: exit
_selector = random _unitcount
_unit = _units select (_selector - (_selector mod 1))
_shell = "shell73" camcreate getpos _unit
~5
_units = units groupname
_unitcount = count units groupname
goto "loop"



Would that do?
Title: Re:Randomly kill 3 guys
Post by: bored_onion on 13 Dec 2004, 17:52:18
wouldnt a shell artificially killing 3 guys be a bit precarious for the rest of the squad and the player in real terms - not to mention the chopper
Title: Re:Randomly kill 3 guys
Post by: The-Architect on 14 Dec 2004, 00:37:03
Its ok, I changed the Huey to a UH-1H which has 12 seats.

Too complicated to get into particulars about what I needed to do.

Cheers guys.