mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
bunker updates
This commit is contained in:
parent
6eb11ee7de
commit
3263cc4698
@ -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","_bunkerCounter","_bunkerLocations","_bunkerLocationsKey","_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","_valuesAndWeights","_veh"];
|
private ["_allBunkers","_animationStates","_bunkerCounter","_bunkerLocations","_bunkerLocationsKey","_colCount","_debug","_debugLocation","_expiresBunker","_firstBunker","_instanceID","_list","_loc1","_location","_maxRows","_maxBunkerLimitSlots","_maxColumns","_memoryPoints","_modelInfo","_newBunkerCounter","_object","_originalLocation","_pOffset","_response","_rng","_rngChance","_rowCount","_score","_scriptHiveKey","_seed","_selectedBunker","_size","_valuesAndWeights","_veh"];
|
||||||
//[[[end]]]
|
//[[[end]]]
|
||||||
if (worldName == "VR") then {
|
if (worldName == "VR") then {
|
||||||
|
|
||||||
@ -21,12 +21,12 @@ if (worldName == "VR") then {
|
|||||||
_newBunkerCounter = 0;
|
_newBunkerCounter = 0;
|
||||||
|
|
||||||
_instanceID = call EPOCH_fn_InstanceID;
|
_instanceID = call EPOCH_fn_InstanceID;
|
||||||
|
// size
|
||||||
_maxBunkerLimitSlots = 1000;
|
_maxRows = 100;
|
||||||
_maxBunkerLimitPerRow = 100;
|
_maxColumns = 100;
|
||||||
|
|
||||||
_rngChance = 0; // Lower this to spawn more positions
|
_rngChance = 0; // Lower this to spawn more positions
|
||||||
_scriptHiveKey = "EPOCH:DynamicBunker001"; // change this to force a new seed to be generated.
|
_scriptHiveKey = "EPOCH:DynamicBunker002"; // change this to force a new seed to be generated.
|
||||||
|
|
||||||
_bunkerLocationsKey = format ["%1:%2", _instanceID, worldname];
|
_bunkerLocationsKey = format ["%1:%2", _instanceID, worldname];
|
||||||
_response = [_scriptHiveKey, _bunkerLocationsKey] call EPOCH_fnc_server_hiveGETRANGE;
|
_response = [_scriptHiveKey, _bunkerLocationsKey] call EPOCH_fnc_server_hiveGETRANGE;
|
||||||
@ -42,7 +42,7 @@ if (worldName == "VR") then {
|
|||||||
|
|
||||||
// generate new bunker
|
// generate new bunker
|
||||||
_size = 13.081;
|
_size = 13.081;
|
||||||
_maxColumns = _maxBunkerLimitSlots / _maxBunkerLimitPerRow;
|
|
||||||
_allBunkers = [];
|
_allBunkers = [];
|
||||||
_newBunkerCounter = 0;
|
_newBunkerCounter = 0;
|
||||||
// Generate Seed
|
// Generate Seed
|
||||||
@ -82,7 +82,7 @@ if (worldName == "VR") then {
|
|||||||
};
|
};
|
||||||
_location set [0,(_location select 0) + _size];
|
_location set [0,(_location select 0) + _size];
|
||||||
_rowCount = _rowCount + 1;
|
_rowCount = _rowCount + 1;
|
||||||
if (_rowCount >= _maxBunkerLimitPerRow) then {
|
if (_rowCount >= _maxRows) then {
|
||||||
_rngChance = 0.3;
|
_rngChance = 0.3;
|
||||||
_colCount = _colCount + 1;
|
_colCount = _colCount + 1;
|
||||||
_rowCount = 0;
|
_rowCount = 0;
|
||||||
@ -110,8 +110,8 @@ if (worldName == "VR") then {
|
|||||||
_modelInfo = getModelInfo _veh;
|
_modelInfo = getModelInfo _veh;
|
||||||
_bunkerLocations pushBack [_modelInfo select 1, getPosWorld _veh, _animationStates, _score];
|
_bunkerLocations pushBack [_modelInfo select 1, getPosWorld _veh, _animationStates, _score];
|
||||||
} forEach _allBunkers;
|
} forEach _allBunkers;
|
||||||
// remove temp bunkers
|
// remove temp bunkers, otherwise door ways do not seem to animate
|
||||||
_allBunkers apply {deleteVehicle _x};
|
{deleteVehicle _x} forEach _allBunkers;
|
||||||
// save to DB
|
// save to DB
|
||||||
[_scriptHiveKey, _bunkerLocationsKey, _expiresBunker, _bunkerLocations] call EPOCH_fnc_server_hiveSETEX;
|
[_scriptHiveKey, _bunkerLocationsKey, _expiresBunker, _bunkerLocations] call EPOCH_fnc_server_hiveSETEX;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user