Skip to content

Commit

Permalink
Working identity translation and initial definitions. CombinedArmsGam…
Browse files Browse the repository at this point in the history
…ing#2 90%  complete.

Resolves CombinedArmsGaming#3 resolves CombinedArmsGaming#4 resolves CombinedArmsGaming#5 resolves CombinedArmsGaming#6

Still need to handle if no identity is assigned and do MP test.
  • Loading branch information
dgibso29 committed Dec 2, 2020
1 parent 47e7a02 commit ad3e080
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 71 deletions.
42 changes: 16 additions & 26 deletions components/identity/fn_applyIdentity.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,33 @@

params ["_unit"];

DEBUG_FORMAT2_LOG("[IDENTITY]: Attempting to apply identity.")
//DEBUG_FORMAT2_LOG("[IDENTITY]: Attempting to apply identity.")


// if (isPlayer _unit) exitWith {};
if (isPlayer _unit) exitWith {};

// // ====================================================================================
// ====================================================================================


// _faction = toLower (faction _unit);
_faction = toLower (faction _unit);

// if (count _this > 2) then
// {
// _faction = toLower (_this select 2);
// };
if (count _this > 2) then
{
_faction = toLower (_this select 2);
};


// DEBUG_FORMAT2_LOG("[IDENTITY]: Attempting to apply identity for faction '%1'.",_faction);
DEBUG_FORMAT2_LOG("[IDENTITY]: Attempting to apply identity for faction '%1'.",_faction)


// // ====================================================================================
_sideName = [_faction] call f_fnc_factionToSideName;
_identity = GET_FACTION_IDENTITY(_sideName);

// _unit setVariable ["f_var_identity_Faction", _faction, true];
_unit setVariable ["f_var_identity", _identity, true];

// // ====================================================================================

// _identityVariant = [_faction] call f_fnc_factionToIdentityVariant;
// _identityVariant = "limey";
// if (_gearVariant == "") exitWith
// {
// DEBUG_FORMAT2_LOG("[IDENTITY]: Exited early because faction variant could not be resolved (Unit %1, Faction %2)",(str _unit),_faction);
// };
_speaker = selectRandom (missionNamespace getVariable "f_identities_" + _identity + "_speakers");
_face = selectRandom (missionNamespace getVariable "f_identities_" + _identity + "_faces");

// //_identity = IDENTITY_VAR(_identityVariant);


// _speaker = selectRandom SPEAKERS(_identityVariant);
// _face = selectRandom FACES(_identityVariant);

// _unit setSpeaker _speaker;
// _unit setFace _face;
_unit setSpeaker _speaker;
_unit setFace _face;
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@

params ["_faction"];

_identityVariant = _faction;
_identity = _faction;


if (_faction in ["blu_f", "blu_t_f", "blu_ctrg_f", "blu_gen_f"]) then
{
_identityVariant = "blufor";
_identity = "blufor";
};

if (_faction in ["opf_f", "opf_t_f"]) then
{
_identityVariant = "limey";
_identity = "opfor";
};

if (_faction in ["ind_f", "ind_c_f"]) then
{
_identityVariant = "indfor";
_identity = "indfor";
};

if (_faction in ["blu_g_f","opf_g_f","ind_g_f"]) then
{
_identityVariant = "guerrilla";
_identity = "guerrilla";
};

if (_faction in ["civ_f","civ_idap_f"]) then
{
_identityVariant = "civilian";
_identity = "civilian";
};


_identityVariant
_identity
2 changes: 1 addition & 1 deletion components/identity/functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ class identity
{
file = "components\identity";
class applyIdentity{};
class factionToIdentityVariant{};
class factionToSideName{};
};
8 changes: 8 additions & 0 deletions configuration/identities/identityAssignment.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

BEGIN_IDENTITY_ASSIGNMENT;

SET_FACTION_IDENTITY(opfor,brit);
SET_FACTION_IDENTITY(blufor,yank);
SET_FACTION_IDENTITY(indfor,greek);
SET_FACTION_IDENTITY(guerilla,monke);
SET_FACTION_IDENTITY(civilian,coward);
42 changes: 17 additions & 25 deletions configuration/identities/identityGroups.sqf
Original file line number Diff line number Diff line change
@@ -1,40 +1,32 @@

BEGIN_IDENTITIES;


// // Cor, it's the Empire, innit?
_speakers = ["male05engb","male04engb","male03engb","male02engb","male01engb"];
_faces = ["WhiteHead_27","WhiteHead_07","WhiteHead_18","WhiteHead_21","WhiteHead_13"];

CREATE_IDENTITY(brit,_speakers,_faces);

CREATE_IDENTITY(east, _speakers, _faces);
// SPEAKERS(_speakers)
// //FACES(_faces)


// // FREEDOM MOTHERFUCKER, DO YOU SPEAK IT?
// _speakers = ["male05engb","male04engb","male03engb","male02engb","male01engb"];
// _faces = ["WhiteHead_27","WhiteHead_07","WhiteHead_18","WhiteHead_21","WhiteHead_13"];

// CREATE_IDENTITY(west,_speakers,_faces);


// // FREEDOM MOTHERFUCKER (pretend they are different for this example)
// _speakers = ["male05engb","male04engb","male03engb","male02engb","male01engb"];
// _faces = ["WhiteHead_27","WhiteHead_07","WhiteHead_18","WhiteHead_21","WhiteHead_13"];
// FREEDOM MOTHERFUCKER, DO YOU SPEAK IT?
_speakers = ["male05engb","male04engb","male03engb","male02engb","male01engb"];
_faces = ["WhiteHead_27","WhiteHead_07","WhiteHead_18","WhiteHead_21","WhiteHead_13"];

CREATE_IDENTITY(yank,_speakers,_faces);

// CREATE_IDENTITY(independent,_speakers,_faces);
// Greek joke
_speakers = ["male05engb","male04engb","male03engb","male02engb","male01engb"];
_faces = ["WhiteHead_27","WhiteHead_07","WhiteHead_18","WhiteHead_21","WhiteHead_13"];

// // FREEDOM MOTHERFUCKER (pretend they are different for this example)
// _speakers = ["male05engb","male04engb","male03engb","male02engb","male01engb"];
// _faces = ["WhiteHead_27","WhiteHead_07","WhiteHead_18","WhiteHead_21","WhiteHead_13"];
CREATE_IDENTITY(greek,_speakers,_faces);

// Gorilla joke
_speakers = ["male05engb","male04engb","male03engb","male02engb","male01engb"];
_faces = ["WhiteHead_27","WhiteHead_07","WhiteHead_18","WhiteHead_21","WhiteHead_13"];

// CREATE_IDENTITY(resistance,_speakers,_faces);
CREATE_IDENTITY(monke,_speakers,_faces);

// // FREEDOM MOTHERFUCKER (pretend they are different for this example)
// _speakers = ["male05engb","male04engb","male03engb","male02engb","male01engb"];
// _faces = ["WhiteHead_27","WhiteHead_07","WhiteHead_18","WhiteHead_21","WhiteHead_13"];
// War crime joke
_speakers = ["male05engb","male04engb","male03engb","male02engb","male01engb"];
_faces = ["WhiteHead_27","WhiteHead_07","WhiteHead_18","WhiteHead_21","WhiteHead_13"];

// CREATE_IDENTITY(civilian,_speakers,_faces);
CREATE_IDENTITY(coward,_speakers,_faces);
1 change: 1 addition & 0 deletions configuration/identityTranslation.sqf
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

#include "identities\identityGroups.sqf"
#include "identities\identityAssignment.sqf"
16 changes: 8 additions & 8 deletions identity_macros.hpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@

#define BEGIN_IDENTITIES f_identities_registry = []
#define BEGIN_IDENTITY_ASSIGNMENT f_identity_assignment = []

#define ADD_IDENTITY_TO_REGISTRY(NAME) f_identities_registry pushBack #NAME

#define IDENTITY_VAR(NAME) CONCAT(f_identities_,NAME)
#define SET_FACTION_IDENTITY(FACTION,IDENTITY) f_identity_assignment pushBack [#FACTION,#IDENTITY]
#define GET_FACTION_IDENTITY(FACTION) f_identity_assignment select { (_x select 0) == FACTION} select 0 select 1

#define IDENTITY_VAR(NAME) CONCAT(f_identities_,NAME)

#define SPEAKERS(NAME) CONCAT(IDENTITY_VAR(NAME),_speakers)


#define FACES(NAME) CONCAT(IDENTITY_VAR(NAME),_faces)

#define CREATE_IDENTITY(NAME, SPEAKERS, FACES)\
#define CREATE_IDENTITY(NAME,SPEAKERARRAY,FACEARRAY)\
IDENTITY_VAR(NAME) = [];\
SPEAKERS(NAME) = [];\
FACES(NAME) = [];\
SPEAKERS(NAME) = SPEAKERARRAY;\
FACES(NAME) = FACEARRAY;\
ADD_IDENTITY_TO_REGISTRY(NAME)

//#define SET_SIDE_IDENTITY(SIDE, IDENTITY)
8 changes: 4 additions & 4 deletions mission.sqm
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ class EditorData
};
class Camera
{
pos[]={295.43375,161.53435,-50.229725};
dir[]={-0.34015206,-0.52957058,0.77719653};
up[]={-0.21236162,0.84819537,0.48521584};
aside[]={0.91619205,3.2945536e-007,0.40098691};
pos[]={311.25192,197.2216,-52.118324};
dir[]={-0.56852293,-0.82156461,0.045011658};
up[]={-0.81902754,0.57005495,0.064845473};
aside[]={0.078934856,-4.2143802e-007,0.99699628};
};
};
binarizationWanted=0;
Expand Down

0 comments on commit ad3e080

Please sign in to comment.