From bf9dc49be2ceb0644b1c67dcbe8d5db655d18de1 Mon Sep 17 00:00:00 2001 From: worldwidesorrow Date: Fri, 22 Nov 2019 11:50:11 -0600 Subject: [PATCH] Add option for VectorUp on spawned objects. Some of the objects used in POIs require the use of the setVectorUp command in order to maintain an upright orientation on a sloped surface. This addition adds the option for including the object's up vector in the compact arrays. Test file: https://github.com/worldwidesorrow/Svetlojarsk --- SQF/dayz_code/compile/fn_spawnObjects.sqf | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/SQF/dayz_code/compile/fn_spawnObjects.sqf b/SQF/dayz_code/compile/fn_spawnObjects.sqf index e09de606c..e0279d882 100644 --- a/SQF/dayz_code/compile/fn_spawnObjects.sqf +++ b/SQF/dayz_code/compile/fn_spawnObjects.sqf @@ -15,9 +15,9 @@ Params: [ [ - ["ObjectType1", [position], dir], - ["ObjectType2", [position], dir], - ["ObjectType3", [position], dir] + ["ObjectType1", [position], dir, vectorUp(optional)], + ["ObjectType2", [position], dir, vectorUp(optional)], + ["ObjectType3", [position], dir, vectorUp(optional)] ], false, // Block damage false, // Use setPosATL instead of setPos @@ -63,8 +63,12 @@ _fires = [ _object setPos (_x select 1); }; + if (count _x > 3) then { + _object setVectorUp (_x select 3); + }; + if (_blockDamage) then { _object addEventHandler ["HandleDamage",{0}]; if !(_type in _fires) then {_object enableSimulation false;}; }; -} forEach _objects; \ No newline at end of file +} forEach _objects;