Merge branch 'experimental' of https://github.com/EpochModTeam/Epoch into experimental

This commit is contained in:
Raymix 2017-07-24 21:26:10 +01:00
commit c9e382c1b4
11 changed files with 91 additions and 26 deletions

View File

@ -113,9 +113,14 @@ _say3dsounds = "isClass _x" configClasses (_say3dsoundsConfig);
disableRemoteSensors (["CfgEpochClient", "disableRemoteSensors", true] call EPOCH_fnc_returnConfigEntryV2);
// Enable Dynamic simulation on both server and clients (maybe only needed server side)
// DynSim is handled locally and yes server and clients will need these configurations
enableDynamicSimulationSystem true;
"Group" setDynamicSimulationDistance 1600;
"Vehicle" setDynamicSimulationDistance 1600;
"EmptyVehicle" setDynamicSimulationDistance 1600;
"Prop" setDynamicSimulationDistance 1600;
"IsMoving" setDynamicSimulationDistanceCoef 1.5;
_dynSimToggle = ["CfgDynamicSimulation", "enableDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2;
enableDynamicSimulationSystem _dynSimToggle;
if(_dynSimToggle)then
{
_cfgDynamicSimulation = 'CfgDynamicSimulation' call EPOCH_returnConfig;
"IsMoving" setDynamicSimulationDistanceCoef getNumber(_cfgDynamicSimulation >> "isMovingCoefValue");
"Group" setDynamicSimulationDistance getNumber(_cfgDynamicSimulation >> "groupDynSimDistance");
"Vehicle" setDynamicSimulationDistance getNumber(_cfgDynamicSimulation >> "vehicleDynSimDistance");
"EmptyVehicle" setDynamicSimulationDistance getNumber(_cfgDynamicSimulation >> "emptyVehicleDynSimDistance");
"Prop" setDynamicSimulationDistance getNumber(_cfgDynamicSimulation >> "propDynSimDistance");
};

View File

@ -0,0 +1,16 @@
class CfgDynamicSimulation
{
//If this is false none of the below settings matter
enableDynamicSimulationSystem = true;
//Individual toggles for testing
vehicleDynamicSimulationSystem = true; // type car, air, boat
playerDynamicSimulationSystem = true; // clients
baseDynamicSimulationSystem = true; // plot pole and base pieces
// Distances and Coef
groupDynSimDistance = 1600;
vehicleDynSimDistance = 1600;
emptyVehicleDynSimDistance = 1600;
propDynSimDistance = 1600;
};

View File

@ -76,6 +76,7 @@ disableRandomization[] = {"All"};
#include "Configs\CfgSwitchMovehandler.hpp"
#include "Configs\CfgVehicleUpgrades.hpp"
#include "Configs\CfgReadingDocuments.hpp"
#include "Configs\CfgDynamicSimulation.hpp"
// A3 specific configs
#include "Configs\CfgFunctions.hpp"

View File

@ -93,9 +93,12 @@ for "_i" from 0 to _this do {
_baseObj setposATL _location;
// new Dynamicsimulation
_baseObj enableSimulationGlobal false; // turn off sim on server start, let dynSim activate it to true
_baseObj enableDynamicSimulation true;
_baseObj triggerDynamicSimulation false; // this object doesnt need to turn anything on in the server
if(["CfgDynamicSimulation", "baseDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then
{
_baseObj enableSimulationGlobal false; // turn off sim on server start, let dynSim activate it to true
_baseObj enableDynamicSimulation true;
_baseObj triggerDynamicSimulation false; // this object doesnt need to turn anything on in the server
};
// spawn additional object for trap
_ammoClass = (_cfgBaseBuilding >> _class >> "ammoClass");

View File

@ -11,9 +11,12 @@ if (!isNull _object && !(_class isEqualTo "")) then {
_object hideObjectGlobal true;
// new Dynamicsimulation
_newObj enableDynamicSimulation true;
_newObj triggerDynamicSimulation false; // this object doesnt need to turn anything on in the server
if(["CfgDynamicSimulation", "baseDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then
{
_newObj enableDynamicSimulation true;
_newObj triggerDynamicSimulation false; // this object doesnt need to turn anything on in the server
};
switch (_method) do {
case 0: {
_newObj setVectorDirAndUp [vectordir _object, vectorup _object];

View File

@ -320,8 +320,11 @@ if (!isNull _player) then {
_newPlyr setUnitLoadout (getUnitLoadout _newPlyr); // if this works, possibly replace all inventory code with with get|setUnitLoadout
// new Dynamicsimulation
_newPlyr enableDynamicSimulation true;
_newPlyr triggerDynamicSimulation true;
if(["CfgDynamicSimulation", "playerDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then
{
_newPlyr enableDynamicSimulation true;
_newPlyr triggerDynamicSimulation true;
};
};
} else {
diag_log format["LOGIN FAILED UNIT NULL: %1 [%2|%3]", _player, _group, count allgroups];

View File

@ -112,8 +112,11 @@ if (!local _player) then {
_newPlyr = _group createUnit[_class, _location, [], 0, "CAN_COLLIDE"];
// new Dynamicsimulation
_newPlyr enableDynamicSimulation true;
_newPlyr triggerDynamicSimulation true;
if(["CfgDynamicSimulation", "playerDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then
{
_newPlyr enableDynamicSimulation true;
_newPlyr triggerDynamicSimulation true;
};
addToRemainsCollector[_newPlyr];

View File

@ -13,7 +13,7 @@
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_server/EPOCH_server_createTeleport.sqf
*/
//[[[cog import generate_private_arrays ]]]
private ["_array","_center","_class","_cloneClasses","_config","_deSimulate","_debug","_debug1","_debugLocation","_dir","_enterClass","_ep","_exitClass","_light","_lightLocation","_loadBaseTemplateConfig","_markerName","_part","_partPos","_pos","_pos1","_pro1","_pro2","_protection","_useWorldPos","_veh1","_veh2"];
private ["_array","_center","_class","_cloneClasses","_config","_deSimulate","_debug","_debug1","_debugLocation","_dir","_dir1","_dir2","_enterClass","_ep","_exitClass","_light","_lightLocation","_loadBaseTemplateConfig","_markerName","_part","_partPos","_pos","_pos1","_pro1","_pro2","_protection","_useWorldPos","_veh1","_veh2"];
//[[[end]]]
_loadBaseTemplateConfig = {
private ["_partPos","_part","_array","_center","_deSimulate"];
@ -110,12 +110,24 @@ _config = configFile >> "CfgEpoch";
_useWorldPos = (_x select 4) isEqualTo "true";
};
_pos1 = _x select 1;
// allow forth position element to set direction if set
_dir1 = 0;
_dir2 = 0;
if (count _pos1 >= 4) then {
_dir1 = _pos1 deleteAt 3;
};
if !(_useWorldPos) then {
_pos1 = _debug modelToWorld (_x select 1);
_pos1 = _debug modelToWorld _pos1;
};
_exitClass = _x select 2;
_pos = _x select 3;
// allow forth position element to set direction if set
if (count _pos >= 4) then {
_dir2 = _pos deleteAt 3;
};
// load template props for marker location
if (_pos isEqualType "") then {
@ -126,20 +138,30 @@ _config = configFile >> "CfgEpoch";
_pro2 = createVehicle ["ProtectionZone_Invisible_F", _pos, [], 0, "CAN_COLLIDE"];
};
_pro1 = createVehicle ["ProtectionZone_Invisible_F", _pos1, [], 0, "CAN_COLLIDE"];
_veh1 = createVehicle[_enterClass, _pos1, [], 0, "CAN_COLLIDE"];
// force addaction on any other objects that are not setup properly
if !(_veh1 isKindOf "Transport_EPOCH") then {
[_veh1, [(localize "STR_EPOCH_Teleport"), {(_this select 0) call EPOCH_EnterBuilding}, [], 1, true, true, "Action", "alive _target", 3, false, ""]] remoteExec ["addAction", -2, _veh1, true];
};
_veh1 enableSimulationGlobal false;
_veh1 allowDamage false;
_veh1 setVariable["ParentBuilding", _pos];
_veh1 setDir 0;
_veh1 setDir _dir1;
_veh1 setposATL _pos1;
if (_exitClass != "") then {
_veh2 = createVehicle[_exitClass, _pos, [], 0, "CAN_COLLIDE"];
// force addaction on any other objects that are not setup properly
if !(_veh2 isKindOf "Transport_EPOCH") then {
[_veh2, [(localize "STR_EPOCH_Teleport"), {(_this select 0) call EPOCH_EnterBuilding}, [], 1, true, true, "Action", "alive _target", 3, false, ""]] remoteExec ["addAction", -2, _veh1, true];
};
_veh2 enableSimulationGlobal false;
_veh2 allowDamage false;
_veh2 setVariable["ParentBuilding", _pos1];
_veh2 setDir 0;
_veh2 setDir _dir2;
_veh2 setposATL _pos;
};

View File

@ -213,8 +213,11 @@ for "_i" from 1 to _maxVehicleLimit do {
};
// new Dynamicsimulation
_vehicle enableSimulationGlobal false; // turn it off until activated by dynamicSim
_vehicle enableDynamicSimulation true;
if(["CfgDynamicSimulation", "vehicleDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then
{
_vehicle enableSimulationGlobal false; // turn it off until activated by dynamicSim
_vehicle enableDynamicSimulation true;
};
// turrets
/*

View File

@ -99,8 +99,11 @@ if !(_allHitpoints isEqualTo []) then{
};
// new Dynamicsimulation
_newveh enableSimulationGlobal false; // turn it off until activated by dynamicSim
_newveh enableDynamicSimulation true;
if(["CfgDynamicSimulation", "vehicleDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then
{
_newveh enableSimulationGlobal false; // turn it off until activated by dynamicSim
_newveh enableDynamicSimulation true;
};
// add back old inventory

View File

@ -109,8 +109,11 @@ if !(isNull _vehObj) then{
};
// new Dynamicsimulation
_vehObj enableSimulationGlobal false; // turn it off until activated by dynamicSim
_vehObj enableDynamicSimulation true;
if(["CfgDynamicSimulation", "vehicleDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then
{
_vehObj enableSimulationGlobal false; // turn it off until activated by dynamicSim
_vehObj enableDynamicSimulation true;
};
// SAVE VEHICLE