Skip to content

Commit

Permalink
Merge pull request #17 from MoskitoSantana/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
MoskitoSantana authored Nov 24, 2024
2 parents 7453dd8 + 7ba2f97 commit 70a99c4
Show file tree
Hide file tree
Showing 17 changed files with 295 additions and 207 deletions.
Binary file modified .hemtt/missions/TrainingField.VR/mission.sqm
Binary file not shown.
Binary file added .hemtt/missions/~trainingfield.vr/mission.sqm
Binary file not shown.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
# Moskito Santana Advanced WWII

[![HEMTT](https://github.com/MoskitoSantana/Moskito-Advanced-WWII/actions/workflows/hemtt.yml/badge.svg)](https://github.com/MoskitoSantana/Moskito-Advanced-WWII/actions/workflows/hemtt.yml)

## Description
This mod was developed to add gameplay dynamics, setting, etc. to Arma 3 roles for the Batallion 95 (BTN 95) playstyle, making the process of equipping Arma 3 barbies easier, mainly during mission creation. But it can be used and adapted to any playstyle of your clan.

# Required Mods

- [CBA_A3](https://github.com/CBATeam/CBA_A3)
- [ACE3](https://github.com/acemod/ACE3)
- [IFA](https://steamcommunity.com/workshop/filedetails/?id=2648308937)
- [TFAR](https://github.com/michail-nikolaev/task-force-arma-3-radio/)
- [WW2 Phones](https://steamcommunity.com/sharedfiles/filedetails/?id=2423977008)
1 change: 0 additions & 1 deletion addons/main/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class CfgPatches {
requiredAddons[] = {
"cba_main",
"ace_main",
//"simc_uaf_44"
};
author = "Moskito Santana";
VERSION_CONFIG;
Expand Down
10 changes: 2 additions & 8 deletions addons/main/script_macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,8 @@
#define CHECK_IF_IS_ACE_ENGINEER(unit) GETVAR((unit),ace_isEngineer,0)
#define CHECK_IF_IS_ACE_MEDIC(unit) GETVAR((unit),ace_medical_medicclass,0)

#define SET_AS_ACE_EOD_IF(unit,condition) SETPVAR((unit),ACE_isEOD,(condition))
#define SET_AS_ACE_ENGINEER_IF(unit,condition) SETPVAR((unit),ace_isEngineer,(condition))
#define SET_AS_ACE_MEDIC_IF(unit,condition) SETPVAR((unit),ace_medical_medicclass,(condition))

#define SET_VANILLA_TRAIT_IF(unit,trait,value) (unit) setUnitTrait [ #trait , (value) ]

#define IS_ROLE(unitclass,role) if (unitclass == role) then [{1},{0}]
#define IS_ROLE_BOOL(unitclass,role) if (unitclass == role) then [{true},{false}]
#define IS_ROLE(unitclass,role) if ((unitclass == role)) then [{1},{0}]
#define IS_ROLE_BOOL(unitclass,role) if ((unitclass == role)) then [{true},{false}]

#define IS_ROLE_VAR(unit,role,target) if (GETVAR((unit),current_player_description,(role)) == (target)) then [{true},{false}]

Expand Down
54 changes: 27 additions & 27 deletions addons/ww2_modules/cfg/Cfg3DEN.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,68 +4,68 @@ class Cfg3DEN {
class Object {
class AttributeCategories {
class current_role_description {
displayName = "MAWII Role Selection";
displayName = "$STR_MAWII_ww2_modules_MawiiRoleSelectionAttrSectionClassDisplayName";
collapsed = 0;
class Attributes {
class CustomRole {
displayName = "Set Custom Role";
displayName = "$STR_MAWII_ww2_modules_ClassAttributeSetRole";
tooltip = "Assign Custom Role To the Unit";
property = "PlayerRoleSelection";
control = "Combo";
expression = "_this setVariable [ 'current_player_description', _value, true]; systemChat format ['%1 role is %2 stored in variable %3', _this, _value, 'current_player_description'];";
defaultValue = ROLE_RIFLEMAN;
defaultValue = "$STR_MAWII_ww2_modules_RoleRifleman";
unique = 0;
validate = "variable";
validate = "none";
condition = "objectControllable";
typeName = "STRING";
class Values {
class C_ASSAULT_RIFFLEMAN {
name = DISPLAY_ROLE_NAME_ASSAULT_RIFLEMAN;
value = ROLE_ASSAULT_RIFLEMAN;
name = "$STR_MAWII_ww2_modules_RoleAssaultRifleman";
value = "$STR_MAWII_ww2_modules_RoleAssaultRifleman";
};
class C_AT {
name = DISPLAY_ROLE_NAME_AT_SPECIALIST;
value = ROLE_AT_SPECIALIST;
name = "$STR_MAWII_ww2_modules_RoleATSpecialist";
value = "$STR_MAWII_ww2_modules_RoleATSpecialist";
};
class C_FIRST_CLASS_MACHINNE_GUNNER {
name = DISPLAY_ROLE_NAME_FIRST_CLASS_MACHINNE_GUNNER;
value = ROLE_FIRST_CLASS_MACHINNE_GUNNER;
name = "$STR_MAWII_ww2_modules_RoleFirstClassMachinneGunner";
value = "$STR_MAWII_ww2_modules_RoleFirstClassMachinneGunner";
};
class C_MACHINNE_GUNNER {
name = DISPLAY_ROLE_NAME_MACHINNE_GUNNER;
value = ROLE_MACHINNE_GUNNER;
name = "$STR_MAWII_ww2_modules_RoleMachineGunner";
value = "$STR_MAWII_ww2_modules_RoleMachineGunner";
};
class C_PILOT {
name = DISPLAY_ROLE_NAME_PILOT;
value = ROLE_PILOT;
name = "$STR_MAWII_ww2_modules_RolePilot";
value = "$STR_MAWII_ww2_modules_RolePilot";
};
class C_RIFLEMAN {
name = DISPLAY_ROLE_NAME_RIFLEMAN;
value = ROLE_RIFLEMAN;
name = "$STR_MAWII_ww2_modules_RoleRifleman";
value = "$STR_MAWII_ww2_modules_RoleRifleman";
};
class C_SAPPER {
name = DISPLAY_ROLE_NAME_SAPPER;
value = ROLE_SAPPER;
name = "$STR_MAWII_ww2_modules_RoleSapper";
value = "$STR_MAWII_ww2_modules_RoleSapper";
};
class C_SNIPER {
name = DISPLAY_ROLE_NAME_SNIPPER;
value = ROLE_SNIPPER;
name = "$STR_MAWII_ww2_modules_RoleSniper";
value = "$STR_MAWII_ww2_modules_RoleSniper";
};
class C_SQUAD_LEADER {
name = DISPLAY_ROLE_NAME_SQUAD_LEADER;
value = ROLE_SQUAD_LEADER;
name = "$STR_MAWII_ww2_modules_RoleSquadLeader";
value = "$STR_MAWII_ww2_modules_RoleSquadLeader";
};
class C_TANK_CREW {
name = DISPLAY_ROLE_NAME_TANK_CREW;
name = "$STR_MAWII_ww2_modules_RoleTankCrew";
value = ROLE_TANK_CREW;
};
class C_RTO {
name = DISPLAY_ROLE_NAME_RTO;
value = ROLE_RTO;
name = "$STR_MAWII_ww2_modules_RoleRTO";
value = "$STR_MAWII_ww2_modules_RoleTankCrew";
};
class C_MEDIC {
name = DISPLAY_ROLE_NAME_MEDIC;
value = ROLE_MEDIC;
name = "$STR_MAWII_ww2_modules_RoleMedic";
value = "$STR_MAWII_ww2_modules_RoleMedic";
};

};
Expand Down
2 changes: 1 addition & 1 deletion addons/ww2_modules/cfg/CfgFactionClasses.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CfgFactionClasses {
class MAWII {
displayName = "MAWII WW2 Modules"; // Todo: Localize String
displayName = "MAWII WW2"; // Todo: Localize String
side = 7;
};
};
37 changes: 28 additions & 9 deletions addons/ww2_modules/functions/fnc_addRoleActionOnSyncObject.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,48 @@
params [
["_object", objNull],
["_faction", WEAPON_FACTION_USA],
["_roleClass", ROLE_RIFLEMAN]
["_roleClass", (localize "STR_MAWII_ww2_modules_RoleSapper")]
];

// [player] call ace_common_fnc_isMedic
// [player] call ace_common_fnc_isEngineer
// [player] call ace_common_fnc_isEOD

//Ace-Medic: this setVariable ["ace_medical_medicClass",1,true];
//Ace-Doctor: this setVariable ["ace_medical_medicClass",2,true];
//Ace-EODler: this setVariable ["ACE_isEOD",1,true];
//Ace-Repairman: this setVariable ["ACE_IsEngineer",1,true];
//Ace-Repairpoint: this setVariable ["ACE_isRepairVehicle",1,true];
//Ace-Repairfacility: this setVariable ["ACE_isRepairFacility",1,true];

_statement = {
params ["_target","_player","_roleClass"];

private _unitClass = _roleClass select 0;
private _faction = _roleClass select 1;

SET_AS_ACE_EOD_IF(_player,IS_ROLE(_unitClass,ROLE_SAPPER));
SET_AS_ACE_MEDIC_IF(_player,IS_ROLE(_unitClass,ROLE_MEDIC));
SET_AS_ACE_ENGINEER_IF(_player,IS_ROLE(_unitClass,ROLE_SAPPER));

SET_VANILLA_TRAIT_IF(_player,Medic,IS_ROLE_BOOL(_unitClass,ROLE_MEDIC));
SET_VANILLA_TRAIT_IF(_player,engineer, IS_ROLE_BOOL(_unitClass,ROLE_SAPPER));
SET_VANILLA_TRAIT_IF(_player,explosiveSpecialist, IS_ROLE_BOOL(_unitClass,ROLE_SAPPER));
private _ifSapper = (localize "STR_MAWII_ww2_modules_RoleSapper");
private _ifPilot = (localize "STR_MAWII_ww2_modules_RolePilot");
private _ifTankCrew = (localize "STR_MAWII_ww2_modules_RoleTankCrew");
private _ifMedic = (localize "STR_MAWII_ww2_modules_RoleMedic");

if (_unitClass in [_ifSapper,_ifTankCrew,_ifPilot]) then {
_player setVariable ["ACE_IsEngineer",1,true];
_player setUnitTrait ["engineer ", true];
};
if (_unitClass in [_ifMedic]) then {
_player setVariable ["ace_medical_medicClass",1,true];
_player setUnitTrait ["Medic", true];
};
if (_unitClass in [_ifSapper]) then {
_player setVariable ["ACE_isEOD",1,true];
};

_player setVariable ["current_player_description", _unitClass, clientOwner];

[_player, _faction ] call FUNC(setUnitGear);
};

_setObjectAction = [format [ "Armar %1", _roleClass splitString "_" joinString " "], format ["Armar %1 ", _roleClass splitString "_" joinString " "], "", _statement, {true}, {}, [_roleClass, _faction]] call ace_interact_menu_fnc_createAction;
_setObjectAction = [format [ (localize "STR_MAWII_ww2_modules_ActionEquip"), _roleClass splitString "_" joinString " "], format [(localize "STR_MAWII_ww2_modules_ActionEquip"), _roleClass splitString "_" joinString " "], "", _statement, {true}, {}, [_roleClass, _faction]] call ace_interact_menu_fnc_createAction;

[_object, 0, ["ACE_MainActions"], _setObjectAction, true] call ACE_interact_menu_fnc_addActionToObject;
35 changes: 23 additions & 12 deletions addons/ww2_modules/functions/fnc_addRoleOnStartup.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,32 @@
params [
["_unit", objNull],
["_faction", WEAPON_FACTION_USA],
["_roleClass", ROLE_RIFLEMAN]
["_roleClass", localize "STR_MAWII_ww2_modules_RoleRifleman"]
];


private _unitClass = _unit getVariable ["current_player_description", (localize "STR_MAWII_ww2_modules_RoleRifleman")];
private _ifSapper = (localize "STR_MAWII_ww2_modules_RoleSapper");
private _ifPilot = (localize "STR_MAWII_ww2_modules_RolePilot");
private _ifTankCrew = (localize "STR_MAWII_ww2_modules_RoleTankCrew");
private _ifMedic = (localize "STR_MAWII_ww2_modules_RoleMedic");

SET_AS_ACE_EOD_IF(_unit,IS_ROLE(_roleClass,ROLE_SAPPER));
SET_AS_ACE_MEDIC_IF(_unit,IS_ROLE(_roleClass,ROLE_MEDIC));
SET_AS_ACE_ENGINEER_IF(_unit,IS_ROLE(_roleClass,ROLE_PILOT));
SET_AS_ACE_ENGINEER_IF(_unit,IS_ROLE(_roleClass,ROLE_SAPPER));
SET_AS_ACE_ENGINEER_IF(_unit,IS_ROLE(_roleClass,ROLE_TANK_CREW));
if (_unitClass in [_ifSapper,_ifTankCrew,_ifPilot]) then {
_unit setVariable ["ACE_IsEngineer",1,true];
_unit setUnitTrait ["engineer ", true];
};
if (_unitClass in [_ifMedic]) then {
_unit setVariable ["ace_medical_medicClass",1,true];
_unit setUnitTrait ["Medic", true];
_unit setUnitTrait ["loadCoef", 0.4];
};
if (_unitClass in [_ifSapper]) then {
_unit setVariable ["ACE_isEOD",1,true];
_unit setUnitTrait ["explosiveSpecialist ", true];
};

SET_VANILLA_TRAIT_IF(_unit,Medic,IS_ROLE_BOOL(_roleClass,ROLE_MEDIC));
SET_VANILLA_TRAIT_IF(_unit,engineer,IS_ROLE_BOOL(_roleClass,ROLE_PILOT));
SET_VANILLA_TRAIT_IF(_unit,engineer,IS_ROLE_BOOL(_roleClass,ROLE_SAPPER));
SET_VANILLA_TRAIT_IF(_unit,engineer,IS_ROLE_BOOL(_roleClass,ROLE_TANK_CREW));
SET_VANILLA_TRAIT_IF(_unit,explosiveSpecialist,IS_ROLE_BOOL(_roleClass,ROLE_SAPPER));
if (_unitClass in [_ifSapper,(localize "STR_MAWII_ww2_modules_RoleATSpecialist"),(localize "STR_MAWII_ww2_modules_RoleMachineGunner"),(localize "STR_MAWII_ww2_modules_RoleAssaultRifleman"),(localize "STR_MAWII_ww2_modules_RoleRTO")]) then {
_unit setUnitTrait ["loadCoef", 0.3];
};

SETPVAR(_unit,current_player_description,_roleClass);
//_unit setVariable ["current_player_description", _roleClass, clientOwner];
Expand Down
Loading

0 comments on commit 70a99c4

Please sign in to comment.