Jump to content
Sign in to follow this  
Freddan962

How do I make so AI uses a flare when they've spotted you?

Recommended Posts

Create a trigger on the map, activation blufor detected by opfor or the other way around.

In the on activation put: _null = [soldiername,"F_20mm_white",5] execVM "flare.sqf"

flare.sqf

if (isServer) then {
_flare_guy = _this select 0;
_flare_color = if (count _this > 1) then {_this select 1} else {"F_20mm_white"};
_flare_count = if (count _this > 2) then {_this select 2} else {3};
_counter = 0;

while {alive _flare_guy && _counter < _flare_count} do {
	_flare = _flare_color createvehicle [(getpos _flare_guy select 0) - random 150 + random 300 , (getpos _flare_guy select 1) - random 150 + random 300 , 150 + random 100];
	_flare setVelocity [0,0,-10];
	_counter = _counter + 1;
	sleep 60 + (random 60);
};
};

Share this post


Link to post
Share on other sites
Create a trigger on the map, activation blufor detected by opfor or the other way around.

In the on activation put: _null = [soldiername,"F_20mm_white",5] execVM "flare.sqf"

flare.sqf

if (isServer) then {
_flare_guy = _this select 0;
_flare_color = if (count _this > 1) then {_this select 1} else {"F_20mm_white"};
_flare_count = if (count _this > 2) then {_this select 2} else {3};
_counter = 0;

while {alive _flare_guy && _counter < _flare_count} do {
	_flare = _flare_color createvehicle [(getpos _flare_guy select 0) - random 150 + random 300 , (getpos _flare_guy select 1) - random 150 + random 300 , 150 + random 100];
	_flare setVelocity [0,0,-10];
	_counter = _counter + 1;
	sleep 60 + (random 60);
};
};

Thank you very much my friend!

How would I create such a trigger?

Share this post


Link to post
Share on other sites
Thank you very much my friend!

How would I create such a trigger?

If you don't know how to create and use triggers, then you really need to go back to basics and learn about creating missions.

Check out this thread and ask your basic questions in there.

ArmA-3-Editor-Tutorials-Building-Simple-Missions

Share this post


Link to post
Share on other sites

Another method would be in the condition of your trigger put:

{_x knowsAbout player > 1.5 || behaviour _x == "COMBAT"} count thislist > 0

Then on activation would be your flare script.

Edited by cobra4v320

Share this post


Link to post
Share on other sites
If you don't know how to create and use triggers, then you really need to go back to basics and learn about creating missions.

Check out this thread and ask your basic questions in there.

ArmA-3-Editor-Tutorials-Building-Simple-Missions

I know how to create them but I'm not sure how to create the one that he told me.

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  

×