use new custom var to track mission state

EPOCH_playerMissionArray
This commit is contained in:
vbawol 2016-06-16 16:53:59 -05:00
parent 7218acaf5a
commit 69e38997ae
8 changed files with 43 additions and 41 deletions

View File

@ -66,13 +66,13 @@ class FSM
"" \n
"//Mission Control - WIP. TODO: Move to serverside mission control UINamespace not secure." \n
"//uiNameSpace setVariable [""axeTask"",_taskName];" \n
"_plyrVar = player getVariable [""SERVER_VARS"",[]];" \n
"_plyrVar = missionNamespace getVariable [""EPOCH_playerMissionArray"",[]];" \n
"_taskIndex = ((_plyrVar apply {_x find ""axeTask"" > -1;}) find true);" \n
"if(_taskIndex > -1)then{" \n
"_plyrVar deleteAt _taskIndex;" \n
"};" \n
"_plyrVar pushBack [""axeTask"",_taskName];" \n
"player setVariable [""SERVER_VARS"",_plyrVar,true];" \n
"missionNamespace setVariable [""EPOCH_playerMissionArray"",_plyrVar];" \n
"" \n
"missionNameSpace setVariable [""axeTask"",_taskName];" \n
"" \n
@ -268,12 +268,12 @@ class FSM
itemno = 6;
init = "//uiNameSpace setVariable [""axeTask"",nil];" \n
"if!(_doBin)then{" \n
"_plyrVar = player getVariable [""SERVER_VARS"",[]];" \n
"_plyrVar = missionNamespace getVariable [""EPOCH_playerMissionArray"",[]];" \n
"_taskIndex = ((_plyrVar apply {_x find ""axeTask"" > -1;}) find true);" \n
"if(_taskIndex > -1)then{" \n
"_plyrVar deleteAt _taskIndex;" \n
"};" \n
"player setVariable [""SERVER_VARS"",_plyrVar,true];" \n
"missionNamespace setVariable [""EPOCH_playerMissionArray"",_plyrVar];" \n
"};" \n
"if(count _missionCleanUp > 0)then{" \n
"{" \n

View File

@ -18,7 +18,7 @@ _hours = floor(servertime/60/60);
_customVars = "";
{
_val = missionNamespace getVariable [format ["EPOCH_player%1",_x],EPOCH_defaultVars select _forEachIndex];
if !(_x in ["AliveTime","SpawnArray","HitPoints"]) then {
if !(_x in ["AliveTime","SpawnArray","HitPoints","MissionArray"]) then {
if (_x == "Temp") then {
_customVars = _customVars + format["<t size='1.15' font='puristaLight' align='left'>%1: </t><t size='1.15' font='puristaLight' align='right'>%2°F | %3°C</t><br/>", _x,_val,_val call EPOCH_convertTemp];
} else {

View File

@ -80,7 +80,7 @@ _menuCondition = getText(getMissionConfig "epochMissions" >> (_missionClasses se
_doTask = (_missionTasks select 0);
_allowTask = true;
//_uiNSTask = uiNameSpace getVariable ["axeTask",""];//TODO: Use hive to store this via dynamic vars. Or server mission control server_vars
_plyrVar = player getVariable ["SERVER_VARS",[]] select {_x find "axeTask" > -1;};
_plyrVar = missionNamespace getVariable ["EPOCH_playerMissionArray",[]] select {_x find "axeTask" > -1;};
_uiNSTask = "";
if(count _plyrVar > 0)then{
_uiNSTask = _plyrVar select 0 select 1;

View File

@ -1,2 +1,2 @@
player setVariable ["SERVER_VARS",[],true];
missionNamespace setVariable ["EPOCH_playerMissionArray",[]];
[format ["<t size='1.6' color='#99ffffff'>%1</t>","Missions Reset - Re-open Trader Menu."], 5] call Epoch_dynamicText;

View File

@ -15,7 +15,7 @@
private ["_lbl","_missionClasses","_missionName","_menuCondition","_toolTip","_plyrVar","_uiNSTask"];
params [["_currentTask",""]];
_missionClasses = getArray(getMissionConfig "EpochMissionList" >> "traderMissionClasses");
_plyrVar = player getVariable ["SERVER_VARS",[]] select {_x find "axeTask" > -1;};
_plyrVar = missionNamespace getVariable ["EPOCH_playerMissionArray",[]] select {_x find "axeTask" > -1;};
_uiNSTask = "";
if(count _plyrVar > 0)then{
_uiNSTask = _plyrVar select 0 select 1;

View File

@ -42,7 +42,8 @@ EPOCH_customVarsDefaults = [
["Karma",0,[50000,-50000]],
["Alcohol",0,[100,0]],
["Radiation",0,[100,0]],
["Nuisance",0,[100,0]]
["Nuisance",0,[100,0]],
["MissionArray",[],[]]
];
_customVarsInit = ["CfgEpochClient", "customVarsDefaults", EPOCH_customVarsDefaults] call EPOCH_fnc_returnConfigEntryV2;
{

View File

@ -53,7 +53,8 @@ class CfgEpochClient
{"Karma",0,{50000,-50000}},
{"Alcohol",0,{100,0}},
{"Radiation",0,{100,0}},
{"Nuisance",0,{100,0}}
{"Nuisance",0,{100,0}},
{"MissionArray",{},{}}
};
// controls max group limit and cost
group_upgrade_lvl[] = {4,"100",6,"300",8,"500",10,"1000",12,"1500",13,"1750",14,"2000",15,"3000",16,"5000"};

View File

@ -62,7 +62,7 @@ Fridge_EPOCH = [[[0,0,1.1],[0,0,-0.1]],[[0,0,1.1],[0,0,2.1]],[[0,0,1.1],[0.5,0,1
Shelf_EPOCH = [[[0,0,1],[0,0,-0.1]],[[0,0,1],[0,0,1.8]],[[0,0,1],[0.5,0,1]],[[0,0,1],[-0.5,0,1]],[[0,0,1],[0,0.2,1]],[[0,0,1],[0,-0.6,1]]];
Couch_EPOCH = [[[0,0,0.4],[0,0,-0.1]],[[0,0,0.4],[0,0,1.2]],[[0,0,0.4],[1.3,0,0.4]],[[0,0,0.4],[-0.3,0,0.4]],[[0,0,0.4],[0,1.4,0.4]],[[0,0,0.4],[0,-1.4,0.4]]];
wardrobe_epoch = [[[0,0,1.3],[0,0,-0.1]],[[0,0,1.3],[0,0,2.3]],[[0,0,1.3],[0.7,0,1.3]],[[0,0,1.3],[-0.7,0,1.3]],[[0,0,1.3],[0,0.4,1.3]],[[0,0,1.3],[0,-0.6,1.3]]];
cooker_epoch = [[[0,0,0],[0,0,-0.7]],[[0,0,0],[0,0,0.7]],[[0,0,0],[0.4,0,0]],[[0,0,0],[-0.4,0,0]],[[0,0,0],[0,0.5,0]],[[0,0,0],[0,-0.7,0]]];
cooker_epoch = [[[0,0,0],[0,0,-0.1]],[[0,0,0],[0,0,0.7]],[[0,0,0],[0.4,0,0]],[[0,0,0],[-0.4,0,0]],[[0,0,0],[0,0.5,0]],[[0,0,0],[0,-0.7,0]]];
Chair_EPOCH = [[[0,0,0.5],[0,0,-0.1]],[[0,0,0.5],[0,0,1.5]],[[0,0,0.6],[0.6,0,0.6]],[[0,0,0.6],[-0.6,0,0.6]],[[0,0,0.6],[0,0.6,0.6]],[[0,0,0.5],[0,-0.6,0.5]]];
Filing_epoch = [[[0,0,0.8],[0,0,-0.1]],[[0,0,0.8],[0,0,1.6]],[[0,0,0.8],[0.3,0,0.8]],[[0,0,0.8],[-0.3,0,0.8]],[[0,0,0.8],[0,0.4,0.8]],[[0,0,0.8],[0,-0.5,0.8]]];
Pelican_EPOCH = [[[0,0,0.2],[0,0,-0.1]],[[0,0,0.2],[0,0,0.7]],[[0,0,0.2],[0.9,0,0.2]],[[0,0,0.2],[-0.9,0,0.2]],[[0,0,0.2],[0,0.6,0.2]],[[0,0,0.2],[0,-0.4,0.2]]];
@ -71,7 +71,7 @@ Locker_EPOCH = [[[0,0,1.1],[0,0,-0.1]],[[0,0,1.1],[0,0,2.1]],[[0,0,1.1],[1,0,1.1
ToolRack_EPOCH = [[[0,0,1.5],[0,0,-0.1]],[[0,0,1.5],[0,0,2.3]],[[0,0,1.5],[1,0,1.5]],[[0,0,1.5],[-0.9,0,1.5]],[[0,0,1.5],[0,0.05,1.5]],[[0,0,1.5],[0,-0.4,1.5]]];
Shoebox_EPOCH = [[[0,0,0.1],[0,0,-0.1]],[[0,0,0.1],[0,0,0.3]],[[0,0,0.1],[0.3,0,0.1]],[[0,0,0.1],[-0.3,0,0.1]],[[0,0,0.1],[0,0.2,0.1]],[[0,0,0.1],[0,-0.2,0.1]]];
Tarp_EPOCH = [[[0,0,0.2],[0,0,-0.1]],[[0,0,0.2],[0,0,1]],[[0,0,0.2],[0.9,0,0.2]],[[0,0,0.2],[-0.9,0,0.2]],[[0,0,0.2],[0,1,0.2]],[[0,0,0.2],[0,-0.9,0.2]]];
Freezer_EPOCH = [[[0,0,0.5],[0,0,-0.2]],[[0,0,0.5],[0,0,1.1]],[[0,0,0.5],[0.7,0,0.5]],[[0,0,0.5],[-0.7,0,0.5]],[[0,0,0.5],[0,0.5,0.5]],[[0,0,0.5],[0,-0.6,0.5]]];
Freezer_EPOCH = [[[0,0,0.5],[0,0,-0.1]],[[0,0,0.5],[0,0,1.1]],[[0,0,0.5],[0.7,0,0.5]],[[0,0,0.5],[-0.7,0,0.5]],[[0,0,0.5],[0,0.5,0.5]],[[0,0,0.5],[0,-0.6,0.5]]];
Cabinet_EPOCH = [[[0,0,0],[0,0,-0.4]],[[0,0,0],[0,0,0.4]],[[0,0,0],[0.2,0,0]],[[0,0,0],[-0.1,0,0]],[[0,0,0],[0,0.3,0]],[[0,0,0],[0,-0.3,0]]];
EPOCH_lootClassesRaw = [