Jump to content
Sign in to follow this  
humvee28

Force AI to use Devices at a specific Time

Recommended Posts

Hi there!

I´m absolutely new to Mission Editing and Scripting, and have read and tried alot in the last Days, but for some Ideas i found no Answer. :)

However, here it is :

I´ve got a Mission with an AI Squad here, and they´re equipped with ACE IR Strobes and Laser-equipped Rifles. Now i´m planning to make a little Script which tells the AI to turn on the Devices only during Nighttime. Can someone help me out there, please?

Thanks in advance!

Share this post


Link to post
Share on other sites

Fixed the Problem by myself. It isn´t time specific, but well..

For everyone who is interested, read below. :)

(entered in the Unitspawn Script)

Weapon Lasers :

(group or unitname) enableIRLasers true;

ACE IR Strobes :

["ace_sys_irstrobe_aradd", [_unitname]] call CBA_fnc_globalEvent;

One Question remains : Is it possible to address the whole Group in the IR Strobe Command, or is it needed to type a Command for every single Unit, which i have done now? I have tried with forEach etc., but i got always an Errormessage ingame via the -showscripterrors Function.

Share this post


Link to post
Share on other sites
// for all units in a group.
{
["ace_sys_irstrobe_aradd", [_x]] call CBA_fnc_globalEvent;
} foreach units groupname;


// for all west units.
{
if ((side _x) == west) then {
	["ace_sys_irstrobe_aradd", [_x]] call CBA_fnc_globalEvent;
};
} foreach allUnits;

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×