Skip to content

Commit

Permalink
updat water radius
Browse files Browse the repository at this point in the history
  • Loading branch information
tbox1911 committed Feb 13, 2025
1 parent cedb64f commit 7bbd14e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion core.liberation/scripts/server/ai/add_civ_waypoints.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if (isNull _grp) exitWith {};
if (!local _grp) exitWith { [_grp, _basepos] remoteExec ["add_civ_waypoints", groupOwner _grp] };

private _civ_veh = objectParent (leader _grp);
if (_civ_veh isKindOf "Ship") exitWith { [_grp, getPosATL _civ_veh, 80] spawn patrol_ai };
if (_civ_veh isKindOf "Ship") exitWith { [_grp, getPosATL _civ_veh, 120] spawn patrol_ai };

[_grp] call F_deleteWaypoints;

Expand Down
3 changes: 2 additions & 1 deletion core.liberation/scripts/server/ai/battlegroup_ai.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ private _attack = true;
private _timer = 0;
private _last_pos = getPosATL (leader _grp);
diag_log format ["Group %1 (%2) - Attack: %3 - Distance: %4m", _grp, _veh_type, _objective_pos, round (_last_pos distance2D _objective_pos)];
sleep (5 + floor random 30);

private ["_waypoint", "_wp0", "_next_objective", "_timer", "_sleep", "_target"];
while {(count _objective_pos > 0)} do {
Expand Down Expand Up @@ -59,7 +60,7 @@ while {(count _objective_pos > 0)} do {
if (_vehicle isKindOf "AllVehicles") then {
(driver _vehicle) doMove _objective_pos;
} else {
[_objective_pos] call F_getEmptyArmored;
[_objective_pos] spawn F_getEmptyArmored;
};

_timer = round (time + (15 * 60));
Expand Down
9 changes: 5 additions & 4 deletions core.liberation/scripts/server/ai/defence_ai.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@ params ["_grp", "_flagpos", ["_radius", 100]];
if (isNil "_grp" || isNil "_flagpos") exitWith {};
if (isNull _grp) exitWith {};

private _grp_veh = objectParent (leader _grp);
if (_grp_veh isKindOf "Ship") exitWith { [_grp, getPosATL _grp_veh, 200] spawn patrol_ai };

_flagpos = _flagpos getPos [5, random 360];
diag_log format ["Group %1 - Defend: %2", _grp, _flagpos];

private _grp_veh = objectParent (leader _grp);
if (_grp_veh isKindOf "Ship") exitWith { [_grp, getPosATL _grp_veh, _radius] spawn patrol_ai };
sleep (5 + floor random 30);

private _timer = 0;
private _patrol = false;
private ["_target", "_basepos", "_waypoint", "_wp0"];

while { GRLIB_endgame == 0 && ({alive _x} count (units _grp) > 0) } do {
if (side _grp == GRLIB_side_enemy) then {
[_flagpos] call F_getEmptyArmored;
[_flagpos] spawn F_getEmptyArmored;
_target = [_flagpos] call F_getNearestBlufor;
};
if (side _grp == GRLIB_side_friendly) then {
Expand Down
1 change: 0 additions & 1 deletion core.liberation/scripts/server/ai/patrol_ai.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ if (_grp_veh isKindOf "Ship") then {
_flagpos = getPosATL _grp_veh;
_patrol_in_water = true;
};
if (_patrol_in_water) then { _radius = 160 };

private _patrolcorners = [
[ (_flagpos select 0) - _radius, (_flagpos select 1) - _radius, 0 ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ private _armed_veh = vehicles select {
};

if (count _armed_veh > 0) then {
[_armed_veh select 0] call F_searchGunner;
[selectRandom _armed_veh] call F_searchGunner;
};

0 comments on commit 7bbd14e

Please sign in to comment.