Subject of greater complexity.
I urge my players to lock and use their autonomous weapons within their bases (in my version I use the BoS addon) as an exclusive defensive purpose, and thus avoid being left near the stores, ATMs, or enemy bases in a troll plan.
Would it be possible to force the AI not to attack until they are locked, and in turn these can only be locked within a radius close to the object that defines the base of the player (the satellite phone, in this case)?
Something like:
If case {static autonomous}
If distance_to "Land_SatellitePhone_F" is_not (less than or equal) than actual_BaseRadius*, then force R3F_islocked = false;
until R3F_ isLocked = true; force "green" (or the most pacifist color)
Sorry for the mess, but I hope you get the idea. And I do not know where I would put this code. LOL. God! I have to learn to code in ArmA 3!
*that number must be the current radius of each base so that it is always inside and so they can be resupplied and rearmed from the BoS menu.
For example:
This is the code used to detect the radius of the base.
// @file Version:
// @file Name:
// @file Author: Cael817, all credit to Killzone Kid Edited by: BIB_Monkey
// @file Created:
private _manager = nearestObject [player, "Land_SatellitePhone_F"];
private _ManagerPosition = getpos _manager;
//Get manager level
private _ManagerLevel = _manager getVariable ["ManagerLevel", 1];
//set default base radius for level 1 manager
private _BaseRadius = 10;
//set base radius based on manager level
switch (_ManagerLevel) do
{
case (2):
{
_BaseRadius = 20;
};
case (3):
{
_BaseRadius = 30;
};
case (4):
{
_BaseRadius = 40;
};
case (5):
{
_BaseRadius = 50;
};
};
{
if (!local _x) then
{
private _setOwner_time = time;
[_x, "setOwnerTo", player] call R3F_LOG_FNCT_exec_commande_MP; // Requires R3F 3.1
waitUntil {local _x || time > _setOwner_time + 1.5};
};
_x setHit ["light_1_hitpoint", 0];
_x setHit ["light_2_hitpoint", 0];
_x setHit ["light_3_hitpoint", 0];
_x setHit ["light_4_hitpoint", 0];
_x setHit ["light_1_hit", 0];
_x setHit ["light_2_hit", 0];
_x setHit ["light_3_hit", 0];
_x setHit ["light_4_hit", 0];
_x setVariable ["lights", "on", true];
} forEach nearestObjects [_ManagerPosition, [
"Static",
"Thing"
], _BaseRadius, true];
hint "Lights ON";
It is possible that more than one player intends to lock one of his autonomous static weapons within the area of an enemy base; but I think that the base system itself does not allow it; since the area must belong to you for it.