Jump to content

[Release] Build Vectors - Rotate objects in Dayz Epoch (v2.34 P4L & non-P4L)


striker

Recommended Posts

_object setdir _dir;
 
if(_vecExists)then{
_object setVe>
 0:12:19   Error position: <_dir;
 
if(_vecExists)then{
_object setVe>
 0:12:19   Error Undefined variable in expression: _dir
 0:12:19 File z\addons\dayz_server\system\server_monitor.sqf, line 286
 0:12:19 "MOVED OBJ: "8028" of class CinderWallHalf_DZ to pos: [5633.62,5325.89,0]"
 0:12:19 Error in expression <eCargoGlobal  _object;

Some Buildings move away
Link to comment
Share on other sites

have installed this mod several times and back dated the server every time for clean installs and get the same problem every install. When you press the space bar to build it , it cancels instead cant figure it out any help would be much appreciated.  

If your using the version with admin build and p4l, make sure to put the admin build in the init.sqf, even if you don't plan on using it, I did it and it solved my issue with the canceled building

Link to comment
Share on other sites

@striker

So finally^^, sorry for the late reply, had stuff to do.

 

Here's my Menu, with the features you mentioned.

 

The snapVectorMenu.sqf

if (isNil "SnapVectorBuildCallbackFunc") then {
	SnapVectorBuildPitchMenuArrays = [
		["Reset",[],"",-5,[["expression","SnapVectorBuildSetPitchInProgress = true; ['reset'] execVM 'scripts\snapBuild\player_vectorChange.sqf'; SnapVectorBuildPitchMenuFirstOne = 0; ['Pitch'] spawn SnapVectorBuildCallbackFunc;"]],"1","1"],
		["Pitch Forward",[],"",-5,[["expression","SnapVectorBuildSetPitchInProgress = true; ['forward'] execVM 'scripts\snapBuild\player_vectorChange.sqf'; SnapVectorBuildPitchMenuFirstOne = 1; ['Pitch'] spawn SnapVectorBuildCallbackFunc;"]],"1","1"],
		["Pitch Back",[],"",-5,[["expression","SnapVectorBuildSetPitchInProgress = true; ['back'] execVM 'scripts\snapBuild\player_vectorChange.sqf'; SnapVectorBuildPitchMenuFirstOne = 2; ['Pitch'] spawn SnapVectorBuildCallbackFunc;"]],"1","1"],
		["Pitch Left",[],"",-5,[["expression","SnapVectorBuildSetPitchInProgress = true; ['left'] execVM 'scripts\snapBuild\player_vectorChange.sqf'; SnapVectorBuildPitchMenuFirstOne = 3; ['Pitch'] spawn SnapVectorBuildCallbackFunc;"]],"1","1"],
		["Pitch Right",[],"",-5,[["expression","SnapVectorBuildSetPitchInProgress = true; ['right'] execVM 'scripts\snapBuild\player_vectorChange.sqf'; SnapVectorBuildPitchMenuFirstOne = 4; ['Pitch'] spawn SnapVectorBuildCallbackFunc;"]],"1","1"]
	];
	
	SnapVectorBuildSnappingFunc = {
		["","","",[_this select 0, SnapVectorBuildSnapArray select 0, SnapVectorBuildSnapArray select 1, SnapVectorBuildSnapArray select 2, _this select 1]] spawn snap_build;
	};

	SnapVectorBuildCallbackFunc = {
		switch (_this select 0) do {
			case "Pitch" : {
				waitUntil { !SnapVectorBuildSetPitchInProgress && !SnapVectorBuildVectorChangeInProgress };
				
				SnapVectorBuildPitchMenu = 
				[
				["",true],
					["-- Pitch Object Menu --", [],  "", -2, [["expression", ""]], "1", "0"],
					[format ["-- Cur Pitch %1 --", DZE_curPitch], [],  "", -2, [["expression", ""]], "1", "0"]
				];
				
				SnapVectorBuildPitchMenu = SnapVectorBuildPitchMenu + [SnapVectorBuildPitchMenuArrays select SnapVectorBuildPitchMenuFirstOne];
				
				for "_y" from 0 to (count SnapVectorBuildPitchMenuArrays) - 1 do {
					if (_y != SnapVectorBuildPitchMenuFirstOne) then { SnapVectorBuildPitchMenu = SnapVectorBuildPitchMenu + [SnapVectorBuildPitchMenuArrays select _y]; };
				};
				
				SnapVectorBuildPitchMenu = SnapVectorBuildPitchMenu + [
					["", [], "", -5, [["expression", ""]], "1", "0"],
					["Set Pitch Degree Menu >>", [], "", -5, [["expression", "['SetDegree'] spawn SnapVectorBuildCallbackFunc;"]], "1", "1"],
					["Select Snapping Menu >>", [], "", -5, [["expression", "['SelectSnap'] spawn SnapVectorBuildCallbackFunc;"]], "1", "1"],
					["", [], "", -5, [["expression", ""]], "1", "0"],
					["Exit", [13], "", -3, [["expression", ""]], "1", "1"]
				];
			
				showCommandingMenu "#USER:SnapVectorBuildPitchMenu";
			};
			case "SetDegree" : {
				waitUntil { !SnapVectorBuildVectorChangeInProgress };
				
				SnapVectorBuildSetDegreeMenu = 
				[
				["",true],
					["-- Set Pitch Degree Menu --", [],  "", -2, [["expression", ""]], "1", "0"],
					[format ["-- Cur Pitch %1 --", DZE_curPitch], [],  "", -2, [["expression", ""]], "1", "0"],
					["Set to 1 degree",[],"",-5,[["expression","SnapVectorBuildVectorChangeInProgress = true; ['1'] execVM 'scripts\snapBuild\player_vectorChange.sqf'; ['Pitch'] spawn SnapVectorBuildCallbackFunc;"]],"1","1"],
					["Set to 5 degree",[],"",-5,[["expression","SnapVectorBuildVectorChangeInProgress = true; ['5'] execVM 'scripts\snapBuild\player_vectorChange.sqf'; ['Pitch'] spawn SnapVectorBuildCallbackFunc;"]],"1","1"],
					["Set to 15 degree",[],"",-5,[["expression","SnapVectorBuildVectorChangeInProgress = true; ['15'] execVM 'scripts\snapBuild\player_vectorChange.sqf'; ['Pitch'] spawn SnapVectorBuildCallbackFunc;"]],"1","1"],
					["Set to 30 degree",[],"",-5,[["expression","SnapVectorBuildVectorChangeInProgress = true; ['30'] execVM 'scripts\snapBuild\player_vectorChange.sqf'; ['Pitch'] spawn SnapVectorBuildCallbackFunc;"]],"1","1"],
					["Set to 45 degree",[],"",-5,[["expression","SnapVectorBuildVectorChangeInProgress = true; ['45'] execVM 'scripts\snapBuild\player_vectorChange.sqf'; ['Pitch'] spawn SnapVectorBuildCallbackFunc;"]],"1","1"],
					["Set to 90 degree",[],"",-5,[["expression","SnapVectorBuildVectorChangeInProgress = true; ['90'] execVM 'scripts\snapBuild\player_vectorChange.sqf'; ['Pitch'] spawn SnapVectorBuildCallbackFunc;"]],"1","1"],
						["", [], "", -5, [["expression", ""]], "1", "0"],
						["Pitch Object Menu >>", [], "", -5, [["expression", "['Pitch'] spawn SnapVectorBuildCallbackFunc;"]], "1", "1"],
						["Select Snapping Menu >>", [], "", -5, [["expression", "['SelectSnap'] spawn SnapVectorBuildCallbackFunc;"]], "1", "1"],
						["", [], "", -5, [["expression", ""]], "1", "0"],
						["Exit", [13], "", -3, [["expression", ""]], "1", "1"]
				];
				
				showCommandingMenu "#USER:SnapVectorBuildSetDegreeMenu";
			};
			case "SelectSnap" : {
				private ["_cnt","_snapShow"];
				waitUntil { !SnapVectorBuildSnapBuildInProgress };
				
				_snapShow = "OFF";

				if (snapActionState == "ON" || snapActionState == "Auto" || snapActionState == "Manual" || snapActionState == "Selected") then { _snapShow = "ON"; };
				
				SnapVectorBuildSnappingMenu =
				[
				["",true],
					["-- Select Snapping Menu --", [],  "", -2, [["expression", ""]], "1", "0"],
					[format ["Snap: %1",_snapShow], [], "", -5, [["expression", format ["SnapVectorBuildSnapBuildInProgress = true; ['%1',-1] spawn SnapVectorBuildSnappingFunc; ['SelectSnap'] spawn SnapVectorBuildCallbackFunc;", _snapShow]]], "1", "1"]
				];
				
				if (_snapShow == "ON") then {
					SnapVectorBuildSnappingMenu = SnapVectorBuildSnappingMenu + [
						[format ["Snap Point: %1",snapActionStateSelect], [], "", -5, [["expression", format ["SnapVectorBuildSnapBuildInProgress = true; ['%1',-1] spawn SnapVectorBuildSnappingFunc; ['SelectSnap'] spawn SnapVectorBuildCallbackFunc;", snapActionStateSelect]]], "1", "1"]
					];
				};
				
				if (snapActionStateSelect == "Manual" && _snapShow == "ON") then {
					_cnt = 0;
					{
						SnapVectorBuildSnappingMenu = SnapVectorBuildSnappingMenu + [
							[format ["%1)Select: %2",_cnt,_x select 3], [], "", -5, [["expression", format ["SnapVectorBuildSnapBuildInProgress = true; ['Selected',%1] spawn SnapVectorBuildSnappingFunc; ['SelectSnap'] spawn SnapVectorBuildCallbackFunc;", _cnt]]], "1", "1"]
						];
						_cnt = _cnt+1;
					} count ([] + (getArray (missionConfigFile >> "SnapBuilding" >> (SnapVectorBuildSnapArray select 1) >> "points")));
				};
				
				SnapVectorBuildSnappingMenu = SnapVectorBuildSnappingMenu + [
					["", [], "", -5, [["expression", ""]], "1", "0"],
						["Pitch Object Menu >>", [], "", -5, [["expression", "['Pitch'] spawn SnapVectorBuildCallbackFunc;"]], "1", "1"],
						["Set Pitch Degree Menu >>", [], "", -5, [["expression", "['SetDegree'] spawn SnapVectorBuildCallbackFunc;"]], "1", "1"],
						["", [], "", -5, [["expression", ""]], "1", "0"],
						["Exit", [13], "", -3, [["expression", ""]], "1", "1"]
				];
			
				showCommandingMenu "#USER:SnapVectorBuildSnappingMenu";
			};
		};
	};
};

SnapVectorBuildPitchMenuFirstOne = 0;

SnapVectorBuildSnapArray = (_this select 3) select 1;

[(_this select 3) select 0] spawn SnapVectorBuildCallbackFunc;

 

In player_build.sqf add these two Addaction Menus:

s_player_setVectorsPitch = player addaction ["Open Pitch Menu >>","scripts\snapBuild\snapVectorMenu.sqf",["Pitch",[_object,_classname,_objectHelper]],3,false,false];
s_player_setVectorsSetDegree = player addaction ["Open Set Degree Menu >>","scripts\snapBuild\snapVectorMenu.sqf",["SetDegree",[_object,_classname,_objectHelper]],3,false,false];

My player_vectorChange.sqf

private ["_type"];
SnapVectorBuildVectorChangeInProgress = true;	//NEW

_type = _this select 0;	//NEW

switch(_type) do{
	case "reset":
	{
		DZE_memForBack = 0;
		DZE_memLeftRight = 0;
		DZE_updateVec = true;
	};
	case "forward":
	{
		DZE_updateVec = true;
		DZE_memForBack = DZE_memForBack + (DZE_curPitch * -1);

	};
	case "back":
	{
		DZE_updateVec = true;
		DZE_memForBack = DZE_memForBack + DZE_curPitch;

	};
	case "left":
	{
		DZE_updateVec = true;
		DZE_memLeftRight = DZE_memLeftRight + (DZE_curPitch * -1);

	};
	case "right":
	{
		DZE_updateVec = true;
		DZE_memLeftRight = DZE_memLeftRight + DZE_curPitch;

	};
	case "1":
	{
		DZE_curPitch = 1;
	};
	case "5":
	{
		DZE_curPitch = 5;
	};
	//NEW
	case "15":
	{
		DZE_curPitch = 15;
	};
	case "30":
	{
		DZE_curPitch = 30;
	};
	case "45":
	{
		DZE_curPitch = 45;
	};
	//NEW
	case "90":
	{
		DZE_curPitch = 90;
	};
};

SnapVectorBuildVectorChangeInProgress = false;	//NEW

 

And in the snap_build.sqf change the following:

Right below the private command at the top add this

SnapVectorBuildSnapBuildInProgress = true;

Now further down to the bottom.

Change this

[] spawn {
        while {true} do {
            if(!DZE_ActionInProgress || DZE_cancelBuilding) exitWith {call fnc_initSnapPointsCleanup;[0,0,0] call fnc_snapActionCleanup; ["",false] call fnc_initSnapTutorial; snapActionState = "OFF";};
            sleep 2;
            };
        };

to this

[] spawn {
	while {true} do {
		if(!DZE_ActionInProgress) exitWith { call fnc_initSnapPointsCleanup;[0,0,0] call fnc_snapActionCleanup; ["",false] call fnc_initSnapTutorial; snapActionState = "OFF"; showCommandingMenu ""; };	//NEW
		sleep 2;
	};
};

In the case "OFF" statement add this

SnapVectorBuildSnapBuildInProgress = false;	//NEW

right below

[1,1,0] call fnc_snapActionCleanup;

And finally add this

SnapVectorBuildSnapBuildInProgress = false;	//NEW

right at the bottom of the file.

 

 

I'm aware of the feature of addAction commands, with the hideOnUse = false. But I like it more, when you have different sub-menus for each action.

 

I had to add these variables to each file, so that the menu would wait till the action of each file is done, otherwise the changed degree numbers wouldn't directly be shown.

Plus activating the pitch action too quickly several times, could cause issues, i think.

Thats also what could most likely happen with the addAction menus, because with the hideOnUse = false option, you can press these actions really fast after each other... What would cause some issues especially for the pitching action.

 

Let me know, when you find any issues or have some suggestions for improvement.

 

regards

Link to comment
Share on other sites

have installed this mod several times and back dated the server every time for clean installs and get the same problem every install. When you press the space bar to build it , it cancels instead cant figure it out any help would be much appreciated.  

 

Make sure your adding in the

 

//Optional, only if you are using Admin Build

WG_adminBuild = ["","","",""]; //Fill with player UID's

 

Even if you don't populate the array.

 

Had problems saying building cancelled until I put that into my init.

 

Shane

Link to comment
Share on other sites

Help me please,how to do it right

 

is my

 

 

// # NOW SPAWN OBJECTS #
	_ammountOfObject = count (_BuildingQueue + _objectQueue); 
	_theMessage = format ["Spawning %1 objects and vehicles", _ammountOfObject];
	PVDZE_Z_LoadMessage = [_theMessage];
	publicVariable "PVDZE_Z_LoadMessage";
        _currentCount = 0;
        _newMileStone = 20;
	
	_totalvehicles = 0;
	{
		_idKey = 		_x select 1;
		_type =			_x select 2;
		_ownerID = 		_x select 3;

		_worldspace = 	_x select 4;
		_intentory =	_x select 5;
		_hitPoints =	_x select 6;
		_fuel =			_x select 7;
		_damage = 		_x select 8;
		
		_ownerPUID = "001";
		
		_dir = 0;
		_pos = [0,0,0];
		_wsDone = false;
		if (count _worldspace >= 2) then
		{
			_dir = _worldspace select 0;
			if (count (_worldspace select 1) == 3) then {
				_pos = _worldspace select 1;
				_wsDone = true;
			}
		};			
		
		if (!_wsDone) then {
			if (count _worldspace >= 1) then { _dir = _worldspace select 0; };
			_pos = [getMarkerPos "center",0,4000,10,0,2000,0] call BIS_fnc_findSafePos;
			if (count _pos < 3) then { _pos = [_pos select 0,_pos select 1,0]; };
			diag_log ("MOVED OBJ: " + str(_idKey) + " of class " + _type + " to pos: " + str(_pos));
		};
		
		// Realign characterID to OwnerPUID - need to force save though.
		
		_color1 = "NO";
			_color2 = "NO";
		
		if (count _worldspace  == 3) then
		{
				if(typename (_worldspace select 2) == "STRING")then{				
						_ownerPUID = _worldspace select 2;
					}else{
						 if(typename (_worldspace select 2) == "ARRAY")then{
						 			
									
							_theArray = _worldspace select 2;	
							_emptyZupa = count  _theArray;
							
							_colorCheck = "NO";
							
							if(_emptyZupa > 0)then{
									_theArray2 = _theArray select 0;						
									if( (count _theArray2) > 0)then{
											_colorCheck =  _theArray2 select 0;									
									};													
							};
																									
						  if(  _colorCheck == "color1"  )then{
						  
						  _color1 =  ((_worldspace select 2) select 0) select 1;
						  _color2 =  ((_worldspace select 2) select 1) select 1;
						  
						  diag_log ("Spawn: Color set");		
						  
						  };				
					};
					
			};
			
			
			
			
		};		

		
		
		// diag_log format["Server_monitor: [ObjectID = %1]  [ClassID = %2] [_ownerPUID = %3]", _idKey, _type, _ownerPUID];
		
		if (_damage < 1) then {
			//diag_log format["OBJ: %1 - %2", _idKey,_type];
			
			//Create it
			_object = createVehicle [_type, _pos, [], 0, "CAN_COLLIDE"];
			if (typeOf (_object) in  DZE_DoorsLocked) then {
            _object setVariable ["doorfriends", _intentory, true];
            };
			_object setVariable ["lastUpdate",time];
			_object setVariable ["ObjectID", _idKey, true];
			_object setVariable ["OwnerPUID", _ownerPUID, true];
			if (typeOf (_object) == "Plastic_Pole_EP1_DZ") then {
            _object setVariable ["plotfriends", _intentory, true];
            };
												
				if(_color1 != "NO")then{
			diag_log ("PAINT: Color with: " + _color1 + " and " + _color2);		
			_object setVariable ["color1", _color1, true];
			_object setVariable ["color2", _color2, true];
			//_object setObjectTexture [0, _color1];
			//_object setObjectTexture [1, _color2];		
			diag_log ("PAINT: Color End");
			};

			_lockable = 0;
			if(isNumber (configFile >> "CfgVehicles" >> _type >> "lockable")) then {
				_lockable = getNumber(configFile >> "CfgVehicles" >> _type >> "lockable");
			};

			// fix for leading zero issues on safe codes after restart
			if (_lockable == 4) then {
				_codeCount = (count (toArray _ownerID));
				if(_codeCount == 3) then {
					_ownerID = format["0%1", _ownerID];
				};
				if(_codeCount == 2) then {
					_ownerID = format["00%1", _ownerID];
				};
				if(_codeCount == 1) then {
					_ownerID = format["000%1", _ownerID];
				};
			};

			if (_lockable == 3) then {
				_codeCount = (count (toArray _ownerID));
				if(_codeCount == 2) then {
					_ownerID = format["0%1", _ownerID];
				};
				if(_codeCount == 1) then {
					_ownerID = format["00%1", _ownerID];
				};
			};

			_object setVariable ["CharacterID", _ownerID, true];
			
			clearWeaponCargoGlobal  _object;
			clearMagazineCargoGlobal  _object;
			// _object setVehicleAmmo DZE_vehicleAmmo;
			
			_object setdir _dir;
			_object setposATL _pos;
			_object setDamage _damage;
			
			if ((typeOf _object) in dayz_allowedObjects) then {
				if (DZE_GodModeBase) then {
					_object addEventHandler ["HandleDamage", {false}];
				} else {
					_object addMPEventHandler ["MPKilled",{_this call object_handleServerKilled;}];
				};
				// Test disabling simulation server side on buildables only.
				_object enableSimulation false;
				// used for inplace upgrades && lock/unlock of safe
				_object setVariable ["OEMPos", _pos, true];
				
			};

			if ((count _intentory > 0) && !(typeOf( _object) == "Plastic_Pole_EP1_DZ") && !(typeOf( _object) in  DZE_DoorsLocked)) then {
				if (_type in DZE_LockedStorage) then {
					// Fill variables with loot
					_object setVariable ["WeaponCargo", (_intentory select 0),true];
					_object setVariable ["MagazineCargo", (_intentory select 1),true];
					_object setVariable ["BackpackCargo", (_intentory select 2),true];
				} else {

					//Add weapons
					_objWpnTypes = (_intentory select 0) select 0;
					_objWpnQty = (_intentory select 0) select 1;
					_countr = 0;					
					{
						if(_x in (DZE_REPLACE_WEAPONS select 0)) then {
							_x = (DZE_REPLACE_WEAPONS select 1) select ((DZE_REPLACE_WEAPONS select 0) find _x);
						};
						_isOK = 	isClass(configFile >> "CfgWeapons" >> _x);
						if (_isOK) then {
							_object addWeaponCargoGlobal [_x,(_objWpnQty select _countr)];
						};
						_countr = _countr + 1;
					} count _objWpnTypes; 
				
					//Add Magazines
					_objWpnTypes = (_intentory select 1) select 0;
					_objWpnQty = (_intentory select 1) select 1;
					_countr = 0;
					{
						if (_x == "BoltSteel") then { _x = "WoodenArrow" }; // Convert BoltSteel to WoodenArrow
						if (_x == "ItemTent") then { _x = "ItemTentOld" };
						_isOK = 	isClass(configFile >> "CfgMagazines" >> _x);
						if (_isOK) then {
							_object addMagazineCargoGlobal [_x,(_objWpnQty select _countr)];
						};
						_countr = _countr + 1;
					} count _objWpnTypes;

					//Add Backpacks
					_objWpnTypes = (_intentory select 2) select 0;
					_objWpnQty = (_intentory select 2) select 1;
					_countr = 0;
					{
						_isOK = 	isClass(configFile >> "CfgVehicles" >> _x);
						if (_isOK) then {
							_object addBackpackCargoGlobal [_x,(_objWpnQty select _countr)];
						};
						_countr = _countr + 1;
					} count _objWpnTypes;
				};
			};	
			
			if (_object isKindOf "AllVehicles") then {
				{
					_selection = _x select 0;
					_dam = _x select 1;
					if (_selection in dayZ_explosiveParts && _dam > 0.8) then {_dam = 0.8};
					[_object,_selection,_dam] call object_setFixServer;
				} count _hitpoints;

				_object setFuel _fuel;

				if (!((typeOf _object) in dayz_allowedObjects)) then {
					
					//_object setvelocity [0,0,1];
					_object call fnc_veh_ResetEH;		
					
					if(_ownerID != "0" && !(_object isKindOf "Bicycle")) then {
						_object setvehiclelock "locked";
						_object setVariable ["R3F_LOG_disabled",true,true];
					};
					
					_totalvehicles = _totalvehicles + 1;

					// total each vehicle
					serverVehicleCounter set [count serverVehicleCounter,_type];
				};
					[_object] execVM "zupa\extra\DeleteObjInsafezone.sqf";
			};
			
			//Monitor the object
			PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_object];
		};
if( _currentCount == _newMileStone)then{ // to reduce bandwith
    _newMileStone = _newMileStone + 50; // every 50 items loaded refresh message
    _theMessage = format ["Spawned %1 of %2 objects",_currentCount, _ammountOfObject];
    PVDZE_Z_LoadMessage = [_theMessage];
    publicVariable "PVDZE_Z_LoadMessage";
};
_currentCount = _currentCount + 1;
	} count (_BuildingQueue + _objectQueue);
	// # END SPAWN OBJECTS # 

 

 

how do I add is correct

 

// # NOW SPAWN OBJECTS #
	_totalvehicles = 0;
	{
		_idKey = 		_x select 1;
		_type =			_x select 2;
		_ownerID = 		_x select 3;

		_worldspace = 	_x select 4;
		_intentory =	_x select 5;
		_hitPoints =	_x select 6;
		_fuel =			_x select 7;
		_damage = 		_x select 8;
		
		_dir = 0;

		
		_pos = [0,0,0];
		_wsDone = false;
		if (count _worldspace >= 2) then
		{
			if ((typeName (_worldspace select 0)) == "STRING") then {
				_worldspace set [0, call compile (_worldspace select 0)];
				_worldspace set [1, call compile (_worldspace select 1)];
			};
			_dir = _worldspace select 0;
			if (count (_worldspace select 1) == 3) then {
				_pos = _worldspace select 1;
				_wsDone = true;
			}
		};	
		
		if (!_wsDone) then {
			if (count _worldspace >= 1) then { _dir = _worldspace select 0; };
			_pos = [getMarkerPos "center",0,4000,10,0,2000,0] call BIS_fnc_findSafePos;
			if (count _pos < 3) then { _pos = [_pos select 0,_pos select 1,0]; };
			diag_log ("MOVED OBJ: " + str(_idKey) + " of class " + _type + " to pos: " + str(_pos));
		};
		
		_vector = [[0,0,0],[0,0,0]];
		_vecExists = false;
		_ownerPUID = "0";
		if (count _worldspace >= 3) then{
			if(count _worldspace == 3) then{
					if(typename (_worldspace select 2) == "STRING")then{
						_ownerPUID = _worldspace select 2;
					}else{
						 if(typename (_worldspace select 2) == "ARRAY")then{
							_vector = _worldspace select 2;
							if(count _vector == 2)then{
								if(((count (_vector select 0)) == 3) && ((count (_vector select 1)) == 3))then{
									_vecExists = true;
								};
							};
						};					
					};
					
			}else{
				//Was not 3 elements, so check if 4 or more
				if(count _worldspace == 4) then{
					if(typename (_worldspace select 3) == "STRING")then{
						_ownerPUID = _worldspace select 3;
					}else{
						if(typename (_worldspace select 2) == "STRING")then{
							_ownerPUID = _worldspace select 2;
						};
					};
			
			
					if(typename (_worldspace select 2) == "ARRAY")then{
						_vector = _worldspace select 2;
						if(count _vector == 2)then{
							if(((count (_vector select 0)) == 3) && ((count (_vector select 1)) == 3))then{
								_vecExists = true;
							};
						};
					}else{
						if(typename (_worldspace select 3) == "ARRAY")then{
							_vector = _worldspace select 3;
							if(count _vector == 2)then{
								if(((count (_vector select 0)) == 3) && ((count (_vector select 1)) == 3))then{
									_vecExists = true;
								};
							};
						};
					};
					
				}else{
					//More than 3 or 4 elements found
					//Might add a search for the vector, ownerPUID will equal 0
				};
			};
		};
		   	   
		// diag_log format["Server_monitor: [ObjectID = %1]  [ClassID = %2] [_ownerPUID = %3]", _idKey, _type, _ownerPUID];
		
		if (_damage < 1) then {
			//diag_log format["OBJ: %1 - %2", _idKey,_type];
			
			//Create it
			_object = createVehicle [_type, _pos, [], 0, "CAN_COLLIDE"];
			_object setVariable ["lastUpdate",time];
			_object setVariable ["ObjectID", _idKey, true];
			_object setVariable ["OwnerPUID", _ownerPUID, true];
			
			_lockable = 0;
			if(isNumber (configFile >> "CfgVehicles" >> _type >> "lockable")) then {
				_lockable = getNumber(configFile >> "CfgVehicles" >> _type >> "lockable");
			};

			// fix for leading zero issues on safe codes after restart
			if (_lockable == 4) then {
				_codeCount = (count (toArray _ownerID));
				if(_codeCount == 3) then {
					_ownerID = format["0%1", _ownerID];
				};
				if(_codeCount == 2) then {
					_ownerID = format["00%1", _ownerID];
				};
				if(_codeCount == 1) then {
					_ownerID = format["000%1", _ownerID];
				};
			};

			if (_lockable == 3) then {
				_codeCount = (count (toArray _ownerID));
				if(_codeCount == 2) then {
					_ownerID = format["0%1", _ownerID];
				};
				if(_codeCount == 1) then {
					_ownerID = format["00%1", _ownerID];
				};
			};

			_object setVariable ["CharacterID", _ownerID, true];
			
			clearWeaponCargoGlobal  _object;
			clearMagazineCargoGlobal  _object;
			// _object setVehicleAmmo DZE_vehicleAmmo;
			
			_object setdir _dir;
			
			if(_vecExists)then{
				_object setVectorDirAndUp _vector;
			};
			
			_object setposATL _pos;
			_object setDamage _damage;
			
			if ((typeOf _object) in dayz_allowedObjects) then {
				if (DZE_GodModeBase) then {
					_object addEventHandler ["HandleDamage", {false}];
				} else {
					_object addMPEventHandler ["MPKilled",{_this call object_handleServerKilled;}];
				};
				// Test disabling simulation server side on buildables only.
				_object enableSimulation false;
				// used for inplace upgrades && lock/unlock of safe
				_object setVariable ["OEMPos", _pos, true];
				
			};

			if (count _intentory > 0) then {
				if (_type in DZE_LockedStorage) then {
					// Fill variables with loot
					_object setVariable ["WeaponCargo", (_intentory select 0),true];
					_object setVariable ["MagazineCargo", (_intentory select 1),true];
					_object setVariable ["BackpackCargo", (_intentory select 2),true];
				} else {

					//Add weapons
					_objWpnTypes = (_intentory select 0) select 0;
					_objWpnQty = (_intentory select 0) select 1;
					_countr = 0;					
					{
						if(_x in (DZE_REPLACE_WEAPONS select 0)) then {
							_x = (DZE_REPLACE_WEAPONS select 1) select ((DZE_REPLACE_WEAPONS select 0) find _x);
						};
						_isOK = 	isClass(configFile >> "CfgWeapons" >> _x);
						if (_isOK) then {
							_object addWeaponCargoGlobal [_x,(_objWpnQty select _countr)];
						};
						_countr = _countr + 1;
					} count _objWpnTypes; 
				
					//Add Magazines
					_objWpnTypes = (_intentory select 1) select 0;
					_objWpnQty = (_intentory select 1) select 1;
					_countr = 0;
					{
						if (_x == "BoltSteel") then { _x = "WoodenArrow" }; // Convert BoltSteel to WoodenArrow
						if (_x == "ItemTent") then { _x = "ItemTentOld" };
						_isOK = 	isClass(configFile >> "CfgMagazines" >> _x);
						if (_isOK) then {
							_object addMagazineCargoGlobal [_x,(_objWpnQty select _countr)];
						};
						_countr = _countr + 1;
					} count _objWpnTypes;

					//Add Backpacks
					_objWpnTypes = (_intentory select 2) select 0;
					_objWpnQty = (_intentory select 2) select 1;
					_countr = 0;
					{
						_isOK = 	isClass(configFile >> "CfgVehicles" >> _x);
						if (_isOK) then {
							_object addBackpackCargoGlobal [_x,(_objWpnQty select _countr)];
						};
						_countr = _countr + 1;
					} count _objWpnTypes;
				};
			};	
			
			if (_object isKindOf "AllVehicles") then {
				{
					_selection = _x select 0;
					_dam = _x select 1;
					if (_selection in dayZ_explosiveParts && _dam > 0.8) then {_dam = 0.8};
					[_object,_selection,_dam] call object_setFixServer;
				} count _hitpoints;

				_object setFuel _fuel;

				if (!((typeOf _object) in dayz_allowedObjects)) then {
					
					//_object setvelocity [0,0,1];
					_object call fnc_veh_ResetEH;		
					
					if(_ownerID != "0" && !(_object isKindOf "Bicycle")) then {
						_object setvehiclelock "locked";
					};
					
					_totalvehicles = _totalvehicles + 1;

					// total each vehicle
					serverVehicleCounter set [count serverVehicleCounter,_type];
				};
			};

			//Monitor the object
			PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_object];
		};
	} count (_BuildingQueue + _objectQueue);
	// # END SPAWN OBJECTS # 

to restart

J1ns3Qi-vzI.jpg

 

after restart

ouscgeUMuw4.jpg

Edited by Bandit
Link to comment
Share on other sites

Ok when you upgrade a door or a wall to full size is it supposed to reset back to straight as that is now the problem i am having?

 

Thanks

I was having this issues as well, but I forgot to add in the plotpoleforlife files. As soon as I did it fixed it, but they still disappear for us at the moment.

Link to comment
Share on other sites

Ok, so I did what is says to do here to prevent certain items from being rotated: 

 

I have this in my init: DZE_noRotate = ["ItemVault","ItemWoodStairs","ItemLockbox","ItemWoodStairsSupport","ItemWoodLadder","30m_plot_kit","workbench_kit"];

 

I can still rotate ladders and I assume the other items too. What am I doing wrong?

Link to comment
Share on other sites

I am using the build vectors with snap build pro, admin build and plot 4 life combined version of this and have been having reports of cinder and wood walls disappearing upon server restart? Any ideas on where I should be looking for code errors, or what I need to paste here so that someone can work out what is going on?

 

Thanks.

Link to comment
Share on other sites

I am using the build vectors with snap build pro, admin build and plot 4 life combined version of this and have been having reports of cinder and wood walls disappearing upon server restart? Any ideas on where I should be looking for code errors, or what I need to paste here so that someone can work out what is going on?

 

Thanks.

It sounds like the objects are not being properly stored to the database (check the code where objects are published at end of your player_build.sqf), or are not being retrieved correctly from the database (server_monitor.sqf, to which vector building adds one large chunk of new code).

.

Link to comment
Share on other sites

Same problem with full cinder walls and cinder garage doorway disappearing after restart. Half cinder blocks walls are fine. I am using the build vectors, snap build pro and plot 4 life.My map is Sauerland. Server_monitor.sqf is correct (with new code).

 

check the code where objects are published at end of your player_build.sqf

What should i check there?

Link to comment
Share on other sites

I have to say I am stumped as to what would cause some objects to be saved but others to be lost. My thinking was that either the objects were not being saved to the database for some reason, or that they were not retrieved and rendered properly.

 

The objects are published to the database at the end of your player_build.sqf in code that should look like this:

// code for objects with a lock, like locable doors

                    PVDZE_obj_Publish = [_combination,_tmpbuilt,[_dir,_location,_vector,_playerUID],_classname];
                    publicVariableServer "PVDZE_obj_Publish";

 

// code for other objects

                        PVDZE_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location,_vector,_playerUID],_classname];
                        publicVariableServer "PVDZE_obj_Publish";

 

Much of the server_monitor.sqf code pertains to streaming the list of objects stored in the database to the server so that the objects can be rendered. I am not that familiar with how this happens beyond the fact that it must.

 

I would tripple check that all changes to code are correct to start, then see whether the types of objects that are causing problems are actually being saved in the database and retrieved. I hope this is helpful.

Link to comment
Share on other sites

Ok, so I did what is says to do here to prevent certain items from being rotated: 

 

I have this in my init: DZE_noRotate = ["ItemVault","ItemWoodStairs","ItemLockbox","ItemWoodStairsSupport","ItemWoodLadder","30m_plot_kit","workbench_kit"];

 

I can still rotate ladders and I assume the other items too. What am I doing wrong?

 

 

You used the ITEM names. You need to use the object name, like "VaultStorageLocked","LockboxStorageLocked", etc.

 

regards

Link to comment
Share on other sites

(Sorry for bad English)

 

Here what I noticed: my "custom" folder contain A_Plot_for_Life folder from previously installed Plot 4 Life mod, and PlotForLifev2 from downloaded Build Vectors mod.

 

Folder A_Plot_for_Life contain a player_build.sqf, and a Snap_Pro follder from Build Vectors mod also contain player_build.sqf

 

So here is the question: Are mod files (With Admin Build and Plot 4 Life http://bitly.com/Bui...ctorsAdminP4LV3 ) already contain all of the Plot 4 Life mod files, Or do i have to instal a Plot 4 Life mod and then install a build vectors? 

Link to comment
Share on other sites

I have to say I am stumped as to what would cause some objects to be saved but others to be lost. My thinking was that either the objects were not being saved to the database for some reason, or that they were not retrieved and rendered properly.

 

The objects are published to the database at the end of your player_build.sqf in code that should look like this:

// code for objects with a lock, like locable doors

                    PVDZE_obj_Publish = [_combination,_tmpbuilt,[_dir,_location,_vector,_playerUID],_classname];

                    publicVariableServer "PVDZE_obj_Publish";

 

// code for other objects

                        PVDZE_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location,_vector,_playerUID],_classname];

                        publicVariableServer "PVDZE_obj_Publish";

 

Much of the server_monitor.sqf code pertains to streaming the list of objects stored in the database to the server so that the objects can be rendered. I am not that familiar with how this happens beyond the fact that it must.

 

I would tripple check that all changes to code are correct to start, then see whether the types of objects that are causing problems are actually being saved in the database and retrieved. I hope this is helpful.

 

 

Yeah my bad. Apparently telling BE to "restart" at certain times in the scheduler only means restart the map, not the server. Telling it to "shutdown" actually restarts the server. No wonder I was having drama's. Thanks to all.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×
×
  • Create New...