Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Acre integration #346

Open
wants to merge 24 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AntistasiOfficial.Altis/AI/hasRadio.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ private _result = false;
call {
if ("ItemRadio" in assignedItems _unit) exitWith {_result = true};

if (activeACRE) exitWith {_result = _unit call acre_api_fnc_hasRadio};

if (activeTFAR) exitWith {
if (count (_unit call TFAR_fnc_radiosList) > 0) then {
_result = true;
Expand Down
5 changes: 5 additions & 0 deletions AntistasiOfficial.Altis/Functions/fn_detectACRE.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
activeACRE = false;

if (isClass (configFile >> "CfgPatches" >> "acre_main")) then {
activeACRE = true;
};
1 change: 1 addition & 0 deletions AntistasiOfficial.Altis/Functions/functionList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class AS {
class initialiseFIAUnit {};
class initialiseFIAGarrisonUnit {};
class detectTFAR {};
class detectACRE {};
class spawnBunker {};
class respawnRoadblock {};
class createPatrolMarker {};
Expand Down
12 changes: 11 additions & 1 deletion AntistasiOfficial.Altis/JeroenArsenal/JNA/fn_arsenal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,11 @@ switch _mode do {
_radioName = getText(configfile >> "CfgWeapons" >> _return1 >> "tf_parent");
if!(_radioName isEqualTo "")then{_return1 = _radioName;};

// ACRE get base class
if ([_return1] call acre_api_fnc_isRadio) then {
_return1 = [_return1] call acre_api_fnc_getBaseRadio;
};

_return1;
};
case IDC_RSCDISPLAYARSENAL_TAB_MAP;
Expand Down Expand Up @@ -1682,13 +1687,18 @@ switch _mode do {
};
}foreach assignedItems player;

//TFAR FIX
_OldItemUnequal = _oldItem;
if(_index == IDC_RSCDISPLAYARSENAL_TAB_COMPASS)then{
//TFAR FIX
_radioName = getText(configfile >> "CfgWeapons" >> _oldItem >> "tf_parent");
if!(_radioName isEqualTo "")exitWith{
_OldItemUnequal = _radioName;
};

// ACRE get base class
if ([_oldItem] call acre_api_fnc_isRadio) then {
_OldItemUnequal = [_oldItem] call acre_api_fnc_getBaseRadio;
};
};

if (_oldItem != _item) then {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ if(typeName (_this select 0) isEqualTo "SCALAR")then{//[_index, _item] and [_ind
private _radioName = getText(configfile >> "CfgWeapons" >> _item >> "tf_parent");
if!(_radioName isEqualTo "")then{_item = _radioName};

// ACRE get base class
if ([_item] call acre_api_fnc_isRadio) then {
_item = [_item] call acre_api_fnc_getBaseRadio;
};


//update
private _playersInArsenal = +(server getVariable ["jna_playersInArsenal",[]]);
if!(0 in _playersInArsenal)then{_playersInArsenal pushBackUnique 2;};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ _return = -1;
private ["_weaponType","_weaponTypeCategory"];
_weaponType = (_item call bis_fnc_itemType);
_weaponTypeCategory = _weaponType select 0;
private _configCfgWeapons = configFile >> "CfgWeapons";

private ["_weaponTypeSpecific"];
_weaponTypeSpecific = _weaponType select 1;
Expand All @@ -68,6 +69,12 @@ if (activeACE) then {
if (_item in aceItems) then {_weaponTypeSpecific = "FirstAidKit"};
};
};

if (activeACRE) then {
if (_item isKindOf ["CBA_MiscItem", (_configCfgWeapons)]) then {
_weaponTypeSpecific = "FirstAidKit";
};
};
INITTYPES

{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ _assignedItems = ((_inventory select 9) + [_inventory select 3] + [_inventory se
_item =_radioName;
};

// ACRE get base class
if ([_item] call acre_api_fnc_isRadio) then {
_item = [_item] call acre_api_fnc_getBaseRadio;
};

call {
if ([_itemCounts select _index, _item] call jn_fnc_arsenal_itemCount == -1) exitWith {
player linkItem _item;
Expand Down
18 changes: 14 additions & 4 deletions AntistasiOfficial.Altis/Municion/accionArsenal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,22 @@ if (activeTFAR) then {
} forEach ((items _unit) + (assignedItems _unit) - (weapons _unit));
}
else {
{
if (!(_x in unlockedItems)) then {
_items pushBack _x;
if (activeACRE) then {
if (!(_x in unlockedItems)) then {
if !([_x] call acre_api_fnc_isRadio) then {
_items pushBack _x;
};
};
} forEach ((items _unit) + (assignedItems _unit) - (weapons _unit));
}
else
{
{
if (!(_x in unlockedItems)) then {
_items pushBack _x;
};
} forEach ((items _unit) + (assignedItems _unit) - (weapons _unit));
};
};

{
_ameter = false;
Expand Down
2 changes: 2 additions & 0 deletions AntistasiOfficial.Altis/initVar.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ if !(isnil "XLA_fnc_addVirtualItemCargo") then {
};

[] call AS_fnc_detectTFAR;
[] call AS_fnc_detectACRE;

FIA_texturedVehicles = [];
FIA_texturedVehicleConfigs = [];
Expand Down Expand Up @@ -225,6 +226,7 @@ publicVariable "membersPool";
publicVariable "vehInGarage";
publicVariable "reportedVehs";
publicVariable "activeACE";
publicVariable "activeACRE";
publicVariable "activeTFAR";
publicVariable "activeXLA";
publicVariable "activeACEhearing";
Expand Down
2 changes: 1 addition & 1 deletion AntistasiOfficial.Altis/onPlayerRespawn.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ removeAllItemsWithMagazines _newUnit;
removeBackpackGlobal _newUnit;
removeVest _newUnit;
//if (!("ItemGPS" in unlockedItems) AND ("ItemGPS" in (assignedItems _newUnit))) then {_newUnit unlinkItem "ItemGPS"}; Stef disabled because no unlock and giving an annoying error message clientside sometime
if ((!activeTFAR) AND ("ItemRadio" in (assignedItems player)) AND !("ItemRadio" in unlockedItems)) then {player unlinkItem "ItemRadio"};
if (!(activeTFAR OR activeACRE) AND ("ItemRadio" in (assignedItems player)) AND !("ItemRadio" in unlockedItems)) then {player unlinkItem "ItemRadio"};
if (!isPlayer (leader group player)) then {(group player) selectLeader player};

call AS_fnc_initPlayerEH;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ We're looking for more coders, every contribution is appreciated!
# Mods

The mission has no dependencies, however it can detect the following mods.
* **CBA**, **TFAR**, RHS-**AFRF**+**GREF**(replace AAF, CSAT), RHS-**USAF**(replace NATO), **ACE**, **inidibi2**(multiple saves).
* **CBA**, **ACRE**, **TFAR**, RHS-**AFRF**+**GREF**(replace AAF, CSAT), RHS-**USAF**(replace NATO), **ACE**, **inidibi2**(multiple saves).

Client side mods, as long they don't affect AI, are generally ok. Here's some suggestions
* Dusty retexture project, JSRS, Enhanced Movement, Blastcore
Expand Down