mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
0.3.5.033
This commit is contained in:
parent
055b129bcc
commit
6fae1a12f5
@ -1,24 +1,30 @@
|
||||
**Client**
|
||||
[Added] Metal Floors as upgrade in-place option for wood floors.
|
||||
[Added] Gender selection screen improvements.
|
||||
[Added] New interaction system.
|
||||
[Added] Documentation on server core framework functions and hive calls.
|
||||
[Added] Persistent wood and metal spike traps.
|
||||
[Added] New custom 3x wide hesco type barrier.
|
||||
[Added] New custom tank trap.
|
||||
[Added] Updated version of the Fishing Rod.
|
||||
[Added] muzzle_snds_338_sand to loot and pricing tables.
|
||||
[Added] Client side master loop is now fully config (CfgMasterLoop) based.
|
||||
[Changed] Final overhaul of secure storage system with support for new UI.
|
||||
[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.
|
||||
[Changed] Players now start with a Quartz radio by default.
|
||||
[Changed] Overhaul of secure storage system to make it faster.
|
||||
[Fixed] Was unable to use cursorTarget underwater, fixed using new custom made function.
|
||||
[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] 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] Error Zero divisor in master loop.
|
||||
[Fixed] .rpt error after gutting animal added by adding isNull check to animal brain.
|
||||
[Fixed] Force trader data save to save when loading starter items.
|
||||
[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.
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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"
|
||||
|
@ -32,14 +32,14 @@ if (!isNull EPOCH_currentTarget && vehicle player == player) then {
|
||||
|
||||
_stability = 0;
|
||||
_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";
|
||||
|
||||
_interactOption = getNumber(configFile >> "cfgVehicles" >> typeOf _currentTarget >> "interactMode");
|
||||
|
||||
switch _interactOption do {
|
||||
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";
|
||||
_text = "Press (Inventory)";
|
||||
};
|
||||
@ -58,7 +58,7 @@ if (!isNull EPOCH_currentTarget && vehicle player == player) then {
|
||||
case 2: {
|
||||
if (alive _currentTarget) then{
|
||||
_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";
|
||||
|
||||
if (_stability < 50) then{
|
||||
|
@ -21,6 +21,7 @@ if (_energyCost == 0) then {
|
||||
_class = getText(configfile >> "cfgVehicles" >> _objType >> "GhostPreview");
|
||||
_maxHeight = getNumber(configfile >> "cfgVehicles" >> _objType >> "maxHeight");
|
||||
_simulClass = getText(configFile >> "CfgVehicles" >> _objType >> "simulClass");
|
||||
_snapChecks = getArray(configFile >> "CfgSnapChecks" >> _objType >> "nails");
|
||||
_maxSnapDistance = 1;
|
||||
_lastCheckTime = diag_tickTime;
|
||||
_stabilityCheck = false;
|
||||
@ -109,6 +110,13 @@ if (_class != "") then {
|
||||
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;
|
||||
if !(isNull EP_snap) then {
|
||||
@ -282,37 +290,27 @@ if (_class != "") then {
|
||||
_offsetZPos = [_currentPos select 0, _currentPos select 1, (_currentPos select 2) - 0.5];
|
||||
if !(terrainIntersect[_currentPos, _offsetZPos]) then {
|
||||
|
||||
// check below for static object
|
||||
if (lineintersectsobjs[ATLtoASL _currentPos, ATLtoASL _offsetZPos, _currentTarget, objNull, false, 2] isEqualTo[]) then {
|
||||
|
||||
_currentDir = getDir _currentTarget;
|
||||
_objSize = sizeOf _objType / 3.5;
|
||||
_numberOfContacts = 0;
|
||||
{
|
||||
// check all four sides (must have two or more)
|
||||
if !(lineintersectsobjs[ATLtoASL _currentPos, ATLtoASL([_currentTarget, _objSize, _currentDir + _x] call BIS_fnc_relPos), _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[0, 90, 180, 270];
|
||||
} forEach _snapChecks;
|
||||
|
||||
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;
|
||||
};
|
||||
};
|
||||
|
@ -11,10 +11,10 @@ if (isClass(_config)) then{
|
||||
_finalconfig = _config >> (_this select 1);
|
||||
if (configName(_finalconfig) == (_this select 1)) then{
|
||||
_varData = switch (typeName _defaultData) do {
|
||||
case "SCALAR": {getNumber _finalconfig};
|
||||
case "BOOL": {(getNumber _finalconfig) == 1};
|
||||
case "ARRAY": {getArray _finalconfig};
|
||||
case "STRING": {getText _finalconfig};
|
||||
case "SCALAR": {if (isNumber (_finalconfig)) then { getNumber _finalconfig } else {_defaultData} };
|
||||
case "BOOL": {if (isText (_finalconfig)) then { (getText _finalconfig) isEqualTo "true" } else {_defaultData} };
|
||||
case "ARRAY": {if (isArray (_finalconfig)) then { getArray _finalconfig } else {_defaultData} };
|
||||
case "STRING": {if (isText (_finalconfig)) then { getText _finalconfig } else {_defaultData} };
|
||||
default {_defaultData};
|
||||
};
|
||||
} else {
|
||||
|
@ -358,6 +358,8 @@ class CfgPricing
|
||||
class KitWoodStairs {price = 10;};
|
||||
class KitWoodTower {price = 10;};
|
||||
class KitWoodRamp {price = 14;};
|
||||
class KitSpikeTrap {price = 25;};
|
||||
class KitMetalTrap {price = 25;};
|
||||
class KitTankTrap {price = 25;};
|
||||
class KitHesco3 { price = 25; };
|
||||
class KitWoodLadder { price = 10; };
|
||||
|
48
Sources/epoch_config/Configs/CfgSnapChecks.hpp
Normal file
48
Sources/epoch_config/Configs/CfgSnapChecks.hpp
Normal 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 {};
|
@ -3851,7 +3851,7 @@ class CfgVehicles
|
||||
bypassJammer = 1;
|
||||
};
|
||||
|
||||
class Hesco3_EPOCH: Constructions_static_F
|
||||
class Hesco3_EPOCH: Const_All_Walls_F
|
||||
{
|
||||
scope = 2;
|
||||
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" };
|
||||
allowedSnapPoints[] = { "NF", "SF", "EF", "WF", "C" };
|
||||
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
|
||||
|
@ -42,6 +42,7 @@ class CfgAddons
|
||||
#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\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\CfgActionMenu\CfgActionMenu_core.hpp"
|
||||
#include "\x\addons\a3_epoch_config\Configs\CfgEpochConfiguration.hpp"
|
||||
|
@ -8,6 +8,7 @@ private ["_class","_worldspace","_objHiveKey","_animPhases","_VAL","_return","_o
|
||||
_return = false;
|
||||
if !(isNull _this) then {
|
||||
_objSlot = _this getVariable["BUILD_SLOT", -1];
|
||||
diag_log format["DEBUG: Building Save function BUILD_SLOT %1",_objSlot];
|
||||
if (_objSlot != -1) then{
|
||||
_this setDamage 0;
|
||||
_class = typeOf _this;
|
||||
|
@ -4,12 +4,33 @@
|
||||
Epoch Mod - EpochMod.com
|
||||
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;
|
||||
|
||||
_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 {
|
||||
|
||||
// load server settings
|
||||
_serverSettingsConfig = configFile >> "CfgEpochServer";
|
||||
|
||||
_plyr = _this select 0;
|
||||
|
||||
_instanceID = call EPOCH_fn_InstanceID;
|
||||
@ -26,32 +47,44 @@ if (typename _this == "ARRAY") then {
|
||||
if ((_response select 0) == 1 && typeName(_response select 1) == "ARRAY") then {
|
||||
_arr = (_response select 1);
|
||||
};
|
||||
_defaultUniform = "U_Test_uniform";
|
||||
|
||||
// Apperance defaults
|
||||
_uniform = [_serverSettingsConfig, "defaultUniformFemale", "U_Test_uniform"] call EPOCH_fnc_returnConfigEntry;
|
||||
_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
|
||||
_defaultUniform = "U_Test1_uniform";
|
||||
_uniform = [_serverSettingsConfig, "defaultUniformMale", "U_Test1_uniform"] call EPOCH_fnc_returnConfigEntry;
|
||||
_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
|
||||
_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;
|
||||
_dir = _worldspace select 0;
|
||||
_location = _worldspace select 1;
|
||||
_prevInstance = _worldspace select 2;
|
||||
|
||||
_medical = _arr select 1;
|
||||
_server_vars = _arr select 3;
|
||||
_vars = _arr select 4;
|
||||
|
||||
_plyrGroup = _arr select 10;
|
||||
_canBeRevived = _arr select 11;
|
||||
|
||||
_server_vars = _arr select 3;
|
||||
_vars = _arr select 4;
|
||||
|
||||
_hitpoints = _vars select 11;
|
||||
|
||||
_deadPlayer = ["PlayerStats", _plyrUID, 0] call EPOCH_fnc_server_hiveGETBIT;
|
||||
@ -76,6 +109,7 @@ if (typename _this == "ARRAY") then {
|
||||
};
|
||||
} forEach allUnits;
|
||||
|
||||
// find existing group
|
||||
if (_plyrGroup != "") then {
|
||||
{
|
||||
if ((_x getVariable["GROUP", ""]) == _plyrGroup) exitWith{
|
||||
@ -117,6 +151,15 @@ if (typename _this == "ARRAY") then {
|
||||
_backpack = _apperance select 3;
|
||||
_uniform = _apperance select 4;
|
||||
|
||||
// Weapons
|
||||
_weaponsAndItems = _arr select 5;
|
||||
_linkedItems = _arr select 6;
|
||||
_normalMagazines = _arr select 7;
|
||||
_itemsInContainers = _arr select 8;
|
||||
_weaponsInContainers = _arr select 9;
|
||||
};
|
||||
|
||||
// Load Apperance START
|
||||
if (_uniform != "") then {
|
||||
_newPlyr addUniform _uniform;
|
||||
};
|
||||
@ -132,16 +175,14 @@ if (typename _this == "ARRAY") then {
|
||||
if (_vest != "") then {
|
||||
_newPlyr addVest _vest;
|
||||
};
|
||||
// Load Apperance END
|
||||
|
||||
// Weapons
|
||||
_weaponsAndItems = _arr select 5;
|
||||
// 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 = [];
|
||||
@ -151,28 +192,22 @@ if (typename _this == "ARRAY") then {
|
||||
if (typeName(_x) == "ARRAY") then{
|
||||
_wMags = true;
|
||||
_wMagsArray = _x;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// attachments
|
||||
if (_x != "") then{
|
||||
_attachments pushBack _x;
|
||||
};
|
||||
};
|
||||
} forEach _x;
|
||||
|
||||
// add weapon if equiped
|
||||
if (_weapon in _equipped) then {
|
||||
|
||||
_equipped = _equipped - [_weapon];
|
||||
|
||||
if (_wMags) then {
|
||||
_newPlyr addMagazine _wMagsArray;
|
||||
};
|
||||
|
||||
if (_weapon != "") then {
|
||||
_newPlyr addWeapon _weapon;
|
||||
};
|
||||
|
||||
switch _type do {
|
||||
case 1: { // primary
|
||||
removeAllPrimaryWeaponItems _newPlyr;
|
||||
@ -187,69 +222,41 @@ if (typename _this == "ARRAY") then {
|
||||
{
|
||||
_newPlyr removeSecondaryWeaponItem _x;
|
||||
} forEach (secondaryWeaponItems _newPlyr);
|
||||
|
||||
{ _newPlyr addSecondaryWeaponItem _x } forEach _attachments;
|
||||
};
|
||||
};
|
||||
}
|
||||
else { // overflow need to add these items to storage
|
||||
} else {
|
||||
// overflow need to add these items to storage
|
||||
{
|
||||
_newPlyr addItem _x;
|
||||
} forEach _attachments;
|
||||
|
||||
if (_wMags) then {
|
||||
_newPlyr addMagazine _wMagsArray;
|
||||
};
|
||||
};
|
||||
} forEach(_weaponsAndItems select 1);
|
||||
|
||||
_currWeap = _weaponsAndItems select 0;
|
||||
};
|
||||
|
||||
// Linked items
|
||||
{
|
||||
if (_x in["Binocular", "Rangefinder"]) then {
|
||||
_newPlyr addWeapon _x;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
_newPlyr linkItem _x;
|
||||
};
|
||||
} forEach(_arr select 6);
|
||||
} forEach _linkedItems;
|
||||
diag_log format["DEBUG (Load Player) _linkedItems: %1", _linkedItems];
|
||||
|
||||
// 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);
|
||||
[_newPlyr, _itemsInContainers] call _fnc_addItemToX;
|
||||
|
||||
// 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);
|
||||
[_newPlyr, _weaponsInContainers] call _fnc_addItemToX;
|
||||
|
||||
// Add magazines
|
||||
{
|
||||
_newPlyr addMagazine _x;
|
||||
} forEach(_arr select 7);
|
||||
};
|
||||
{_newPlyr addMagazine _x} forEach _normalMagazines;
|
||||
// Load inventory + defaults END
|
||||
|
||||
// Final Push
|
||||
if (isNull _plyr) then {
|
||||
@ -293,9 +300,6 @@ if (typename _this == "ARRAY") then {
|
||||
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["PUID", _plyrUID];
|
||||
|
||||
|
@ -248,6 +248,6 @@ if (_immuneVehicleSpawn) then{
|
||||
|
||||
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
|
||||
|
@ -94,13 +94,13 @@ _configArray = [
|
||||
EPOCH_fnc_returnConfigEntry = {
|
||||
private["_defaultData", "_config", "_varData"];
|
||||
_defaultData = _this select 2;
|
||||
_config = (_this select 0) >> (_this select 1);
|
||||
if (isClass(_this select 0)) then{
|
||||
_config = (_this select 0) >> (_this select 1);
|
||||
_varData = switch (typeName _defaultData) do {
|
||||
case "SCALAR": {getNumber _config};
|
||||
case "BOOL": {(getNumber _config) == 1};
|
||||
case "ARRAY": {getArray _config};
|
||||
case "STRING": {getText _config};
|
||||
case "SCALAR": {if (isNumber (_config)) then { getNumber _config } else {_defaultData} };
|
||||
case "BOOL": {if (isText (_config)) then { (getText _config) isEqualTo "true" } else {_defaultData} };
|
||||
case "ARRAY": {if (isArray (_config)) then { getArray _config } else {_defaultData} };
|
||||
case "STRING": {if (isText (_config)) then { getText _config } else {_defaultData} };
|
||||
default {_defaultData};
|
||||
};
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user