Skip to content

Commit

Permalink
Miscellaneous fixes - Batch 1 (Tiny) (#3102)
Browse files Browse the repository at this point in the history
* initial commit (fn_captureX)

* core/functions/ai localization

* addons/core/base (jesus christ)

* convoy, create, dialogs

* up through the end of OrgPlayers

* punishment and reinf

* core done. on to the stringtable

im not looking forward to this

* ....done?

everything is done. no testing and reworks yet

* refinements, on to testing

when I get off my lazy ass (never)

* save so I can continue on my laptop tomorrow

* saving again

* im losing my sanity

* final commit before PR

* I deny making these bugs

* I lied about being done btw

* no im serious this time

* Complete - Awaiting Review

* Changes by rautamiekka

I had to change _level into a string to make it convert properly but otherwise this is rauta's

* Actually completed this time

Finished a few stray lines that had the //TODO: Localize tag on them. Further lines can be tagged as needed. Ready for review.

* Updated files -- KNOWN BUG

* github please work

* merge resolved

* Change by John + 1

reverted a change accidentally made here that should have been in another branch

* Minor syntax fix

Always test your changes kids

* fixed random response selection

known issue

* Changes from Bob + more

Fixed a minor bug preventing resourcesFIA from showing properly. Learned my lesson not to touch Barbolani code without understanding exactly how it works.

* Minor fix

somehow I still fucked something up. added stringtables for "you damaged a friendly as cas/admin/driver/arty". Fixed the autosave start message.

* initial commit

ok this time we make sure everything works on the FIRST commit not the 29TH

* experimental update

NOT TESTED - DROPBOX BEING STUPID

* minor fixes for prev bugs

* small fix that slipped through

* another tiny fix

* third batch (UNSTABLE)

these changes are NOT tested.

* Revert "Merge branch 'more-unstable-internal' into misc-fixes-batch1"

This reverts commit b792d20, reversing
changes made to 3d8ecf0.

* fixes for prev commit (RDY)

* fixes from John

* more misc fixes (RDY)

* 1.22.24 fixes (UNTESTED)

* minor fixes from John (RDY)

* Changes by Bob and Rauta (UNTESTED))
  • Loading branch information
Tiny-DM authored Jan 23, 2024
1 parent 4114cfe commit 2f90e16
Show file tree
Hide file tree
Showing 34 changed files with 232 additions and 178 deletions.
3 changes: 2 additions & 1 deletion A3A/addons/core/CfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class CfgFunctions
class cargoSeats {};
class cleanserVeh {};
class countFreeSpawnPositions {};
class createAIAirplane {};
class createAIAirbase {};
class createAICities {};
class createAIcontrols {};
class createAIOutposts {};
Expand Down Expand Up @@ -381,6 +381,7 @@ class CfgFunctions
class prepareMarkerArrays {};
class resourcecheck {};
class tags {};
class checkCampaignEnd {};
};

class Intel {
Expand Down
84 changes: 39 additions & 45 deletions A3A/addons/core/Stringtable.xml

Large diffs are not rendered by default.

36 changes: 11 additions & 25 deletions A3A/addons/core/functions/AI/fn_vehicleMarkers.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,17 @@ _side = side (group (driver _veh));
_typeX = "_unknown";
_formatX = "";
_color = colorOccupants;
if (_veh isKindOf "Truck" or _veh isKindOf "Car") then {_typeX = "_motor_inf"}
else
{
if (_veh isKindOf "Wheeled_APC_F") then {_typeX = "_mech_inf"}
else
{
if (_veh isKindOf "Tank") then {_typeX = "_armor"}
else
{
if (_veh isKindOf "Plane_Base_F") then {_typeX = "_plane"}
else
{
if (_veh isKindOf "UAV_02_base_F") then {_typeX = "_uav"}
else
{
if (_veh isKindOf "Helicopter") then {_typeX = "_air"}
else
{
if (_veh isKindOf "Boat_F") then {_typeX = "_naval"}
};
};
};
};
};
};
_typeX = switch (true) do {
case (_veh isKindOf "Wheeled_APC_F"): {"_mech_inf"};
case (_veh isKindOf "Tank"): {"_armor"};
case (_veh isKindOf "Plane_Base_F"): {"_plane"};
case (_veh isKindOf "UAV_02_base_F"): {"_uav"};
case (_veh isKindOf "Helicopter"): {"_air"};
case (_veh isKindOf "Boat_F"): {"_naval"};
case (_veh isKindOf "Truck"): {"_motor_inf"};
case (_veh isKindOf "Car"): {"_motor_inf"};
default {"_motor_inf"};
};

if ((_side == teamPlayer) or (_side == sideUnknown)) then
{
Expand Down
2 changes: 1 addition & 1 deletion A3A/addons/core/functions/Base/fn_airspaceControl.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ else
private _outpostDetectionRange = [300, 500, 750] select _airType;
private _outpostDetectionHeight = [150, 250, 500] select _airType;

//Select height and range for outposts, numbers are values for [CIV_HELI, MIL_HELI, JET]
//Select height and range for airports, numbers are values for [CIV_HELI, MIL_HELI, JET]
private _airportDetectionRange = [500, 750, 1500] select _airType;
private _airportDetectionHeight = [500, 500, 2500] select _airType;

Expand Down
9 changes: 0 additions & 9 deletions A3A/addons/core/functions/Base/fn_canMoveHQ.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ if (player != theBoss) then
_result pushBack localize "STR_A3A_fn_base_canmovehq_comm_only";
};

if ((count weaponCargo boxX >0) or (count magazineCargo boxX >0) or (count itemCargo boxX >0) or (count backpackCargo boxX >0)) then
{
if(count _result == 1) then
{
[_titleStr, localize "STR_A3A_fn_base_canmovehq_no_empty1"] call A3A_fnc_customHint;
};
_result pushBack localize "STR_A3A_fn_base_canmovehq_no_empty2";
};

if !(isNull attachedTo petros) then
{
if(count _result == 1) then
Expand Down
1 change: 1 addition & 0 deletions A3A/addons/core/functions/Base/fn_createOutpostsFIA.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ _groupX setGroupId ["Post"];
_road = [getMarkerPos respawnTeamPlayer] call A3A_fnc_findNearestGoodRoad;
_pos = position _road findEmptyPosition [1,30,"B_G_Van_01_transport_F"];
_truckX = _typeVehX createVehicle _pos;
[_truckX, teamPlayer] call A3A_fnc_AIVEHinit;
//_nul = [_groupX] spawn dismountFIA;
_groupX addVehicle _truckX;
{[_x] call A3A_fnc_FIAinit} forEach units _groupX;
Expand Down
6 changes: 3 additions & 3 deletions A3A/addons/core/functions/Base/fn_distance.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Dependencies:
Occupants, Invaders, teamPlayer, markersX, forcedSpawn, spawner,
controlsX, airportsX, resourcesX, factories, outposts, seports,
A3A_fnc_createAICities, A3A_fnc_createCIV, A3A_fnc_createAIcontrols,
A3A_fnc_createAIAirplane, A3A_fnc_createAIresources, A3A_fnc_createAIOutposts,
A3A_fnc_createAIAirbase, A3A_fnc_createAIresources, A3A_fnc_createAIOutposts,
A3A_fnc_createFIAOutposts2, A3A_fnc_createSDKGarrisons
Example: [] spawn A3A_fnc_distance;
Expand Down Expand Up @@ -124,7 +124,7 @@ private _processOccupantMarker = {

case (_marker in airportsX):
{
[[_marker], "A3A_fnc_createAIAirplane"] call A3A_fnc_scheduler;
[[_marker], "A3A_fnc_createAIAirbase"] call A3A_fnc_scheduler;
};

case (_marker in resourcesX);
Expand Down Expand Up @@ -324,7 +324,7 @@ private _processInvaderMarker = {

case (_marker in airportsX):
{
[[_marker], "A3A_fnc_createAIAirplane"] call A3A_fnc_scheduler;
[[_marker], "A3A_fnc_createAIAirbase"] call A3A_fnc_scheduler;
};

case (_marker in resourcesX);
Expand Down
1 change: 1 addition & 0 deletions A3A/addons/core/functions/Base/fn_markerChange.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ if (_markerX in airportsX) then
_prestigeOccupants = [-25, 90];
_prestigeInvaders = [50, 150];
};
[] spawn A3A_fnc_checkCampaignEnd; // If an airport is taken by rebels, check for victory
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ if(spawner getVariable _markerX == 2) exitWith {};
ServerDebug_1("Spawning Airbase %1", _markerX);

_vehiclesX = [];
_AAvehicles = []; // to disable AA driver AI until everything else is dealt with
_groups = [];
_soldiers = [];
private _dogs = [];
Expand Down Expand Up @@ -45,10 +46,11 @@ for "_i" from 1 to _max do
_groupVeh = [_sideX, _veh] call A3A_fnc_createVehicleCrew;
{[_x,_markerX] call A3A_fnc_NATOinit} forEach units _groupVeh;
[_veh, _sideX] call A3A_fnc_AIVEHinit;
driver _veh disableAI "MOVE";
_soldiers append units _groupVeh;
_groups pushBack _groupVeh;
[_groupVeh, "Patrol_Area", 25, 100, 250, true, _positionX, false] call A3A_fnc_patrolLoop;
_vehiclesX pushBack _veh;
_AAvehicles pushBack _veh;
sleep 1;
};

Expand Down Expand Up @@ -341,8 +343,12 @@ for "_i" from 0 to (count _array - 1) do {
};
};

["locationSpawned", [_markerX, "Airport", true]] call EFUNC(Events,triggerEvent);
{
driver _x enableAI "MOVE"; // reenable movement for spawned AA vehicles
[_groupVeh, "Patrol_Area", 25, 100, 250, true, _positionX, false] call A3A_fnc_patrolLoop; // start patrol
} forEach _AAvehicles;

["locationSpawned", [_markerX, "Airport", true]] call EFUNC(Events,triggerEvent);

waitUntil {sleep 1; (spawner getVariable _markerX == 2)};

Expand Down
1 change: 1 addition & 0 deletions A3A/addons/core/functions/CREATE/fn_invaderPunish.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ if (({_x call A3A_fnc_canFight} count _soldiers < count _soldiers / 3) or (time
sidesX setVariable [_mrkDest, Invaders, true];
garrison setVariable [_mrkDest, [], true];
[_mrkDest] call A3A_fnc_mrkUpdate;
[] spawn A3A_fnc_checkCampaignEnd; // If a town is destroyed, check for loss
};

sleep 60;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//TODO: add header
_autoSaveInterval = if (autoSave) then {(autoSaveInterval/60) toFixed 0;} else {false};
_autoSaveInterval = "<t color='#f0d498'>" + _autoSaveInterval + "</t>";
private _autoSaveInterval = [false,str (autoSaveInterval/60)] select autoSave;
_autoSaveInterval = "<t color='#f0d498'>" + str _autoSaveInterval + "</t>";

private _saveString = (localize "STR_A3A_fn_dialogs_createDialog_SLPS_line1") + "<br/><br/>";
_saveString = if (autoSave) then { [_saveString,format[localize "STR_A3A_fn_dialogs_createDialog_SLPS_line2", _autoSaveInterval]] joinString "" }
else { [_saveString,localize "STR_A3A_fn_dialogs_createDialog_SLPS_line4"] joinString "" };
else { [_saveString,localize "STR_A3A_fn_dialogs_createDialog_SLPS_line3"] joinString "" };

[localize "STR_A3A_fn_dialogs_createDialog_SLPS_line5", _saveString] call A3A_fnc_customHint;
[localize "STR_A3A_fn_dialogs_createDialog_SLPS_line4", _saveString] call A3A_fnc_customHint;

[true] call A3A_fnc_loadPreviousSession;

Expand Down
4 changes: 2 additions & 2 deletions A3A/addons/core/functions/Intel/fn_selectIntel.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ if (_intelType == "Large") then
};
case (WEAPON):
{
private _notYetUnlocked = allWeapons - unlockedWeapons;
private _newWeapon = selectRandom _notYetUnlocked;
private _notYetUnlocked = allWeapons - unlockedWeapons - allMissileLaunchers; // to prevent guided launchers from being unlocked by large intel
_newWeapon = selectRandom _notYetUnlocked;
[_newWeapon] remoteExec ["A3A_fnc_unlockEquipment", 2];

private _weaponName = getText (configFile >> "CfgWeapons" >> _newWeapon >> "displayName");
Expand Down
15 changes: 12 additions & 3 deletions A3A/addons/core/functions/Missions/fn_AS_Traitor.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ if (random 10 < 2.5) then

{[_x,""] call A3A_fnc_NATOinit} forEach units _groupX;

waitUntil {sleep 1; (traitorIntel) || {(dateToNumber date > _dateLimitNum) or {(not alive _traitor) or {({_traitor knowsAbout _x > 1.4} count ([500,0,_traitor,teamPlayer] call A3A_fnc_distanceUnits) > 0)}}}};
waitUntil {sleep 1;
(traitorIntel) ||
{(dateToNumber date > _dateLimitNum) ||
{(!([_traitor] call A3A_fnc_canFight)) ||
{({_traitor knowsAbout _x > 1.4} count ([500,0,_traitor,teamPlayer] call A3A_fnc_distanceUnits) > 0)}}}};

if ({_traitor knowsAbout _x > 1.4} count ([500,0,_traitor,teamPlayer] call A3A_fnc_distanceUnits) > 0) then
{
Expand All @@ -128,9 +132,14 @@ if ({_traitor knowsAbout _x > 1.4} count ([500,0,_traitor,teamPlayer] call A3A_f
_wp1 setWaypointSpeed "FULL";
};

waitUntil {sleep 1; (traitorIntel) || {(dateToNumber date > _dateLimitNum) or {(not alive _traitor) or {(_traitor distance _posBase < 20)}}}};

if (not alive _traitor || traitorIntel) then
waitUntil {sleep 1;
(traitorIntel) ||
{(dateToNumber date > _dateLimitNum) ||
{(!([_traitor] call A3A_fnc_canFight)) ||
{(_traitor distance _posBase < 20)}}}};

if (!([_traitor] call A3A_fnc_canFight) || traitorIntel) then
{
[_taskId, "AS", "SUCCEEDED", false] call A3A_fnc_taskSetState;
if(traitorIntel && (alive _traitor)) then
Expand Down
6 changes: 2 additions & 4 deletions A3A/addons/core/functions/Missions/fn_LOG_Supplies.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ _pos = (getMarkerPos respawnTeamPlayer) findEmptyPosition [1,50,"C_Van_01_box_F"
_truckX = "Land_FoodSacks_01_cargo_brown_F" createVehicle _pos;
_truckX enableRopeAttach true;
_truckX allowDamage false;
if (A3A_hasACE) then {[_truckX, _truckX] call ace_common_fnc_claim};
[_truckX] call A3A_Logistics_fnc_addLoadAction;
_truckX addAction [localize "STR_A3A_fn_mission_log_supply_addact_del_info",
{
Expand Down Expand Up @@ -112,9 +113,6 @@ else
};
};

_ecpos = getpos _truckX;
deleteVehicle _truckX;
_emptybox = "Land_Pallet_F" createVehicle _ecpos;
[_emptybox] spawn A3A_fnc_postmortem;
deleteVehicle _truckX; // Previously an empty pallet was spawned here, but it has been removed. RIP

[_taskId, "SUPP", 900] spawn A3A_fnc_taskDelete;
24 changes: 6 additions & 18 deletions A3A/addons/core/functions/Missions/fn_REP_Antenna.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ if (spawner getVariable _markerX != 2) then
sleep 2;
};

waitUntil {sleep 1;(dateToNumber date > _dateLimitNum) or (not alive _veh)};
waitUntil {sleep 1;(dateToNumber date > _dateLimitNum) or (not alive _veh) or (sidesX getVariable [_markerX,sideUnknown] == teamPlayer)};

if (not alive _veh) then
if (not alive _veh || {sidesX getVariable [_markerX,sideUnknown] == teamPlayer}) then
{
[_taskId, "REP", "SUCCEEDED"] call A3A_fnc_taskSetState;
[Occupants, 15, 90] remoteExec ["A3A_fnc_addAggression", 2];
Expand All @@ -70,22 +70,10 @@ if (spawner getVariable _markerX != 2) then
};
if (dateToNumber date > _dateLimitNum) then
{
if (sidesX getVariable [_markerX,sideUnknown] == teamPlayer) then
{
[_taskId, "REP", "SUCCEEDED"] call A3A_fnc_taskSetState;
[Occupants, 15, 90] remoteExec ["A3A_fnc_addAggression", 2];
[Invaders, 5, 60] remoteExec ["A3A_fnc_addAggression", 2];
[500, Occupants] remoteExec ["A3A_fnc_timingCA",2];
{if (_x distance _veh < 500) then {[10,_x] call A3A_fnc_playerScoreAdd}} forEach (allPlayers - (entities "HeadlessClient_F"));
[10,theBoss] call A3A_fnc_playerScoreAdd;
}
else
{
[_taskId, "REP", "FAILED"] call A3A_fnc_taskSetState;
//[5,0,_positionX] remoteExec ["A3A_fnc_citySupportChange",2];
[-200, Occupants] remoteExec ["A3A_fnc_timingCA",2];
[-10,theBoss] call A3A_fnc_playerScoreAdd;
};
[_taskId, "REP", "FAILED"] call A3A_fnc_taskSetState;
//[5,0,_positionX] remoteExec ["A3A_fnc_citySupportChange",2];
[-200, Occupants] remoteExec ["A3A_fnc_timingCA",2];
[-10,theBoss] call A3A_fnc_playerScoreAdd;
[_antennaDead] remoteExec ["A3A_fnc_rebuildRadioTower", 2];
};

Expand Down
1 change: 1 addition & 0 deletions A3A/addons/core/functions/Missions/fn_missionRequest.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ switch (_type) do {

case "RES": {
_possibleMarkers = [citiesX] call _findIfNearAndHostile;
_possibleMarkers = _possibleMarkers select {spawner getVariable _x != 0}; // so refugee missions don't get spawned on top of people -- might need to tweak if there arent enough unspawned sites
{
private _spawner = spawner getVariable _x;
if (_spawner != 0) then {_possibleMarkers pushBack _x};
Expand Down
2 changes: 1 addition & 1 deletion A3A/addons/core/functions/OrgPlayers/fn_promotePlayer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ Debug(_textX);
if (_promoted) then
{
_congrats = "<br/><br/>" + localize "STR_A3A_fn_orgp_promotePlayer_yes";
_textX = [_textX] joinString [_congrats];
_textX = [_textX, _congrats] joinString "";
[petros,"hint",_textX, localize "STR_A3A_fn_orgp_promotePlayer_promotion"] remoteExec ["A3A_fnc_commsMP"];
};
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ if (!(_exemption isEqualTo "")) exitWith {
format["NOT FF, %1", _exemption];
};

// Case of FF is confirmed -- attach the name to the client for future
_instigator setVariable ["_lastFriendlyHit", name _victim, 2];

/////////////Acts on Collision//////////////
if (_isCollision) then {
_customMessage = [_customMessage, localize "STR_A3A_fn_punishment_evalEvent_driver"] joinString "<br/>";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@ private _detainee = _varspace getVariable ["player",objNull];
};
if (!isNull _admin) then {
if (_admin isEqualTo _detainee) exitWith { [_UID,"forgive"] call A3A_fnc_punishment_release; }; // The admin cannot use the self forgive scroll-action when attached to the surf-board.
[localize "STR_A3A_fn_punish_ff_noti", [_name," ",localize "STR_A3A_fn_punish_punSenSv_text"] joinString ""] remoteExecCall ["A3A_fnc_customHint",_admin,false];
private _injuredFriendly = _detainee getVariable ["_lastFriendlyHit", false];
private _punishAdminText = if (_injuredFriendly isEqualTo false) then {
format[localize "STR_A3A_fn_punish_punSenSv_text2", _name];
} else {
format[localize "STR_A3A_fn_punish_punSenSv_text1", _name, _injuredFriendly];
};
[localize "STR_A3A_fn_punish_ff_noti", _punishAdminText] remoteExecCall ["A3A_fnc_customHint",_admin,false];
[_UID,[missionNamespace,"A3A_FFPun",_UID,"offenceTotal",0] call A3A_fnc_getNestedObject,_name] remoteExecCall ["A3A_fnc_punishment_addActionForgive",_admin,false];
};
_lastAdmin = _admin;
Expand Down
Loading

0 comments on commit 2f90e16

Please sign in to comment.