Dynamic Simulation #1
This commit is contained in:
vbawol 2017-07-17 04:46:35 -05:00 committed by GitHub
commit 312868bc70
8 changed files with 41 additions and 5 deletions

View File

@ -112,4 +112,10 @@ _say3dsounds = "isClass _x" configClasses (_say3dsoundsConfig);
// disable remote sensors on server and client as all Epoch AI is local to the side controlling it.
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;

View File

@ -92,7 +92,11 @@ for "_i" from 0 to _this do {
_baseObj setVectorDirAndUp _worldspace;
_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
// spawn additional object for trap
_ammoClass = (_cfgBaseBuilding >> _class >> "ammoClass");
if(isText _ammoClass) then {

View File

@ -9,7 +9,11 @@ if (!isNull _object && !(_class isEqualTo "")) then {
_newObj = createVehicle [_class, ASLtoAGL _objectPos, [], 0, "CAN_COLLIDE"];
if (!isNull _newObj) then {
_object hideObjectGlobal true;
// new Dynamicsimulation
_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

@ -318,7 +318,10 @@ if (!isNull _player) then {
// This is a test to see setUnitLoadout can force propagation of unit loadout.
_newPlyr setUnitLoadout (getUnitLoadout _newPlyr); // if this works, possibly replace all inventory code with with get|setUnitLoadout
// new Dynamicsimulation
_newPlyr enableDynamicSimulation true;
_newPlyr triggerDynamicSimulation true;
};
} else {
diag_log format["LOGIN FAILED UNIT NULL: %1 [%2|%3]", _player, _group, count allgroups];

View File

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

View File

@ -212,8 +212,13 @@ for "_i" from 1 to _maxVehicleLimit do {
// vehicle simulation handler
if (_simulationHandler) then{
_vehicle enableDynamicSimulation true;
_vehicle enableSimulationGlobal false;
};
// new Dynamicsimulation
_vehObj enableSimulationGlobal false; // turn it off until activated by dynamicSim
_vehObj enableDynamicSimulation true;
// turrets
/*
_mags = _vehicle magazinesTurret [0];

View File

@ -98,6 +98,11 @@ if !(_allHitpoints isEqualTo []) then{
};
};
// new Dynamicsimulation
_vehObj enableSimulationGlobal false; // turn it off until activated by dynamicSim
_vehObj enableDynamicSimulation true;
// add back old inventory
[_newveh,_cargo] call EPOCH_server_CargoFill;

View File

@ -107,7 +107,12 @@ if !(isNull _vehObj) then{
_vehLockHiveKey = format["%1:%2", (call EPOCH_fn_InstanceID), _slot];
["VehicleLock", _vehLockHiveKey] call EPOCH_fnc_server_hiveDEL;
};
// new Dynamicsimulation
_vehObj enableSimulationGlobal false; // turn it off until activated by dynamicSim
_vehObj enableDynamicSimulation true;
// SAVE VEHICLE
_vehObj call EPOCH_server_save_vehicle;