0.3.5.033

This commit is contained in:
vbawol 2015-11-12 12:01:19 -06:00
parent 055b129bcc
commit 6fae1a12f5
16 changed files with 263 additions and 194 deletions

View File

@ -1,24 +1,30 @@
**Client**
[Added] Metal Floors as upgrade in-place option for wood floors. [Added] Metal Floors as upgrade in-place option for wood floors.
[Added] Gender selection screen improvements. [Added] Gender selection screen improvements.
[Added] New interaction system. [Added] New interaction system.
[Added] Documentation on server core framework functions and hive calls.
[Added] Persistent wood and metal spike traps. [Added] Persistent wood and metal spike traps.
[Added] New custom 3x wide hesco type barrier. [Added] New custom 3x wide hesco type barrier.
[Added] New custom tank trap. [Added] New custom tank trap.
[Added] Updated version of the Fishing Rod. [Added] Updated version of the Fishing Rod.
[Added] muzzle_snds_338_sand to loot and pricing tables. [Changed] Players now start with a Quartz radio by default.
[Added] Client side master loop is now fully config (CfgMasterLoop) based. [Changed] Overhaul of secure storage system to make it faster.
[Changed] Final overhaul of secure storage system with support for new UI. [Fixed] Was unable to use cursorTarget underwater, fixed using new custom made function.
[Changed] Increased reverse token check timeout from 90 to 180 seconds.
[Changed] Server pack Tools folder now contains InstalEpoch.cmd that is an updated version of the command line download Epoch client files download script for steam workshop.
[Fixed] Was unable to use cursorTarget underwater, added new function EPOCH_fnc_cursorTarget that works everywhere.
[Fixed] NPC item trades that cannot fit in the players inventory will be placed at the feet of the player. [Fixed] NPC item trades that cannot fit in the players inventory will be placed at the feet of the player.
[Fixed] If player started a trade with a zero Krypto and then obtained Krypto they had to relog to be able to trade again.
[Fixed] Removed forced weather sync on server startup from server init phase so weather changes are now solely dependent on Epoch Events weather script.
[Fixed] Added private array to all Epoch Event scripts due to feedback.
[Fixed] Not loosing Stamina while swimming. [Fixed] Not loosing Stamina while swimming.
[Fixed] Removed extra roadway on top of columns. [Fixed] Removed extra roadway on top of columns.
[Fixed] Force trader data save to save when loading starter items. [Fixed] Error Zero divisor in client side master loop.
[Fixed] .rpt error after gutting animal.
**Server**
[Added] Documentation on server core framework functions and hive calls.
[Added] muzzle_snds_338_sand to loot and pricing tables.
[Added] Client side master loop is now fully config (CfgMasterLoop) based.
[Added] Ability to fully change default player loadouts via CfgEpochServer configs:
(defaultGoggles, defaultHeadgear, defaultBackpack, defaultVestFemale, defaultVestMale, defaultUniformFemale, defaultUniformMale, itemsInContainers, weaponsInContainers, normalMagazines, weaponsAndItems)
[Changed] Increased reverse token check timeout from 90 to 180 seconds.
[Fixed] Dynamic traders did not correctly track the stored vehicle count and limits. [Fixed] Dynamic traders did not correctly track the stored vehicle count and limits.
[Fixed] Error Zero divisor in master loop. [Fixed] Force trader data save to save when loading starter items.
[Fixed] .rpt error after gutting animal added by adding isNull check to animal brain. [Fixed] Added private array to all Epoch Event scripts due to feedback.
[Fixed] Removed forced weather sync on server startup from server init phase so weather changes are now solely dependent on Epoch Events weather script.
[Fixed] EPOCH_fnc_returnConfigEntry and V2 functions did not use defaults properly.
[Info] Server pack Tools folder now contains InstalEpoch.cmd that is an updated version of the command line download Epoch client files download script for steam workshop.

View File

@ -1 +1 @@
5 "" !WeaponHolderSimulated !Shot !"(Safe|LockBox|FirePlace|PlotPole|Jack|SolarGen)_EPOCH" !"Jack_SIM_EPOCH" !"LockBox_Ghost_EPOCH" !"CinderWallHalf_Ghost_EPOCH" !"(Tipi|Workbench|StorageShelf|Wood(Floor|LargeWall|Stairs|Ramp|Ladder|Tower)_Ghost_EPOCH" !="(Hesco3|Metal|Foundation)_Ghost_EPOCH" !"Land_Cages_F" !"Epoch_Sapper_F" 5 "" !WeaponHolderSimulated !Shot !"(Safe|LockBox|FirePlace|PlotPole|Jack|SolarGen)_EPOCH" !"Jack_SIM_EPOCH" !"LockBox_Ghost_EPOCH" !"CinderWallHalf_Ghost_EPOCH" !"(Tipi|Workbench|StorageShelf|Wood(Floor|LargeWall|Stairs|Ramp|Ladder|Tower)_Ghost_EPOCH" !"(Hesco3|Metal|Foundation)_Ghost_EPOCH" !"Land_Cages_F" !"Epoch_Sapper_F"

View File

@ -32,14 +32,14 @@ if (!isNull EPOCH_currentTarget && vehicle player == player) then {
_stability = 0; _stability = 0;
_color = [1, 1, 1, 0.7]; _color = [1, 1, 1, 0.7];
_text = format ["Press (%1)",EPOCH_keysAction call BIS_fnc_keyCode]; _text = format ["Hold (%1)",EPOCH_keysAction call BIS_fnc_keyCode];
_icon = "\x\addons\a3_epoch_code\Data\UI\ui_question_ca.paa"; _icon = "\x\addons\a3_epoch_code\Data\UI\ui_question_ca.paa";
_interactOption = getNumber(configFile >> "cfgVehicles" >> typeOf _currentTarget >> "interactMode"); _interactOption = getNumber(configFile >> "cfgVehicles" >> typeOf _currentTarget >> "interactMode");
switch _interactOption do { switch _interactOption do {
case 0: { case 0: {
_stability = 100 - round(damage _currentTarget) * 10; _stability = 100 - round(damage _currentTarget * 10);
_icon = "\x\addons\a3_epoch_code\Data\UI\loading_bar_%1.paa"; _icon = "\x\addons\a3_epoch_code\Data\UI\loading_bar_%1.paa";
_text = "Press (Inventory)"; _text = "Press (Inventory)";
}; };
@ -58,7 +58,7 @@ if (!isNull EPOCH_currentTarget && vehicle player == player) then {
case 2: { case 2: {
if (alive _currentTarget) then{ if (alive _currentTarget) then{
_text = format["%1 - Press (Ctrl+%2)", if (isStreamFriendlyUIEnabled) then[{"Player"}, { name _currentTarget }],EPOCH_keysAcceptTrade call BIS_fnc_keyCode]; _text = format["%1 - Press (Ctrl+%2)", if (isStreamFriendlyUIEnabled) then[{"Player"}, { name _currentTarget }],EPOCH_keysAcceptTrade call BIS_fnc_keyCode];
_stability = 100 - round(damage _currentTarget) * 10; _stability = 100 - round(damage _currentTarget * 10);
_icon = "\x\addons\a3_epoch_code\Data\UI\loading_bar_%1.paa"; _icon = "\x\addons\a3_epoch_code\Data\UI\loading_bar_%1.paa";
if (_stability < 50) then{ if (_stability < 50) then{

View File

@ -21,6 +21,7 @@ if (_energyCost == 0) then {
_class = getText(configfile >> "cfgVehicles" >> _objType >> "GhostPreview"); _class = getText(configfile >> "cfgVehicles" >> _objType >> "GhostPreview");
_maxHeight = getNumber(configfile >> "cfgVehicles" >> _objType >> "maxHeight"); _maxHeight = getNumber(configfile >> "cfgVehicles" >> _objType >> "maxHeight");
_simulClass = getText(configFile >> "CfgVehicles" >> _objType >> "simulClass"); _simulClass = getText(configFile >> "CfgVehicles" >> _objType >> "simulClass");
_snapChecks = getArray(configFile >> "CfgSnapChecks" >> _objType >> "nails");
_maxSnapDistance = 1; _maxSnapDistance = 1;
_lastCheckTime = diag_tickTime; _lastCheckTime = diag_tickTime;
_stabilityCheck = false; _stabilityCheck = false;
@ -109,6 +110,13 @@ if (_class != "") then {
EPOCH_target attachTo[player]; EPOCH_target attachTo[player];
}; };
if (EPOCH_space) then {
_dir2 = [vectorDir player, EPOCH_buildDirection] call EPOCH_returnVector;
_up2 = (vectorUp player);
EPOCH_space = false;
EPOCH_target setVectorDirAndUp [_dir2,_up2];
};
{ {
_nearestObject = _x; _nearestObject = _x;
if !(isNull EP_snap) then { if !(isNull EP_snap) then {
@ -282,37 +290,27 @@ if (_class != "") then {
_offsetZPos = [_currentPos select 0, _currentPos select 1, (_currentPos select 2) - 0.5]; _offsetZPos = [_currentPos select 0, _currentPos select 1, (_currentPos select 2) - 0.5];
if !(terrainIntersect[_currentPos, _offsetZPos]) then { if !(terrainIntersect[_currentPos, _offsetZPos]) then {
// check below for static object _numberOfContacts = 0;
if (lineintersectsobjs[ATLtoASL _currentPos, ATLtoASL _offsetZPos, _currentTarget, objNull, false, 2] isEqualTo[]) then { {
_pos1 = _currentTarget modelToWorld (_x select 0);
_pos2 = _currentTarget modelToWorld (_x select 1);
_ins = lineIntersectsSurfaces [AGLToASL _pos1, AGLToASL _pos2,player,_currentTarget,true,1,"VIEW","FIRE"];
if (count _ins > 0) then {
_numberOfContacts = _numberOfContacts + 1;
};
} forEach _snapChecks;
_currentDir = getDir _currentTarget; if (_numberOfContacts < 2) then {
_objSize = sizeOf _objType / 3.5; // TODO: foundations need to be handled
_numberOfContacts = 0; // change to sim
{ _worldspace = [getposATL _currentTarget, vectordir _currentTarget, vectorup _currentTarget];
// check all four sides (must have two or more) deleteVehicle _currentTarget;
if !(lineintersectsobjs[ATLtoASL _currentPos, ATLtoASL([_currentTarget, _objSize, _currentDir + _x] call BIS_fnc_relPos), _currentTarget, objNull, false, 2] isEqualTo[]) then { _currentTarget = createVehicle[_simulClass, (_worldspace select 0), [], 0, "CAN_COLLIDE"];
_numberOfContacts = _numberOfContacts + 1; _currentTarget setVectorDirAndUp[_worldspace select 1, _worldspace select 2];
}; _currentTarget setposATL(_worldspace select 0);
} forEach[0, 90, 180, 270];
if (_numberOfContacts < 2) then {
// TODO: foundations need to be handled
// change to sim
_worldspace = [getposATL _currentTarget, vectordir _currentTarget, vectorup _currentTarget];
deleteVehicle _currentTarget;
_currentTarget = createVehicle[_simulClass, (_worldspace select 0), [], 0, "CAN_COLLIDE"];
_currentTarget setVectorDirAndUp[_worldspace select 1, _worldspace select 2];
_currentTarget setposATL(_worldspace select 0);
};
}; };
}; };
}; };
_currentTarget spawn EPOCH_countdown; _currentTarget spawn EPOCH_countdown;
}; };
}; };

View File

@ -11,10 +11,10 @@ if (isClass(_config)) then{
_finalconfig = _config >> (_this select 1); _finalconfig = _config >> (_this select 1);
if (configName(_finalconfig) == (_this select 1)) then{ if (configName(_finalconfig) == (_this select 1)) then{
_varData = switch (typeName _defaultData) do { _varData = switch (typeName _defaultData) do {
case "SCALAR": {getNumber _finalconfig}; case "SCALAR": {if (isNumber (_finalconfig)) then { getNumber _finalconfig } else {_defaultData} };
case "BOOL": {(getNumber _finalconfig) == 1}; case "BOOL": {if (isText (_finalconfig)) then { (getText _finalconfig) isEqualTo "true" } else {_defaultData} };
case "ARRAY": {getArray _finalconfig}; case "ARRAY": {if (isArray (_finalconfig)) then { getArray _finalconfig } else {_defaultData} };
case "STRING": {getText _finalconfig}; case "STRING": {if (isText (_finalconfig)) then { getText _finalconfig } else {_defaultData} };
default {_defaultData}; default {_defaultData};
}; };
} else { } else {

View File

@ -320,7 +320,7 @@ class CfgPricing
class muzzle_snds_338_black { price = 3; }; class muzzle_snds_338_black { price = 3; };
class muzzle_snds_338_green { price = 3; }; class muzzle_snds_338_green { price = 3; };
class muzzle_snds_338_sand { price = 3; }; class muzzle_snds_338_sand { price = 3; };
class muzzle_snds_93mmg { price = 3; }; class muzzle_snds_93mmg { price = 3; };
class muzzle_snds_93mmg_tan { price = 3; }; class muzzle_snds_93mmg_tan { price = 3; };
@ -358,6 +358,8 @@ class CfgPricing
class KitWoodStairs {price = 10;}; class KitWoodStairs {price = 10;};
class KitWoodTower {price = 10;}; class KitWoodTower {price = 10;};
class KitWoodRamp {price = 14;}; class KitWoodRamp {price = 14;};
class KitSpikeTrap {price = 25;};
class KitMetalTrap {price = 25;};
class KitTankTrap {price = 25;}; class KitTankTrap {price = 25;};
class KitHesco3 { price = 25; }; class KitHesco3 { price = 25; };
class KitWoodLadder { price = 10; }; class KitWoodLadder { price = 10; };

View File

@ -0,0 +1,48 @@
// Snap Checks - EpochMod.com
class Hesco3_EPOCH {
nails[] = {
{{0,0,-0.6},{0,0,-0.75}},
{{1.6,0,-0.0307557},{1.8625,0,-0.0307557}},
{{-1.6,0,-0.0307557},{-1.8625,0,-0.0307557}}
};
};
class WoodLargeWall_EPOCH {
nails[] = {
{{0,0,0.120775},{0,0,-0.190775}},
{{2.46932,0,1.5},{2.76932,0,1.5}},
{{-2.46932,0,1.5},{-2.76932,0,1.5}}
};
};
class WoodWall1_EPOCH : WoodLargeWall_EPOCH {};
class WoodWall2_EPOCH : WoodLargeWall_EPOCH {};
class WoodWall3_EPOCH : WoodLargeWall_EPOCH {};
class WoodWall4_EPOCH : WoodLargeWall_EPOCH {};
class WoodLargeWallCor_EPOCH : WoodLargeWall_EPOCH {};
class WoodLargeWallDoorway_EPOCH : WoodLargeWall_EPOCH {};
class WoodLargeWallDoor_EPOCH : WoodLargeWall_EPOCH {};
class WoodLargeWallDoorL_EPOCH : WoodLargeWall_EPOCH {};
class CinderWallGarage_EPOCH : WoodLargeWall_EPOCH {};
class CinderWall_EPOCH : WoodLargeWall_EPOCH {};
class CinderWallHalf_EPOCH : WoodLargeWall_EPOCH {};
class WoodFloor_Epoch {
nails[] = {
{{2.5555,0,0.15},{2.8555,0,0.15}},
{{0,-2.5555,0.15},{0,2.8555,0.15}},
{{-2.5555,0,0.15},{-2.8555,0,0.15}},
{{0,-2.5555,0.15},{0,-2.8555,0.15}},
{{2.5555,0,0.15},{2.5555,0,-0.15}},
{{-2.5555,0,0.15},{-2.5555,0,-0.15}},
{{0,-2.5555,0.15},{0,-2.5555,-0.15}},
{{0,2.5555,0.15},{0,2.5555,-0.15}}
};
};
class MetalFloor_EPOCH : WoodFloor_Epoch {};
class WoodStairs_EPOCH {
nails[] = {
{{0,0,0.05},{0,0,-0.20}}
};
};
class WoodStairs2_EPOCH : WoodStairs_EPOCH {};
class WoodTower_EPOCH : WoodStairs_EPOCH {};
class WoodRamp_EPOCH : WoodStairs_EPOCH {};

View File

@ -3851,7 +3851,7 @@ class CfgVehicles
bypassJammer = 1; bypassJammer = 1;
}; };
class Hesco3_EPOCH: Constructions_static_F class Hesco3_EPOCH: Const_All_Walls_F
{ {
scope = 2; scope = 2;
model = "\x\addons\a3_epoch_assets_3\CfgVehicles\Defense\hesco.p3d"; model = "\x\addons\a3_epoch_assets_3\CfgVehicles\Defense\hesco.p3d";
@ -4092,6 +4092,15 @@ class CfgVehicles
snapPointsPerp[] = { "N", "S", "E", "W", "CinN", "CinS", "CinE", "CinW" }; snapPointsPerp[] = { "N", "S", "E", "W", "CinN", "CinS", "CinE", "CinW" };
allowedSnapPoints[] = { "NF", "SF", "EF", "WF", "C" }; allowedSnapPoints[] = { "NF", "SF", "EF", "WF", "C" };
energyCost = 0.5; energyCost = 0.5;
armor = 15000;
selectionDamage = "zbytek";
class Damage
{
tex[] = {};
// TODO: make seperate rvmat for destruction check for issues due to camo zbytek applying to all mats
mat[] = { "x\addons\a3_epoch_assets_1\textures\metal_floor.rvmat", "x\addons\a3_epoch_assets\textures\PlyPlank_destruct50.rvmat", "x\addons\a3_epoch_assets\textures\PlyPlank_destruct50.rvmat" };
};
}; };
// Wood wall seed item lvl 0 // Wood wall seed item lvl 0

View File

@ -42,6 +42,7 @@ class CfgAddons
#include "\x\addons\a3_epoch_config\Configs\CfgEpochClient.hpp" #include "\x\addons\a3_epoch_config\Configs\CfgEpochClient.hpp"
#include "\x\addons\a3_epoch_config\Configs\CfgMasterLoop.hpp" #include "\x\addons\a3_epoch_config\Configs\CfgMasterLoop.hpp"
#include "\x\addons\a3_epoch_config\Configs\CfgBaseBuilding.hpp" #include "\x\addons\a3_epoch_config\Configs\CfgBaseBuilding.hpp"
#include "\x\addons\a3_epoch_config\Configs\CfgSnapChecks.hpp"
#include "\x\addons\a3_epoch_config\Configs\CfgBuildingLootPos.hpp" #include "\x\addons\a3_epoch_config\Configs\CfgBuildingLootPos.hpp"
#include "\x\addons\a3_epoch_config\Configs\CfgActionMenu\CfgActionMenu_core.hpp" #include "\x\addons\a3_epoch_config\Configs\CfgActionMenu\CfgActionMenu_core.hpp"
#include "\x\addons\a3_epoch_config\Configs\CfgEpochConfiguration.hpp" #include "\x\addons\a3_epoch_config\Configs\CfgEpochConfiguration.hpp"

View File

@ -8,17 +8,18 @@ private ["_class","_worldspace","_objHiveKey","_animPhases","_VAL","_return","_o
_return = false; _return = false;
if !(isNull _this) then { if !(isNull _this) then {
_objSlot = _this getVariable["BUILD_SLOT", -1]; _objSlot = _this getVariable["BUILD_SLOT", -1];
diag_log format["DEBUG: Building Save function BUILD_SLOT %1",_objSlot];
if (_objSlot != -1) then{ if (_objSlot != -1) then{
_this setDamage 0; _this setDamage 0;
_class = typeOf _this; _class = typeOf _this;
_worldspace = [(getposATL _this call EPOCH_precisionPos), vectordir _this, vectorup _this]; _worldspace = [(getposATL _this call EPOCH_precisionPos), vectordir _this, vectorup _this];
_objHiveKey = format["%1:%2", (call EPOCH_fn_InstanceID), _objSlot]; _objHiveKey = format["%1:%2", (call EPOCH_fn_InstanceID), _objSlot];
_animPhases = []; _animPhases = [];
{ {
_animPhases pushBack (_this animationPhase _x) _animPhases pushBack (_this animationPhase _x)
} foreach (getArray(configFile >> "CfgVehicles" >> _class >> "persistAnimations")); } foreach (getArray(configFile >> "CfgVehicles" >> _class >> "persistAnimations"));
_VAL = [_class, _worldspace, _this getVariable["EPOCH_secureStorage", "-1"], _this getVariable["BUILD_OWNER", "-1"], _this getVariable["TEXTURE_SLOT", 0], _animPhases]; _VAL = [_class, _worldspace, _this getVariable["EPOCH_secureStorage", "-1"], _this getVariable["BUILD_OWNER", "-1"], _this getVariable["TEXTURE_SLOT", 0], _animPhases];
["Building", _objHiveKey, EPOCH_expiresBuilding, _VAL] call EPOCH_fnc_server_hiveSETEX; ["Building", _objHiveKey, EPOCH_expiresBuilding, _VAL] call EPOCH_fnc_server_hiveSETEX;
_return = true; _return = true;
}; };
}; };

View File

@ -4,12 +4,33 @@
Epoch Mod - EpochMod.com Epoch Mod - EpochMod.com
All Rights Reserved. All Rights Reserved.
*/ */
private["_reject", "_plyr", "_instanceID", "_plyrNetID", "_plyrUID", "_response", "_arr", "_defaultUniform", "_class", "_vest", "_medical", "_alreadyDead", "_worldspace", "_dir", "_location", "_prevInstance", "_plyrGroup", "_canBeRevived", "_vars", "_hitpoints", "_group", "_newPlyr", "_currWeap", "_apperance", "_goggles", "_headgear", "_backpack", "_uniform", "_weaponsAndItems", "_equipped", "_weapon", "_type", "_attachments", "_attachment", "_wMags", "_itemSlot", "_itemqtys", "_found", "_contentArray", "_deadPlayer"]; private ["_arr","_uniform","_class","_vest","_vars","_canBeRevived","_dir","_location","_group","_apperance","_goggles","_headgear","_backpack","_weaponsAndItems","_linkedItems","_normalMagazines","_itemsInContainers","_weaponsInContainers","_wMags","_wMagsArray","_equipped","_weapon","_type","_attachments","_currWeap","_found","_contentArray","_plyrGroup","_response","_reject","_fnc_addItemToX","_worldspace","_prevInstance","_medical","_server_vars","_hitpoints","_deadPlayer","_alreadyDead","_newPlyr","_plyrUID","_serverSettingsConfig","_plyr","_instanceID","_plyrNetID"];
_reject = true; _reject = true;
_fnc_addItemToX = {
private ["_itemSlot","_itemqtys","_newPlyr"];
_newPlyr = _this select 0;
{
_itemSlot = _forEachIndex;
_itemqtys = _x select 1;
{
for "_i" from 1 to (_itemqtys select _forEachIndex) do {
switch _itemSlot do {
case 0: { _newPlyr addItemToUniform _x };
case 1: { _newPlyr addItemToVest _x };
case 2: { _newPlyr addItemToBackpack _x };
};
};
} forEach(_x select 0);
} forEach (_this select 1);
};
if (typename _this == "ARRAY") then { if (typename _this == "ARRAY") then {
// load server settings
_serverSettingsConfig = configFile >> "CfgEpochServer";
_plyr = _this select 0; _plyr = _this select 0;
_instanceID = call EPOCH_fn_InstanceID; _instanceID = call EPOCH_fn_InstanceID;
@ -26,31 +47,43 @@ if (typename _this == "ARRAY") then {
if ((_response select 0) == 1 && typeName(_response select 1) == "ARRAY") then { if ((_response select 0) == 1 && typeName(_response select 1) == "ARRAY") then {
_arr = (_response select 1); _arr = (_response select 1);
}; };
_defaultUniform = "U_Test_uniform";
// Apperance defaults
_uniform = [_serverSettingsConfig, "defaultUniformFemale", "U_Test_uniform"] call EPOCH_fnc_returnConfigEntry;
_class = "Epoch_Female_F"; _class = "Epoch_Female_F";
_vest = "V_F41_EPOCH"; _vest = [_serverSettingsConfig, "defaultVestFemale", "V_F41_EPOCH"] call EPOCH_fnc_returnConfigEntry;
if (_this select 1) then { //true == male if (_this select 1) then { //true == male
_defaultUniform = "U_Test1_uniform"; _uniform = [_serverSettingsConfig, "defaultUniformMale", "U_Test1_uniform"] call EPOCH_fnc_returnConfigEntry;
_class = "Epoch_Male_F"; _class = "Epoch_Male_F";
_vest = "V_41_EPOCH"; _vest = [_serverSettingsConfig, "defaultVestMale", "V_41_EPOCH"] call EPOCH_fnc_returnConfigEntry;
}; };
_goggles = [_serverSettingsConfig, "defaultGoggles", ""] call EPOCH_fnc_returnConfigEntry;
_headgear = [_serverSettingsConfig, "defaultHeadgear", ""] call EPOCH_fnc_returnConfigEntry;
_backpack = [_serverSettingsConfig, "defaultBackpack", ""] call EPOCH_fnc_returnConfigEntry;
// Inventory defaults
_linkedItems = [_serverSettingsConfig, "linkedItems", ["ItemMap","EpochRadio0"]] call EPOCH_fnc_returnConfigEntry;
_itemsInContainers = [_serverSettingsConfig, "itemsInContainers", []] call EPOCH_fnc_returnConfigEntry;
_weaponsInContainers = [_serverSettingsConfig, "weaponsInContainers", []] call EPOCH_fnc_returnConfigEntry;
_normalMagazines = [_serverSettingsConfig, "normalMagazines", []] call EPOCH_fnc_returnConfigEntry;
_weaponsAndItems = [_serverSettingsConfig, "weaponsAndItems", ["", []]] call EPOCH_fnc_returnConfigEntry;
diag_log format["DEBUG (Load Player) _linkedItems 1: %1", _linkedItems];
if (count _arr < 11) then { // invaild format attempt to override if (count _arr < 11) then { // invaild format attempt to override
_arr = [[0, [], _instanceID], [0, 0, 1, 0, []], ["", "", _vest, "", _defaultUniform, _class], [""], [] + EPOCH_defaultVars_SEPXVar, ["", []], ["ItemMap"], [], [], [], "", true]; _arr = [[0, [], _instanceID], [0, 0, 1, 0, []], [_goggles, _headgear, _vest, _backpack, _uniform, _class], [""], [] + EPOCH_defaultVars_SEPXVar, _weaponsAndItems, _linkedItems, _normalMagazines, _itemsInContainers, _weaponsInContainers, "", true];
}; };
_worldspace = _arr select 0; _worldspace = _arr select 0;
_dir = _worldspace select 0; _dir = _worldspace select 0;
_location = _worldspace select 1; _location = _worldspace select 1;
_prevInstance = _worldspace select 2; _prevInstance = _worldspace select 2;
_medical = _arr select 1; _medical = _arr select 1;
_server_vars = _arr select 3;
_vars = _arr select 4;
_plyrGroup = _arr select 10; _plyrGroup = _arr select 10;
_canBeRevived = _arr select 11; _canBeRevived = _arr select 11;
_server_vars = _arr select 3;
_vars = _arr select 4;
_hitpoints = _vars select 11; _hitpoints = _vars select 11;
@ -76,12 +109,13 @@ if (typename _this == "ARRAY") then {
}; };
} forEach allUnits; } forEach allUnits;
// find existing group
if (_plyrGroup != "") then { if (_plyrGroup != "") then {
{ {
if ((_x getVariable["GROUP", ""]) == _plyrGroup) exitWith{ if ((_x getVariable["GROUP", ""]) == _plyrGroup) exitWith{
_group = group _x; _group = group _x;
}; };
} forEach playableUnits; } forEach playableUnits;
}; };
if (isNull _group) then { if (isNull _group) then {
@ -117,63 +151,64 @@ if (typename _this == "ARRAY") then {
_backpack = _apperance select 3; _backpack = _apperance select 3;
_uniform = _apperance select 4; _uniform = _apperance select 4;
if (_uniform != "") then {
_newPlyr addUniform _uniform;
};
if (_backpack != "") then {
_newPlyr addBackpack _backpack;
};
if (_goggles != "") then {
_newPlyr addGoggles _goggles;
};
if (_headgear != "") then {
_newPlyr addHeadgear _headgear;
};
if (_vest != "") then {
_newPlyr addVest _vest;
};
// Weapons // Weapons
_weaponsAndItems = _arr select 5; _weaponsAndItems = _arr select 5;
if (count _weaponsAndItems >= 2) then { _linkedItems = _arr select 6;
_normalMagazines = _arr select 7;
_itemsInContainers = _arr select 8;
_weaponsInContainers = _arr select 9;
};
_equipped = _weaponsAndItems select 2; // Load Apperance START
if (_uniform != "") then {
_newPlyr addUniform _uniform;
};
if (_backpack != "") then {
_newPlyr addBackpack _backpack;
};
if (_goggles != "") then {
_newPlyr addGoggles _goggles;
};
if (_headgear != "") then {
_newPlyr addHeadgear _headgear;
};
if (_vest != "") then {
_newPlyr addVest _vest;
};
// Load Apperance END
// Load inventory + defaults START
if (count _weaponsAndItems >= 2) then {
_equipped = _weaponsAndItems select 2;
{
_weapon = _x deleteAt 0;
_type = getNumber(configfile >> "cfgweapons" >> _weapon >> "type");
_attachments = [];
_wMags = false;
_wMagsArray = [];
// suppressor, laser, optics, magazines(array), bipods
{ {
_weapon = _x deleteAt 0; // magazines
_type = getNumber(configfile >> "cfgweapons" >> _weapon >> "type"); if (typeName(_x) == "ARRAY") then{
_wMags = true;
_attachments = []; _wMagsArray = _x;
_wMags = false; } else {
_wMagsArray = []; // attachments
// suppressor, laser, optics, magazines(array), bipods if (_x != "") then{
{ _attachments pushBack _x;
// magazines
if (typeName(_x) == "ARRAY") then{
_wMags = true;
_wMagsArray = _x;
}
else {
// attachments
if (_x != "") then{
_attachments pushBack _x;
};
}; };
} forEach _x; };
} forEach _x;
// add weapon if equiped // add weapon if equiped
if (_weapon in _equipped) then { if (_weapon in _equipped) then {
_equipped = _equipped - [_weapon];
_equipped = _equipped - [_weapon]; if (_wMags) then {
_newPlyr addMagazine _wMagsArray;
if (_wMags) then { };
_newPlyr addMagazine _wMagsArray; if (_weapon != "") then {
}; _newPlyr addWeapon _weapon;
};
if (_weapon != "") then { switch _type do {
_newPlyr addWeapon _weapon;
};
switch _type do {
case 1: { // primary case 1: { // primary
removeAllPrimaryWeaponItems _newPlyr; removeAllPrimaryWeaponItems _newPlyr;
{ _newPlyr addPrimaryWeaponItem _x } forEach _attachments; { _newPlyr addPrimaryWeaponItem _x } forEach _attachments;
@ -187,69 +222,41 @@ if (typename _this == "ARRAY") then {
{ {
_newPlyr removeSecondaryWeaponItem _x; _newPlyr removeSecondaryWeaponItem _x;
} forEach (secondaryWeaponItems _newPlyr); } forEach (secondaryWeaponItems _newPlyr);
{ _newPlyr addSecondaryWeaponItem _x } forEach _attachments; { _newPlyr addSecondaryWeaponItem _x } forEach _attachments;
}; };
};
}
else { // overflow need to add these items to storage
{
_newPlyr addItem _x;
} forEach _attachments;
if (_wMags) then {
_newPlyr addMagazine _wMagsArray;
};
}; };
} forEach(_weaponsAndItems select 1); } else {
// overflow need to add these items to storage
_currWeap = _weaponsAndItems select 0; {
}; _newPlyr addItem _x;
} forEach _attachments;
// Linked items if (_wMags) then {
{ _newPlyr addMagazine _wMagsArray;
if (_x in["Binocular", "Rangefinder"]) then { };
_newPlyr addWeapon _x;
}
else {
_newPlyr linkItem _x;
}; };
} forEach(_arr select 6); } forEach(_weaponsAndItems select 1);
_currWeap = _weaponsAndItems select 0;
// add items to containers
{
_itemSlot = _forEachIndex;
_itemqtys = _x select 1;
{
for "_i" from 1 to(_itemqtys select _forEachIndex) do {
switch _itemSlot do {
case 0: { _newPlyr addItemToUniform _x };
case 1: { _newPlyr addItemToVest _x };
case 2: { _newPlyr addItemToBackpack _x };
};
};
} forEach(_x select 0);
} forEach(_arr select 8);
// add weapons to containers
{
_itemSlot = _forEachIndex;
_itemqtys = _x select 1;
{
for "_i" from 1 to(_itemqtys select _forEachIndex) do {
switch _itemSlot do {
case 0: { _newPlyr addItemToUniform _x };
case 1: { _newPlyr addItemToVest _x };
case 2: { _newPlyr addItemToBackpack _x };
};
};
} forEach(_x select 0);
} forEach(_arr select 9);
// Add magazines
{
_newPlyr addMagazine _x;
} forEach(_arr select 7);
}; };
// Linked items
{
if (_x in["Binocular", "Rangefinder"]) then {
_newPlyr addWeapon _x;
} else {
_newPlyr linkItem _x;
};
} forEach _linkedItems;
diag_log format["DEBUG (Load Player) _linkedItems: %1", _linkedItems];
// add items to containers
[_newPlyr, _itemsInContainers] call _fnc_addItemToX;
// add weapons to containers
[_newPlyr, _weaponsInContainers] call _fnc_addItemToX;
// Add magazines
{_newPlyr addMagazine _x} forEach _normalMagazines;
// Load inventory + defaults END
// Final Push // Final Push
if (isNull _plyr) then { if (isNull _plyr) then {
@ -292,9 +299,6 @@ if (typename _this == "ARRAY") then {
}; };
diag_log format["DEBUG (Load Player) Set Group: %1", _plyrGroup]; diag_log format["DEBUG (Load Player) Set Group: %1", _plyrGroup];
}; };
// may not be needed, just here to see if we can force the data to sync quicker
// _plyr setPosATL _location;
_newPlyr setVariable["SETUP", true]; _newPlyr setVariable["SETUP", true];
_newPlyr setVariable["PUID", _plyrUID]; _newPlyr setVariable["PUID", _plyrUID];

View File

@ -55,7 +55,7 @@ for "_i" from 1 to _this do {
_vehicle call EPOCH_server_setVToken; _vehicle call EPOCH_server_setVToken;
_vehicle setposATL _location; _vehicle setposATL _location;
_vehicle setVectorDirAndUp _worldspace; _vehicle setVectorDirAndUp _worldspace;
_vehicle setDamage _damage; _vehicle setDamage _damage;
@ -248,6 +248,6 @@ if (_immuneVehicleSpawn) then{
addToRemainsCollector _allVehicles; addToRemainsCollector _allVehicles;
diag_log format ["VEH SPAWN TIMER %1, LOADED 2% VEHICLES", diag_tickTime - _diag, count _allVehicles]; diag_log format ["VEH SPAWN TIMER %1, LOADED %2 VEHICLES", diag_tickTime - _diag, count _allVehicles];
true true

View File

@ -45,7 +45,7 @@ _configArray = [
["B_Heli_Light_01_EPOCH", 2], ["B_Heli_Light_01_EPOCH", 2],
["B_SDV_01_EPOCH", 2], ["B_SDV_01_EPOCH", 2],
["B_MRAP_01_EPOCH", 3], ["B_MRAP_01_EPOCH", 3],
["I_MRAP_03_EPOCH", 3], ["I_MRAP_03_EPOCH", 3],
["B_Truck_01_transport_EPOCH", 1], ["B_Truck_01_transport_EPOCH", 1],
["B_Truck_01_covered_EPOCH", 2], ["B_Truck_01_covered_EPOCH", 2],
["B_Truck_01_mover_EPOCH", 1], ["B_Truck_01_mover_EPOCH", 1],
@ -69,7 +69,7 @@ _configArray = [
["K04", 2], ["K04", 2],
["ebike_epoch", 7], ["ebike_epoch", 7],
["mosquito_epoch", 5], ["mosquito_epoch", 5],
["C_Heli_Light_01_civil_EPOCH",5] ["C_Heli_Light_01_civil_EPOCH",5]
] ]
], ],
["taxRate", 0.1], ["taxRate", 0.1],
@ -94,13 +94,13 @@ _configArray = [
EPOCH_fnc_returnConfigEntry = { EPOCH_fnc_returnConfigEntry = {
private["_defaultData", "_config", "_varData"]; private["_defaultData", "_config", "_varData"];
_defaultData = _this select 2; _defaultData = _this select 2;
_config = (_this select 0) >> (_this select 1);
if (isClass(_this select 0)) then{ if (isClass(_this select 0)) then{
_config = (_this select 0) >> (_this select 1);
_varData = switch (typeName _defaultData) do { _varData = switch (typeName _defaultData) do {
case "SCALAR": {getNumber _config}; case "SCALAR": {if (isNumber (_config)) then { getNumber _config } else {_defaultData} };
case "BOOL": {(getNumber _config) == 1}; case "BOOL": {if (isText (_config)) then { (getText _config) isEqualTo "true" } else {_defaultData} };
case "ARRAY": {getArray _config}; case "ARRAY": {if (isArray (_config)) then { getArray _config } else {_defaultData} };
case "STRING": {getText _config}; case "STRING": {if (isText (_config)) then { getText _config } else {_defaultData} };
default {_defaultData}; default {_defaultData};
}; };
} else { } else {