diff --git a/Sources/epoch_code/init/both_init.sqf b/Sources/epoch_code/init/both_init.sqf index d8b48586..f2cd737c 100644 --- a/Sources/epoch_code/init/both_init.sqf +++ b/Sources/epoch_code/init/both_init.sqf @@ -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; \ No newline at end of file diff --git a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf index 038f6b2a..478e8c21 100644 --- a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf +++ b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf @@ -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 { diff --git a/Sources/epoch_server/compile/epoch_bases/EPOCH_swapBuilding.sqf b/Sources/epoch_server/compile/epoch_bases/EPOCH_swapBuilding.sqf index 12b2c0a4..d37ae116 100644 --- a/Sources/epoch_server/compile/epoch_bases/EPOCH_swapBuilding.sqf +++ b/Sources/epoch_server/compile/epoch_bases/EPOCH_swapBuilding.sqf @@ -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]; diff --git a/Sources/epoch_server/compile/epoch_player/EPOCH_server_loadPlayer.sqf b/Sources/epoch_server/compile/epoch_player/EPOCH_server_loadPlayer.sqf index 2a36498b..9bfe4921 100644 --- a/Sources/epoch_server/compile/epoch_player/EPOCH_server_loadPlayer.sqf +++ b/Sources/epoch_server/compile/epoch_player/EPOCH_server_loadPlayer.sqf @@ -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]; diff --git a/Sources/epoch_server/compile/epoch_player/EPOCH_server_revivePlayer.sqf b/Sources/epoch_server/compile/epoch_player/EPOCH_server_revivePlayer.sqf index c9eb7e93..fe96b5ba 100644 --- a/Sources/epoch_server/compile/epoch_player/EPOCH_server_revivePlayer.sqf +++ b/Sources/epoch_server/compile/epoch_player/EPOCH_server_revivePlayer.sqf @@ -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]; { diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf index 33f7a5ba..e9237b5e 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf @@ -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]; diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_server_upgrade_vehicle.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_server_upgrade_vehicle.sqf index 42a28a0d..3e4a9887 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_server_upgrade_vehicle.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_server_upgrade_vehicle.sqf @@ -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; diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_spawn_vehicle.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_spawn_vehicle.sqf index c8b7412c..021566e3 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_spawn_vehicle.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_spawn_vehicle.sqf @@ -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;