OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Doffen74 on 26 Aug 2003, 17:20:52
-
Is there any way to determine wether a unit is ready to fire at its assigned target?
I want a to make a script that singles out a certain number of enemies, assigns them as targets to the units I have selected (all on hold fire), and when they are all "ready to fire", the script gives the a go.
This way all the targets will be taken out in one controlled sweep. Could be cool for soldiers with snipers or silenced weapons.
I would also like to know how I can make selected units (with F-keys) be affected by selected scrips from my command list or radio.
Anyone???
???
-
You can make a Script like this:
---------------------------------------------------------------------------
_FoeArray = _this select 0; the array of enemy's [e1,e2,,..... and soo on
_group = _this select 1; the Men you is to kill the guys in _FoeArray
_gunners = units _group
_amount = count _gunners
_i = 0
_g = 0
_u = 0
#loop
? _i >= 11 : goto "CheckReady"
_gunners select _i dotarget _FoeArray select _i
_i = _i + 1
~0.1
goto "loop"
#CheckReady
? _g = _amount : _g = 0
? _u = _amount : goto "Fire"
? unitready _gunners select _g : _u = _u + 1
_g = _g + 1
~0.1
goto "CheckReady"
#fire
"_x dofire objnull" foreach _gunners
---------------------------------------------------------------------------
Enjoy 8)