Jump to content
Sign in to follow this  
DiFool

UAV sharing info with ground forces

Recommended Posts

Hello guys! I've been looking for a script that makes a UAV reporting the enemies spotted to other units (not group members) e.g. an infantry group. Is there already something, be it script or a built in module? Haven't found anything usable. Thanks in advance!

Share this post


Link to post
Share on other sites

normally any units the UAV sees will be shown on your map too, works that way with me anyway

another option is the press B which will place a marker on the users map according to where the UAV's crosshairs where pointed

Share this post


Link to post
Share on other sites

UAV actually have "people" in them, so they spot as any normal unit. If you use addons that make units share info about enemies then UAV will do so too. Other then that: HETMAN Artificial Commander addon actively uses UAV's to gather intelligence and react to that data by sending troops and such.

Share this post


Link to post
Share on other sites

Needed effect may be achieved for example with one of such scripts (executed once, usual way, as .sqf with suitable name):

//version compatibile with pure A2 1.10. Level of minimum UAV knowledge (here set as 0.05) may be adjusted if needed
//ArrayOfUnitsToSpot

while {(true)} do
{
for [{_a = 0},{_a < (count ArrayOfUnitsToSpot)},{_a = _a + 1}] do
	{
	_CheckedUnit = ArrayOfUnitsToSpot select _a;
		{
		if ((UAV_1 knowsAbout _CheckedUnit) >= 0.05) then {_x reveal _CheckedUnit}
		}
	foreach ArrayOfNamesOfGroupsThatShouldReceiveInfo
	};
sleep 15
}

or

//probably better version, but not tested, so effect unknown, for OA 1.60

while {(true)} do
{
for [{_a = 0},{_a < (count ArrayOfUnitsToSpot)},{_a = _a + 1}] do
	{
	_CheckedUnit = ArrayOfUnitsToSpot select _a;
	_UAVKnowledge = UAV_1 knowsAbout _CheckedUnit;
		{
		_x reveal [_CheckedUnit,_UAVKnowledge];
		}
	foreach ArrayOfNamesOfGroupsThatShouldReceiveInfo
	};
sleep 15
}

See for details:

Reveal

knowsAbout

UAV_1 is example name of spotting unit/vehicle. If UAV unit should to report info about all units present on map, if are known to this unit, then ArrayOfUnitsToSpot may be simply replaced by allUnits.

This should work with any spotter, so UAV_1 may be also a FO infantry, tank, civilian etc.

If there will be any problem with revealing units inside vehicles, means with revealing vehicle itself (shouldn't, but I'm not quite sure that), then line:

_CheckedUnit = ArrayOfUnitsToSpot select _a;

may be replaced with this one:

_CheckedUnit = vehicle (ArrayOfUnitsToSpot select _a);

This is way to direct transmission of knowledge value (probably not exact in first version). If there is needed reports in other form, it is also possible with this code after some changes (eg some chat message with name/kind/position of spotted target or marker placed on map instead of reveal...).

Share this post


Link to post
Share on other sites

Well, I made this script and it's working in general:

//version compatibile with pure A2 1.10. Level of minimum UAV knowledge (here set as 0.05) may be adjusted if needed

//ArrayOfUnitsToSpot

while {(true)} do

{

for [{_a = 0},{_a < (count allunits)},{_a = _a + 1}] do

{

_CheckedUnit = vehicle (allunits select _a);

{

if ((UAV_1 knowsAbout _CheckedUnit) >= 0.01) then {_x reveal _CheckedUnit}

}

foreach units group Player1;

};

sleep 10

}

Player1 is the name of the group leader and UAV_1 is UAV's name.

The Problem is that the UAV has got problems to spot infantry in urban areas. It spots better if I set speed to limited but then it crashes. Is there any way to increase the spotting sensitivity/skill of the thing?

Share this post


Link to post
Share on other sites

Yes, UAV has it's limitations. But maybe this way is more realistic? I don't know. And yes, it has tendency to crash. Maybe this will help with poor spotting:

setSkill_array

for example try to add this to UAV's init field:

this setskill ["spotDistance",1];this setskill ["spotTime",1]

maybe plus set overall skill to maximum...

BTW, about this:

	{
if ((UAV_1 knowsAbout _CheckedUnit) >= 0.01) then {_x reveal _CheckedUnit}
}
foreach units group Player1; 

It will work, but all group members share the same knowledge, so there is no need to reveal for all of them, in fact revealing only for group as a whole, or only for group leader will be sufficient. So, if this is about only one group, then foreach loop is uneccessary. Try this instead:

if ((UAV_1 knowsAbout _CheckedUnit) >= 0.01) then {Player1 reveal _CheckedUnit};

should be same effect with this:

if ((UAV_1 knowsAbout _CheckedUnit) >= 0.01) then {(group Player1) reveal _CheckedUnit};

and this :)

if ((UAV_1 knowsAbout _CheckedUnit) >= 0.01) then {leader (group Player1) reveal _CheckedUnit};

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  

×