DynSim #3 Configs
This commit is contained in:
vbawol 2017-07-24 12:50:38 -05:00 committed by GitHub
commit 10a762b541
10 changed files with 65 additions and 22 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

@ -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