Merge pull request #53 from ravmustang/master

Added DynSim Toggle
This commit is contained in:
eraser1 2017-04-25 21:05:02 -05:00 committed by GitHub
commit 1a24429301
13 changed files with 107 additions and 19 deletions

View File

@ -104,8 +104,14 @@ if !(_crate getVariable ["DMS_CrateGodMode",DMS_GodmodeCrates]) then
{
_crate allowDamage true;
};
_crate enableSimulationGlobal true;
if(dynamicSimulationSystemEnabled)then
{
_crate enableDynamicSimulation true;
}
else
{
_crate enableSimulationGlobal true;
};
if (_crate getVariable ["DMS_CrateEnableRope",DMS_EnableBoxMoving]) then
{
_crate enableRopeAttach true;

View File

@ -20,7 +20,10 @@
{
{
_x enableSimulationGlobal true;
(vehicle _x) enableSimulationGlobal true;
if!(dynamicSimulationEnabled (vehicle _x))then
{
(vehicle _x) enableSimulationGlobal true;
};
} forEach _units;
_x setVariable ["DMS_isGroupFrozen",false];
@ -81,7 +84,10 @@
{
{
_x enableSimulationGlobal false;
(vehicle _x) enableSimulationGlobal false;
if!(dynamicSimulationEnabled (vehicle _x))then
{
(vehicle _x) enableSimulationGlobal false;
};
} forEach _units;
_x setVariable ["DMS_isGroupFrozen",true];

View File

@ -24,7 +24,10 @@ if (_freeze) then
{
{
_x enableSimulationGlobal false;
(vehicle _x) enableSimulationGlobal false;
if!(dynamicSimulationEnabled (vehicle _x))then
{
(vehicle _x) enableSimulationGlobal false;
};
} forEach (units _group);
_group setVariable ["DMS_isGroupFrozen",true];
@ -33,7 +36,10 @@ else
{
{
_x enableSimulationGlobal true;
(vehicle _x) enableSimulationGlobal true;
if!(dynamicSimulationEnabled (vehicle _x))then
{
(vehicle _x) enableSimulationGlobal true;
};
} forEach (units _group);
_group setVariable ["DMS_isGroupFrozen",false];

View File

@ -51,7 +51,14 @@ private _objs = _export apply
{
// Create the object
private _obj = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
_obj enableSimulationGlobal false;
if(dynamicSimulationSystemEnabled)then
{
_obj enableDynamicSimulation true;
}
else
{
_obj enableSimulationGlobal false;
};
// Calculate the object's position using provided relative position
private _objPos = [_pos,_x select 1] call DMS_fnc_CalcPos;

View File

@ -52,7 +52,14 @@ private _objs = _export apply
private _object = (_x select 0) createVehicle [0,0,0];
_object setDir (_x select 2);
_object setPosATL (_center vectorAdd (_x select 1));
_object enableSimulationGlobal ((_x select 3) select 0);
if(dynamicSimulationSystemEnabled)then
{
_object enableDynamicSimulation true;
}
else
{
_object enableSimulationGlobal ((_x select 3) select 0);
};
_object allowDamage ((_x select 3) select 1);
_object;
};

View File

@ -55,7 +55,14 @@ private _objs = _export apply
_object setPosASL ((_x select 1) vectorAdd [0,0,5000]);
_object setVectorDirAndUp (_x select 2);
_object enableSimulationGlobal ((_x select 3) select 0);
if(dynamicSimulationSystemEnabled)then
{
_object enableDynamicSimulation true;
}
else
{
_object enableSimulationGlobal ((_x select 3) select 0);
};
_object allowDamage ((_x select 3) select 1);
_object;

View File

@ -49,7 +49,14 @@ private _objs = _export apply
_object setPosASL (_x select 1);
_object setVectorDirAndUp (_x select 2);
_object enableSimulationGlobal ((_x select 3) select 0);
if(dynamicSimulationSystemEnabled)then
{
_object enableDynamicSimulation true;
}
else
{
_object enableSimulationGlobal ((_x select 3) select 0);
};
_object allowDamage ((_x select 3) select 1);
_object;

View File

@ -52,7 +52,14 @@ if ((isNil "_export") || {!(_export isEqualType [])}) exitWith
private _objs = _export apply
{
private _obj = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
_obj enableSimulationGlobal false;
if(dynamicSimulationSystemEnabled)then
{
_object enableDynamicSimulation true;
}
else
{
_object enableSimulationGlobal false;
};
private _pos = (_x select 1) vectorAdd [0,0,5000];

View File

@ -46,7 +46,14 @@ if ((isNil "_export") || {!(_export isEqualType [])}) exitWith
private _objs = _export apply
{
private _obj = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
_obj enableSimulationGlobal false;
if(dynamicSimulationSystemEnabled)then
{
_obj enableDynamicSimulation true;
}
else
{
_obj enableSimulationGlobal false;
};
private _pos = _x select 1;

View File

@ -142,7 +142,10 @@
{
_x allowDamage true;
_x enableRopeAttach true;
_x enableSimulationGlobal true;
if!(dynamicSimulationEnabled _x)then
{
_x enableSimulationGlobal true;
};
if (_x getVariable ["ExileIsPersistent", false]) then
{
@ -162,7 +165,7 @@
_x lock 1;
};
_x call ExileServer_system_simulationMonitor_addVehicle;
//_x call ExileServer_system_simulationMonitor_addVehicle;
} forEach _vehs;
{

View File

@ -143,7 +143,10 @@
{
_x allowDamage true;
_x enableRopeAttach true;
_x enableSimulationGlobal true;
if!(dynamicSimulationEnabled _x)then
{
_x enableSimulationGlobal true;
};
if (_x getVariable ["ExileIsPersistent", false]) then
{
@ -163,7 +166,7 @@
_x lock 1;
};
_x call ExileServer_system_simulationMonitor_addVehicle;
//_x call ExileServer_system_simulationMonitor_addVehicle;
} forEach _vehs;
{

View File

@ -105,7 +105,14 @@ if (!(_grpUnits isEqualTo []) && {(leader _grp) isEqualTo _unit}) then
private _av = _unit getVariable ["DMS_AssignedVeh",objNull];
if (!isNull _av) then
{
_av enableSimulationGlobal true;
if(dynamicSimulationSystemEnabled)then
{
_av enableDynamicSimulation true;
}
else
{
_av enableSimulationGlobal true;
};
// Determine whether or not the vehicle has any active crew remaining.
private _memCount = {[(alive _x),false] select (_unit isEqualTo _x);} count (crew _av);
@ -149,8 +156,16 @@ if (!isNull _av) then
[_av, 1] remoteExecCall ["lock", _av];
};
_av call ExileServer_system_simulationMonitor_addVehicle;
//_av call ExileServer_system_simulationMonitor_addVehicle;
if(dynamicSimulationSystemEnabled)then
{
_av enableDynamicSimulation true;
}
else
{
_av enableSimulationGlobal true;
};
_av setVariable ["ExileMoney",0,true];
_av setVariable ["ExileIsPersistent", false];
_av addMPEventHandler ["MPKilled", { if (isServer) then {_this call ExileServer_object_vehicle_event_onMPKilled;};}];

View File

@ -85,7 +85,14 @@ if (!isNil "AVS_Version") then
_vehObj lock 2;
_vehObj allowDamage false;
_vehObj enableRopeAttach false;
_vehObj enableSimulationGlobal false;
if(dynamicSimulationSystemEnabled)then
{
_vehObj enableDynamicSimulation true;
}
else
{
_vehObj enableSimulationGlobal false;
};
if (DMS_DEBUG) then