OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started 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?
-
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.
-
#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?
-
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
-
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.