added disallowed events per worldName

bunker test code updates
This commit is contained in:
vbawol 2017-09-17 12:11:40 -05:00
parent f9fb1d69f1
commit acfba073fc
5 changed files with 27 additions and 14 deletions

View File

@ -12,15 +12,15 @@ lootMultiplier = 0.5; // 1 = max loot bias. This controls how much loot can payo
// Events // Events
WeatherStaticForecast[] = {}; // Default: {75.5,0,{0,0,0},0,{1,1}}; // Clear day; {19,1,{1,1,40},1,{5,5}}; // Cold Foggy Rainy Overcast Windy; Format: {temp <scalar>,rain <scalar>,fog <array>,overcast <scalar>,wind <array>} WeatherStaticForecast[] = {}; // Default: {75.5,0,{0,0,0},0,{1,1}}; // Clear day; {19,1,{1,1,40},1,{5,5}}; // Cold Foggy Rainy Overcast Windy; Format: {temp <scalar>,rain <scalar>,fog <array>,overcast <scalar>,wind <array>}
events[] = { events[] = {
{ 3600, "CarnivalSpawner", 0 , 1}, // SECOND <scalar>, EVENT <string>, INIT <scalar> 1 = run script at startup or 0 normal delay, PREPOSTFIX <scalar> 1 = use pre/postfix path (inside epoch settings pbo) 0 = use full file path { 3600, "CarnivalSpawner", 0 , 1, -1, {"VR"}}, // SECOND <scalar>, EVENT <string>, INIT <scalar> 1 = run script at startup or 0 normal delay, PREPOSTFIX <scalar> 1 = use pre/postfix path (inside epoch settings pbo) 0 = use full file path
// { 1800, "PaydayEvent", 0, 1}, // { 1800, "PaydayEvent", 0, 1},
// { 1200, "MessageServer", 0, 1}, // { 1200, "MessageServer", 0, 1},
{ 2700, "AirDrop", 0 , 1}, { 2700, "AirDrop", 0 , 1, -1, {"VR"}},
{ 2400, "EarthQuake", 0 , 1}, { 2400, "EarthQuake", 0 , 1, -1, {"VR"}},
{ 2700, "Satellite", 0 , 1}, { 2700, "Satellite", 0 , 1, -1, {"VR"}},
{ 900, "ChangeWeather", 1 , 1}, { 900, "ChangeWeather", 1 , 1, -1, {"VR"}},
{ 1200, "ContainerSpawner", 0 , 1}, { 1200, "ContainerSpawner", 0 , 1, -1, {"VR"}},
{ 300, "PlantSpawner", 0 , 1} //No comma on last Entry { 300, "PlantSpawner", 0 , 1 , -1, {"VR"}} //No comma on last Entry
}; };
// Antagonists // Antagonists

View File

@ -31,7 +31,7 @@ link15[] = {8,2};
link16[] = {9,2}; link16[] = {9,2};
link17[] = {10,2}; link17[] = {10,2};
globals[] = {0.000000,0,0,0,0,640,480,1,3,6316128,1,275.180084,1161.319580,208.497711,-659.879456,898,884,1}; globals[] = {0.000000,0,0,0,0,640,480,1,3,6316128,1,275.180084,1161.319580,208.497711,-659.879456,898,884,1};
window[] = {2,-1,-1,-1,-1,786,26,1318,26,3,916}; window[] = {2,-1,-1,-32000,-32000,994,234,1526,234,3,916};
*//*%FSM</HEAD>*/ *//*%FSM</HEAD>*/
class FSM class FSM
{ {
@ -58,7 +58,7 @@ class FSM
"// Load Epoch Events 3.0" \n "// Load Epoch Events 3.0" \n
"{" \n "{" \n
" diag_log format[""Loading Settings for %1 event..."",configName _x];" \n " diag_log format[""Loading Settings for %1 event..."",configName _x];" \n
" _events pushBack [getNumber (_x >> ""delay""),getText (_x >> ""script""),getNumber (_x >> ""runOnStart""),getNumber (_x >> ""usePrefix""),getNumber (_x >> ""runNumTimes"")];" \n " _events pushBack [getNumber (_x >> ""delay""),getText (_x >> ""script""),getNumber (_x >> ""runOnStart""),getNumber (_x >> ""usePrefix""),getNumber (_x >> ""runNumTimes""),getArray (_x >> ""disallowedWorlds"")];" \n
"} forEach (""isClass _x"" configClasses (configFile >> ""CfgEpochServerEvents""));" \n "} forEach (""isClass _x"" configClasses (configFile >> ""CfgEpochServerEvents""));" \n
"" \n "" \n
"_cmdDelay = EPOCH_hiveAdminCmdTime;" \n "_cmdDelay = EPOCH_hiveAdminCmdTime;" \n
@ -355,7 +355,7 @@ class FSM
"_pvehTime = diag_tickTime;" \n "_pvehTime = diag_tickTime;" \n
"_newEvents = [];" \n "_newEvents = [];" \n
"{" \n "{" \n
" _x params [""_time"", ""_scriptName"", [""_runAtStart"",0], [""_usePrePostfix"",1], [""_runNumTimes"",-1], [""_input"",[]]];" \n " _x params [""_time"", ""_scriptName"", [""_runAtStart"",0], [""_usePrePostfix"",1], [""_runNumTimes"",-1], [""_input"",[]], [""_disallowedWorlds"",[]] ];" \n
" _eventKey = format[""EPOCH_EVENT_%1"", _forEachIndex];" \n " _eventKey = format[""EPOCH_EVENT_%1"", _forEachIndex];" \n
" _eventCounter = format[""EPOCH_EVENT_COUNTER_%1"", _forEachIndex];" \n " _eventCounter = format[""EPOCH_EVENT_COUNTER_%1"", _forEachIndex];" \n
" _lastTime = missionNamespace getVariable _eventKey;" \n " _lastTime = missionNamespace getVariable _eventKey;" \n
@ -368,8 +368,8 @@ class FSM
" missionNamespace setVariable[_eventKey, _startTime];" \n " missionNamespace setVariable[_eventKey, _startTime];" \n
" _lastTime = _startTime;" \n " _lastTime = _startTime;" \n
" };" \n " };" \n
" if (_counter >= _runNumTimes && _runNumTimes != -1) then {" \n " if ((_counter >= _runNumTimes && _runNumTimes != -1) || worldName in _disallowedWorlds) then {" \n
" diag_log format[""DEBUG: server event expired %1"", _scriptName];" \n " diag_log format[""DEBUG: server event removed %1"", _scriptName];" \n
" } else {" \n " } else {" \n
" _newEvents pushBack _x;" \n " _newEvents pushBack _x;" \n
" if ((diag_tickTime - _lastTime) >= _time) then {" \n " if ((diag_tickTime - _lastTime) >= _time) then {" \n
@ -442,4 +442,4 @@ class FSM
{ {
}; };
}; };
/*%FSM</COMPILE>*/ /*%FSM</COMPILE>*/

View File

@ -9,7 +9,7 @@
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server_bunker_event/EpochEvents/BunkerSpawner.sqf https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server_bunker_event/EpochEvents/BunkerSpawner.sqf
*/ */
//[[[cog import generate_private_arrays ]]] //[[[cog import generate_private_arrays ]]]
private ["_allBunkers","_animationStates","_bunkerClasses","_bunkerCounter","_bunkerLocationsKey","_bunkerLocationsTMP","_colCount","_debug","_debugLocation","_expiresBunker","_instanceID","_list","_loc1","_location","_maxBunkerLimitPerRow","_maxBunkerLimitSlots","_maxColumns","_memoryPoints","_modelInfo","_newBunkerCounter","_object","_originalLocation","_pOffset","_response","_rng","_rngChance","_rowCount","_score","_scriptHiveKey","_seed","_selectedBunker","_size","_veh"]; private ["_allBunkers","_animationStates","_bunkerClasses","_bunkerCounter","_bunkerLocationsKey","_bunkerLocationsTMP","_colCount","_debug","_debugLocation","_expiresBunker","_firstBunker","_instanceID","_list","_loc1","_location","_maxBunkerLimitPerRow","_maxBunkerLimitSlots","_maxColumns","_memoryPoints","_modelInfo","_newBunkerCounter","_object","_originalLocation","_pOffset","_response","_rng","_rngChance","_rowCount","_score","_scriptHiveKey","_seed","_selectedBunker","_size","_veh"];
//[[[end]]] //[[[end]]]
if (worldName == "VR") then { if (worldName == "VR") then {
@ -33,6 +33,8 @@ if (worldName == "VR") then {
_response = [_scriptHiveKey, _bunkerLocationsKey] call EPOCH_fnc_server_hiveGETRANGE; _response = [_scriptHiveKey, _bunkerLocationsKey] call EPOCH_fnc_server_hiveGETRANGE;
_response params [["_status",0],["_data",[]] ]; _response params [["_status",0],["_data",[]] ];
_firstBunker = objNull;
// check for proper return and data type // check for proper return and data type
if (_status == 1 && _data isEqualType [] && !(_data isEqualTo [])) then { if (_status == 1 && _data isEqualType [] && !(_data isEqualTo [])) then {
@ -41,6 +43,7 @@ if (worldName == "VR") then {
if (_x isEqualType [] && !(_x isEqualTo [])) then { if (_x isEqualType [] && !(_x isEqualTo [])) then {
_x params ["_selectedBunker", "_posWorld", ["_memoryPointsStatus",[]] ]; _x params ["_selectedBunker", "_posWorld", ["_memoryPointsStatus",[]] ];
_object = createSimpleObject [_selectedBunker, _posWorld]; _object = createSimpleObject [_selectedBunker, _posWorld];
if (isNull _firstBunker) then {_firstBunker = _object;};
{ {
_object animate [_x,(_memoryPointsStatus param [_forEachIndex,1]),true]; _object animate [_x,(_memoryPointsStatus param [_forEachIndex,1]),true];
} forEach _memoryPoints; } forEach _memoryPoints;
@ -80,6 +83,7 @@ if (worldName == "VR") then {
if (_rng > _rngChance) then { if (_rng > _rngChance) then {
_selectedBunker = selectRandom _bunkerClasses; _selectedBunker = selectRandom _bunkerClasses;
_object = createSimpleObject [_selectedBunker, _location]; _object = createSimpleObject [_selectedBunker, _location];
if (isNull _firstBunker) then {_firstBunker = _object;};
_allBunkers pushBack _object; _allBunkers pushBack _object;
//_bunkerLocationsTMP pushBack [_selectedBunker,getPosWorld _object, vectorDir _object, vectorUp _object]; //_bunkerLocationsTMP pushBack [_selectedBunker,getPosWorld _object, vectorDir _object, vectorUp _object];
_newBunkerCounter = _newBunkerCounter + 1; _newBunkerCounter = _newBunkerCounter + 1;
@ -107,6 +111,7 @@ if (worldName == "VR") then {
_score = _score + 1; _score = _score + 1;
_animationStates pushBack 0 _animationStates pushBack 0
} else { } else {
_veh animate [_x,1,true];
_animationStates pushBack 1 _animationStates pushBack 1
}; };
}; };
@ -119,6 +124,12 @@ if (worldName == "VR") then {
[_scriptHiveKey, _bunkerLocationsKey, _expiresBunker, _bunkerLocationsTMP] call EPOCH_fnc_server_hiveSETEX; [_scriptHiveKey, _bunkerLocationsKey, _expiresBunker, _bunkerLocationsTMP] call EPOCH_fnc_server_hiveSETEX;
}; };
// move respawn point into first bunker.
if (!(isNull _firstBunker) && {_firstBunker distance _debugLocation > 2}) then {
deleteMarker "respawn_west";
createMarker ["respawn_west", getposATL _firstBunker];
};
if (_debug) then { if (_debug) then {
diag_log format["DEBUG: Spawned %1 Existing Bunker",_bunkerCounter]; diag_log format["DEBUG: Spawned %1 Existing Bunker",_bunkerCounter];
if (_newBunkerCounter > 0) then { if (_newBunkerCounter > 0) then {

View File

@ -33,5 +33,6 @@ class CfgEpochServerEvents
usePrefix = 0; // usePrefix: 1 = pre/postfix path (use if file is inside epoch settings pbo EpochEvents folder), 2 = pre/postfix path (use if file inside epoch events pbo EpochEvents folder), 0 = use full file path usePrefix = 0; // usePrefix: 1 = pre/postfix path (use if file is inside epoch settings pbo EpochEvents folder), 2 = pre/postfix path (use if file inside epoch events pbo EpochEvents folder), 0 = use full file path
runNumTimes = 1; // runNumTimes: -1 = no limit, 0 = disabled, 1+ = number of times to execute before removing event. runNumTimes = 1; // runNumTimes: -1 = no limit, 0 = disabled, 1+ = number of times to execute before removing event.
input[] = {}; // array input to execVM at time of run and accessed with _this inside of script. input[] = {}; // array input to execVM at time of run and accessed with _this inside of script.
disallowedWorlds = {"VR"};
}; };
}; };

View File

@ -33,5 +33,6 @@ class CfgEpochServerEvents
usePrefix = 0; // usePrefix: 0 = use full file path, 1 = pre/postfix path (use if file is inside epoch settings pbo EpochEvents folder), 2 = pre/postfix path (use if file inside epoch events pbo EpochEvents folder). usePrefix = 0; // usePrefix: 0 = use full file path, 1 = pre/postfix path (use if file is inside epoch settings pbo EpochEvents folder), 2 = pre/postfix path (use if file inside epoch events pbo EpochEvents folder).
runNumTimes = -1; // runNumTimes: 0 = disabled, 1+ = number of times to execute before removing event, -1 = no limit. runNumTimes = -1; // runNumTimes: 0 = disabled, 1+ = number of times to execute before removing event, -1 = no limit.
input[] = {"ItemBriefcaseGold100oz"}; // array input to execVM at time of run and accessed with _this inside of script. input[] = {"ItemBriefcaseGold100oz"}; // array input to execVM at time of run and accessed with _this inside of script.
disallowedWorlds = {"VR"};
}; };
}; };