Skip to content

Commit

Permalink
hopefully save radio issues
Browse files Browse the repository at this point in the history
  • Loading branch information
McDiod committed Dec 16, 2018
1 parent 3f735ce commit d4b854e
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 13 deletions.
1 change: 1 addition & 0 deletions functions/missionSetup/cfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class gungame_missionSetup {
class randomizeTeams {};
class randomizeUniforms {};
class removeInitialWeapon {};
class saveRadioInstance {};
class scoreBoard {};
class selectWeapons {};
class setRadioFrequencies {};
Expand Down
4 changes: 2 additions & 2 deletions functions/missionSetup/fn_applyUniform.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ private _teamNamespace = player getVariable [QGVAR(teamNamespace),objNull];
private _uniform = _teamNamespace getVariable [QGVAR(teamUniform),""];
private _isWoodLand = toLower ([missionConfigFile >> "CfgIslands" >> worldName,"isWoodland",1] call BIS_fnc_returnConfigEntry) == "true";
private _vest = ["V_TacVest_khk","V_TacVest_oli"] select _isWoodland;
private _radio = player getVariable [QGVAR(radioInstance),"TFAR_anprc152"];


player setUnitLoadout [[],[],[],[_uniform,[["ACE_fieldDressing",6],["ACE_morphine",4]]],[_vest,[]],[],"","",["Binocular","","","",[],[],""],["ItemMap","ItemGPS","TFAR_anprc152","ItemCompass","ItemWatch",""]];
player setUnitLoadout [[],[],[],[_uniform,[["ACE_fieldDressing",6],["ACE_morphine",4]]],[_vest,[]],[],"","",["Binocular","","","",[],[],""],["ItemMap","ItemGPS",_radio,"ItemCompass","ItemWatch",""]];
1 change: 1 addition & 0 deletions functions/missionSetup/fn_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
};

[] call FUNC(removeInitialWeapon);
[] call FUNC(saveRadioInstance);

player addEventHandler ["Killed", EFUNC(events,onPlayerKilled)];
player addEventHandler ["Respawn", EFUNC(events,onPlayerRespawn)];
Expand Down
10 changes: 1 addition & 9 deletions functions/missionSetup/fn_removeInitialWeapon.sqf
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
#include "component.hpp"

removeAllWeapons player;
removeAllItems player;
removeAllAssignedItems player;
removeVest player;
removeBackpack player;
removeHeadgear player;
removeGoggles player;

player linkItem "ItemGPS";
player setUnitLoadout [[],[],[],["U_Marshal",[]],[],[],"","",[],["ItemMap","ItemGPS","TFAR_anprc152","ItemCompass","ItemWatch",""]];
10 changes: 10 additions & 0 deletions functions/missionSetup/fn_saveRadioInstance.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "component.hpp"

[QGVAR(radiosReceivedEH), "OnRadiosReceived",{
params ["","_args"];
_args params [["_radioClassname","TFAR_anprc152"]];

player setVariable [QGVAR(radioInstance),_radioClassname];
[QGVAR(radiosReceivedEH),"OnRadiosReceived"] call tfar_fnc_removeEventHandler;

},player] call TFAR_fnc_addEventHandler;
63 changes: 61 additions & 2 deletions mission.sqm
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class CustomAttributes
};
class value
{
items=52;
items=53;
class Item0
{
class data
Expand Down Expand Up @@ -841,6 +841,20 @@ class CustomAttributes
value="tfar_givemicrodagrtosoldier";
};
};
class Item52
{
class data
{
class type
{
type[]=
{
"STRING"
};
};
value="tfar_setting_defaultfrequencies_sr_west";
};
};
};
};
};
Expand All @@ -857,7 +871,7 @@ class CustomAttributes
};
class value
{
items=52;
items=53;
class Item0
{
class data
Expand Down Expand Up @@ -3198,6 +3212,51 @@ class CustomAttributes
};
};
};
class Item52
{
class data
{
class type
{
type[]=
{
"ARRAY"
};
};
class value
{
items=2;
class Item0
{
class data
{
class type
{
type[]=
{
"STRING"
};
};
value="100,110,120,130,140,150";
};
};
class Item1
{
class data
{
class type
{
type[]=
{
"SCALAR"
};
};
value=1;
};
};
};
};
};
};
};
};
Expand Down

0 comments on commit d4b854e

Please sign in to comment.