Jump to content

[HowTo] add InfectedCamps


jOoPs

Recommended Posts

  • 4 weeks later...
  • 3 weeks later...

great job works perfect...for future , try to make your installation guide a little less all over the place... step by step i found my self jumping from one pbo to another then back again.. no biggie , amazing job man :D

 

"installation guide a little less all over the place"

 

no way... the zombiespawn uses a trigger.. these trigger needs to be created on clientside... the rest will be done mostly by server.. note: teleporting into an trigger-area wont activate it :P

 

...and at all ...this script was ported and adapted from DayZ-Mod

Link to comment
Share on other sites

        class ItemMap_Debug: ItemCore {
		descriptionshort = "Debug Map - Admin use only";
		displayname = "Map";
		picture = "\ca\ui\data\gear_picture_map_ca.paa";
		scope = 2;
		simulation = "ItemMap";
		class Library {
			libtextdesc = "Debug Map - Admin use only";
		};
	}

in object_infectedcamps.sqf remove/comment out...

 

(line 36)     if ("ItemMap_Debug" in items player) then {

 

and

 

(line 42)     };

 

 

cheers

 

This is the answer if all you want is debug.

 

You will need B.I. Tools 2.5 for this.  Link

 

Go into your server-side pbo file and you should find a file called \addons\dayz_server\Config.Bin

 

Drag and drop \addons\dayz_server\Config.Bin onto \Program Files (x86)\Bohemia Interactive\Tools\BinMake\cfgconvert\CfgConvert.exe

 

This will allow you to edit the file in Notepad++.  If you can now edit the file with notepad++ congratulations so far. almost done.

 

Now copy this part to the very bottom of your Config.Bin:

        class ItemMap_Debug: ItemCore {
		descriptionshort = "Debug Map - Admin use only";
		displayname = "Map";
		picture = "\ca\ui\data\gear_picture_map_ca.paa";
		scope = 2;
		simulation = "ItemMap";
		class Library {
			libtextdesc = "Debug Map - Admin use only";
		};
	}

Save it and then Drag and Drop it onto \Program Files (x86)\Bohemia Interactive\Tools\BinMake\binMake.exe

 

This will convert the file back into a useable Bin File for the pbo.

 

Repack your pbo with the new Bin.

 

Last but not least....

 

 

in object_infectedcamps.sqf remove/comment out...

 

(line 36)     if ("ItemMap_Debug" in items player) then {

 

and

 

(line 42)     };

 

 

Save that and done.  Your Admins should now see a small red ring around the camps on the map.  Please Note:  If you die, and respawn into the game, you will not see the markers anymore until next restart. 

 

If you are running this script for players I suggest setting the InfectedCamps ClutterCutter Debug in the init.sqf to 3.  This gives glowing red light where the loot is that you can see from a distance so if you are near one a good chance to notice it. 

 

Hope this helps.

 

I have been trying to work on a way to make the markers visable always for everyone, but not having an easy time.  Help would be greatly appreciated.

Link to comment
Share on other sites

  • 3 weeks later...

does anyone know why zeds are not spawning. I have this working fine on my chernarus server but with my napf I cant get zeds to spawn. I used the exact same files, copied and pasted, but they wont show up. any ideas to why

 

 

 

 

 teleporting into an trigger-area wont activate it :P

 

Link to comment
Share on other sites

I could never get the markers to work so I can't even check to see if zedz are spawning.

 

I posted how to make marker appear on the page 3.

 

  If you can't get it to work, you could alternatively look in your RPT file shortly after startup and it should tell you if the camps spawned and the coordinates..  I use a program called DayZKoordinatenumrechner to convert the map coordinates to GPS coordinates.

Link to comment
Share on other sites

  • 3 weeks later...

the 1.0.4.2 version of this mod is not compatible with the new 1.0.5.1 epoch.  I had a look thru player_monitor.fsm and there is some differences but as to knowing what to change and where I am at a loss.  Does anyone know how to make this work for 1.0.5.1?  I loved finding these things out in the woods.

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

Hi all! 

 

It's not worked for new loot tables.. this error:

9:04:49 "_iClass isNil, exiting loot spawn!"
9:04:49 Error in expression <2) then {
_position set [2,0];
_item = [_itemType select 0, _itemType select 1, >
9:04:49 Error position: <_itemType select 0, _itemType select 1, >
9:04:49 Error Undefined variable in expression: _itemtype
9:04:49 File z\addons\dayz_server\compile\fn_bases.sqf, line 58
9:04:49 Error in expression <
_itemType = [];
_itemType = _itemTypes select _index;

_position = [];
_positio>
9:04:49 Error position: <select _index;

_position = [];
_positio>
9:04:49 Error Zero divisor
9:04:49 File z\addons\dayz_server\compile\fn_bases.sqf, line 50

line 58:

_item = [_itemType select 0, _itemType select 1, _position, 1] call spawn_loot;

line 50:

_itemType = _itemTypes select _index;

fn_bases.sqf:

/*
       Created exclusively for ArmA2:OA - DayZMod.
       Please request permission to use/alter/distribute from project leader (R4Z0R49).
	   adapted and modified by jOoPs
*/
private ["_b","_amount","_radius","_lootMinRadius","_lootMaxRadius","_objectMinRadius","_objectMaxRadius","_randomObjects","_guaranteedObjects","_randomLoot","_guaranteedLoot","_nextPos","_basePos","_tmpobject","_qty","_baseClass","_centerPos","_placeSearchRadius","_placeMinDistance","_addLoot","_addWrecks","_placeSearchExpr","_small","_medium","_large","_placePrecision","_campList","_time"];

_qty = _this select 0;
_centerPos = getMarkerPos (_this select 1);
_placeSearchRadius = _this select 2;
_placeMinDistance = _this select 3;

// add some loot around the camp
_addLoot = {
private ["_clutter","_index","_lootMaxRadius2","_itemType","_position","_item","_nearby","_basePos","_baseClass","_lootMinRadius","_lootMaxRadius","_randomLoot","_guaranteedLoot","_lootTable","_itemTypes","_weights","_cntWeights","_config"];

	_basePos = _this select 0;
	_baseClass = _this select 1;
	_lootMinRadius = _this select 2;
	_lootMaxRadius = _this select 3;
	_randomLoot = _this select 4;
	_guaranteedLoot = _this select 5;
	_lootMaxRadius2 = _lootMaxRadius + 5;
		
			_lootTable = ["HeliCrash","HeliCrash_No50s"] call BIS_fnc_selectRandom;
			//_config = 		missionConfigFile >> "CfgBuildingLoot" >> _lootTable;
			_config = 		configFile >> "CfgBuildingLoot" >> _lootTable;
			_itemTypes =	[] + getArray (_config >> "itemType");
			_index =        dayz_CBLBase find toLower(_lootTable);
			_weights =		dayz_CBLChances select _index;
			_cntWeights = (count _weights);
			//Zero divisor fix
			if((_cntWeights < 0)||(_cntWeights == 0))then{
				_cntWeights = _cntWeights + 1;
			};
		
			for "_x" from (round(random _randomLoot) + _guaranteedLoot) to 1 step -1  do {
				//create loot
				_index = floor(random _cntWeights);
				//Zero divisor fix
				if((_index < 0)||(_index == 0))then{
					_index = _index + 1;
				};
				_index = _weights select _index;
				//Zero divisor fix
				if((_index < 0)||(_index == 0))then{
					_index = _index + 1;
				};
				_itemType = [];
				_itemType = _itemTypes select _index;

				_position = [];
				_position = [_basePos,_lootMinRadius,_lootMaxRadius,0,0,0,0] call BIS_fnc_findSafePos;
				_position = [_position select 0,_position select 1,0];
		
				if ((count _position) >= 2) then {
					_position set [2,0];
					_item = [_itemType select 0, _itemType select 1, _position, 1] call spawn_loot;
					_item setVariable ["permaLoot",true];
					
					if (dayz_spawnInfectedSite_clutterCutter == 1) then { // shift loot upward to 5cm
						_position set [2,0.05];
						_item setPosATL _position;
					}
					else { if (dayz_spawnInfectedSite_clutterCutter >= 2) then { // cutterclutter
						_clutter = createVehicle ["ClutterCutter_small_2_EP1", _position, [], 0, "CAN_COLLIDE"];
						_clutter setPos _position;
						if (dayz_spawnInfectedSite_clutterCutter == 3) then { // debug
							createVehicle ["Sign_sphere100cm_EP1", [_position select 0, _position select 1, 0.30], [], 0, "CAN_COLLIDE"];					
						};
					};};
					sleep 0.001;
					diag_log(format["Infected Camps: Loot spawn at '%1:%3' with loot table '%2'", _baseClass, str(_itemType), _basePos]); 

					// ReammoBox is preferred parent class here, as WeaponHolder wouldn't match MedBox0 and other such items.
					_nearby = _basePos nearObjects ["ReammoBox", _lootMaxRadius2];
					{
						_x setVariable ["permaLoot",true];
					} forEach _nearby;
				};
			}; // loot loop
};

// add some dead bodies and veh wrecks all around
_addWrecks = {
	private ["_randomObjects","_guaranteedObjects","_position","_basePos","_objectMinRadius","_objectMaxRadius","_Bodys","_randomvehicle","_chance","_DeadBody","_wreck","_z"];
	_basePos = _this select 0;
	_objectMinRadius = _this select 1;
	_objectMaxRadius = _this select 2;
	_randomObjects = _this select 3;
	_guaranteedObjects = _this select 4;
	_z = 0;

    while {_z < ((round(random _randomObjects)) + _guaranteedObjects)} do {
		_position = [_basePos,_objectMinRadius,_objectMaxRadius,1,0,20,0] call BIS_fnc_findSafePos;
		_position = [_position select 0,_position select 1,0];
		_Bodys = ["Body1","Body2"] call BIS_fnc_selectRandom;
		_randomvehicle = ["SKODAWreck","HMMWVWreck","UralWreck","datsun01Wreck","hiluxWreck","datsun02Wreck","UAZWreck","BMP2Wreck","T72Wreck","LADAWreck"] select round(random 4);
		_chance = random 1;
		if (_chance < 0.9) then {
			_DeadBody = createVehicle [_Bodys, _position, [], 0, "CAN_COLLIDE"];
		} else {
			_wreck = createVehicle [_randomvehicle, _position, [], 0, "CAN_COLLIDE"];
		};
		_z = _z + 1;
	};
};


_placeSearchExpr = "(5 * forest) + (4 * trees) + (3 * meadow) - (20 * houses) - (30 * sea)";
_small = ["Camp1_Small","Camp2_Small","Camp3_Small"];
_medium = ["Camp2_Medium","Camp3_Medium","Camp4_Medium","Camp5_Medium"]; // "Camp2_Medium","Camp3_Medium","Camp4_Medium","Camp5_Medium"];
_large = [];
_baseArray = ["Camp1_Small","Camp2_Small","Camp3_Small","Camp2_Medium","Camp3_Medium","Camp4_Medium","Camp5_Medium"]; //use this for selection

_placePrecision = 30;
_amount = 0;
_radius = 0;
_lootMinRadius = 0; 
_lootMaxRadius = 0; 
_objectMinRadius = 0; 
_objectMaxRadius = 0; 
_randomObjects = 0; 
_guaranteedObjects = 0; 
_randomLoot = 0; 
_guaranteedLoot = 0;
_baseClass = "";
_campList = [];
_basePos = [];
_markerPos = getMarkerPos "respawn_west";
_b = _qty * 20;

_time = time;
_tmpobject = "Land_HouseV2_05" createVehicleLocal _markerPos;
while {(_b > 0) && (_qty > 0) && (round(time - _time) < 35)} do {
	_baseClass = _baseArray select round(random ((count _baseArray) - 1));
	if (_baseClass in _small) then { _amount = 10; _radius = 100; _lootMinRadius = 8; _lootMaxRadius = 13; _objectMinRadius = 10; _objectMaxRadius = 20; _randomObjects = 8; _guaranteedObjects = 2; _randomLoot = 3; _guaranteedLoot = 4; };
	if (_baseClass in _medium) then { _amount = 25; _radius = 150; _lootMinRadius = 13; _lootMaxRadius = 20; _objectMinRadius = 10; _objectMaxRadius = 20; _randomObjects = 8; _guaranteedObjects = 2; _randomLoot = 4; _guaranteedLoot = 5; };
	if (_baseClass in _large) then { _amount = 40; _radius = 200; _lootMinRadius = 20; _lootMaxRadius = 30; _objectMinRadius = 10; _objectMaxRadius = 20; _randomObjects = 8; _guaranteedObjects = 2; _randomLoot = 5; _guaranteedLoot = 6; };
	{
		if (_x select 1 > 3) then {
			_basePos = _x select 0;
			if (count _basePos >= 2) then {
				_basePos set [2, 0];
				_nextPos = _basePos findEmptyPosition [0, _placePrecision, "Land_HouseV2_05"];
				_basePos = _nextPos;
				if (count _basePos >= 2) then {
					_basePos set [2, 0];
					_tmpobject setPosATL _basePos;
					//sleep 0.003;
					_basePos = _tmpobject modelToWorld (boundingCenter _tmpobject); 
					//sleep 0.003;
					_basePos set [2, 0];
					_tmpobject setPosATL _markerPos;
					//sleep 0.003;
					_basePos = _basePos isFlatEmpty [0, 0, _lootMaxRadius * 0.03, _lootMaxRadius, 0, false, objNull];
					if (count _basePos >= 2) then {
						_basePos set [2, 0];
						if ((0 == count (nearestObjects [_basePos, [], _lootMaxRadius])) AND {(0 == { ((_x select 0) distance _basePos) < _placeMinDistance } count _campList)}) then {
							_campList set [count _campList, [_basePos,_amount,_radius]];
							//diag_log(format["%1 found a nice spot at %2 (%3)", __FILE__, _basePos call fa_coor2str,_x select 1]);
							[_basePos, random 360, _baseClass] call spawnComposition;
							[_basePos, _baseClass, _lootMinRadius, _lootMaxRadius, _randomLoot, _guaranteedLoot] call _addLoot;
							[_basePos, _lootMinRadius, _lootMaxRadius, _randomObjects, _guaranteedObjects] call _addWrecks;
							_qty = _qty - 1;
						};
					};
				};
			};
			//sleep 0.01;
		};
	_b = _b - 1;
	} forEach selectBestPlaces [_centerPos, _placeSearchRadius, _placeSearchExpr, _placePrecision, _qty];
};
deleteVehicle _tmpobject;

diag_log(format["%1: found %2 camps spots in %3 sec.", __FILE__, count _campList, round(time - _time)]);

_campList
 

This is a great addon, but I don't know how to coding.. please Help who knows

Link to comment
Share on other sites

Hi all! 

 

It's not worked for new loot tables.. this error:

 

replace content of fn_bases.sqf with this...

/*
       Created exclusively for ArmA2:OA - DayZMod.
       Please request permission to use/alter/distribute from project leader (R4Z0R49).
	   adapted and modified by jOoPs
*/
private ["_b","_amount","_radius","_lootMinRadius","_lootMaxRadius","_objectMinRadius","_objectMaxRadius","_randomObjects","_guaranteedObjects","_randomLoot","_guaranteedLoot","_nextPos","_basePos","_tmpobject","_qty","_baseClass","_centerPos","_placeSearchRadius","_placeMinDistance","_addLoot","_addWrecks","_placeSearchExpr","_small","_medium","_large","_placePrecision","_campList","_time"];

_qty = _this select 0;
_centerPos = getMarkerPos (_this select 1);
_placeSearchRadius = _this select 2;
_placeMinDistance = _this select 3;

// add some loot around the camp
_addLoot = {
private ["_clutter","_index","_lootMaxRadius2","_itemType","_position","_item","_nearby","_basePos","_baseClass","_lootMinRadius","_lootMaxRadius","_randomLoot","_guaranteedLoot","_lootTable","_num","_itemTypes","_weights","_cntWeights","_config", "_CBLBase","_index1","_index2"];

	_basePos = _this select 0;
	_baseClass = _this select 1;
	_lootMinRadius = _this select 2;
	_lootMaxRadius = _this select 3;
	_randomLoot = _this select 4;
	_guaranteedLoot = _this select 5;
	_lootMaxRadius2 = _lootMaxRadius + 5;
		
			_lootTable = ["HeliCrash","HeliCrash_No50s"] call BIS_fnc_selectRandom;
		
		    _num = round(random _randomLoot) + _guaranteedLoot;
			if (DZE_MissionLootTable) then {
				_itemTypes = [] + getArray (missionConfigFile >> "CfgBuildingLoot" >> _lootTable >> "lootType");
			} else {
				_itemTypes = [] + getArray (configFile >> "CfgBuildingLoot" >> _lootTable >> "lootType");
			};
			_CBLBase = dayz_CBLBase find (toLower(_lootTable));
			_weights = dayz_CBLChances select _CBLBase;
			_cntWeights = count _weights;
	
			for "_x" from 1 to _num do {
				//create loot
				_index1 = floor(random _cntWeights);
				_index2 = _weights select _index1;
				_itemType = _itemTypes select _index2;
				
				_position = [];
				_position = [_basePos,_lootMinRadius,_lootMaxRadius,0,0,0,0] call BIS_fnc_findSafePos;
				_position = [_position select 0,_position select 1,0];
				
				if ((count _position) >= 2) then {
					_position set [2,0];
					_item = [_itemType select 0, _itemType select 1, _position, 1] call spawn_loot;
					_item setVariable ["permaLoot",true];
					
					if (dayz_spawnInfectedSite_clutterCutter == 1) then { // shift loot upward to 5cm
						_position set [2,0.05];
						_item setPosATL _position;
					}
					else { if (dayz_spawnInfectedSite_clutterCutter >= 2) then { // cutterclutter
						_clutter = createVehicle ["ClutterCutter_small_2_EP1", _position, [], 0, "CAN_COLLIDE"];
						_clutter setPos _position;
						if (dayz_spawnInfectedSite_clutterCutter == 3) then { // debug
							createVehicle ["Sign_sphere100cm_EP1", [_position select 0, _position select 1, 0.30], [], 0, "CAN_COLLIDE"];					
						};
					};};
					sleep 0.001;
					diag_log(format["Infected Camps: Loot spawn at '%1:%3' with loot table '%2'", _baseClass, str(_itemType), _basePos]); 

					// ReammoBox is preferred parent class here, as WeaponHolder wouldn't match MedBox0 and other such items.
					_nearby = _basePos nearObjects ["ReammoBox", _lootMaxRadius2];
					{
						_x setVariable ["permaLoot",true];
					} forEach _nearby;
				};
			}; // loot loop
};

// add some dead bodies and veh wrecks all around
_addWrecks = {
	private ["_randomObjects","_guaranteedObjects","_position","_basePos","_objectMinRadius","_objectMaxRadius","_Bodys","_randomvehicle","_chance","_DeadBody","_wreck","_z"];
	_basePos = _this select 0;
	_objectMinRadius = _this select 1;
	_objectMaxRadius = _this select 2;
	_randomObjects = _this select 3;
	_guaranteedObjects = _this select 4;
	_z = 0;

    while {_z < ((round(random _randomObjects)) + _guaranteedObjects)} do {
		_position = [_basePos,_objectMinRadius,_objectMaxRadius,1,0,20,0] call BIS_fnc_findSafePos;
		_position = [_position select 0,_position select 1,0];
		_Bodys = ["Body1","Body2"] call BIS_fnc_selectRandom;
		_randomvehicle = ["SKODAWreck","HMMWVWreck","UralWreck","datsun01Wreck","hiluxWreck","datsun02Wreck","UAZWreck","BMP2Wreck","T72Wreck","LADAWreck"] select round(random 4);
		_chance = random 1;
		if (_chance < 0.9) then {
			_DeadBody = createVehicle [_Bodys, _position, [], 0, "CAN_COLLIDE"];
		} else {
			_wreck = createVehicle [_randomvehicle, _position, [], 0, "CAN_COLLIDE"];
		};
		_z = _z + 1;
	};
};


_placeSearchExpr = "(5 * forest) + (4 * trees) + (3 * meadow) - (20 * houses) - (30 * sea)";
_small = ["Camp1_Small","Camp2_Small","Camp3_Small"];
_medium = ["Camp2_Medium","Camp3_Medium","Camp4_Medium","Camp5_Medium"]; // "Camp2_Medium","Camp3_Medium","Camp4_Medium","Camp5_Medium"];
_large = [];
_baseArray = ["Camp1_Small","Camp2_Small","Camp3_Small","Camp2_Medium","Camp3_Medium","Camp4_Medium","Camp5_Medium"]; //use this for selection

_placePrecision = 30;
_amount = 0;
_radius = 0;
_lootMinRadius = 0; 
_lootMaxRadius = 0; 
_objectMinRadius = 0; 
_objectMaxRadius = 0; 
_randomObjects = 0; 
_guaranteedObjects = 0; 
_randomLoot = 0; 
_guaranteedLoot = 0;
_baseClass = "";
_campList = [];
_basePos = [];
_markerPos = getMarkerPos "respawn_west";
_b = _qty * 20;

_time = time;
_tmpobject = "Land_HouseV2_05" createVehicleLocal _markerPos;
while {(_b > 0) && (_qty > 0) && (round(time - _time) < 35)} do {
	_baseClass = _baseArray select round(random ((count _baseArray) - 1));
	if (_baseClass in _small) then { _amount = 10; _radius = 100; _lootMinRadius = 8; _lootMaxRadius = 13; _objectMinRadius = 10; _objectMaxRadius = 20; _randomObjects = 8; _guaranteedObjects = 2; _randomLoot = 3; _guaranteedLoot = 4; };
	if (_baseClass in _medium) then { _amount = 25; _radius = 150; _lootMinRadius = 13; _lootMaxRadius = 20; _objectMinRadius = 10; _objectMaxRadius = 20; _randomObjects = 8; _guaranteedObjects = 2; _randomLoot = 4; _guaranteedLoot = 5; };
	if (_baseClass in _large) then { _amount = 40; _radius = 200; _lootMinRadius = 20; _lootMaxRadius = 30; _objectMinRadius = 10; _objectMaxRadius = 20; _randomObjects = 8; _guaranteedObjects = 2; _randomLoot = 5; _guaranteedLoot = 6; };
	{
		if (_x select 1 > 3) then {
			_basePos = _x select 0;
			if (count _basePos >= 2) then {
				_basePos set [2, 0];
				_nextPos = _basePos findEmptyPosition [0, _placePrecision, "Land_HouseV2_05"];
				_basePos = _nextPos;
				if (count _basePos >= 2) then {
					_basePos set [2, 0];
					_tmpobject setPosATL _basePos;
					//sleep 0.003;
					_basePos = _tmpobject modelToWorld (boundingCenter _tmpobject); 
					//sleep 0.003;
					_basePos set [2, 0];
					_tmpobject setPosATL _markerPos;
					//sleep 0.003;
					_basePos = _basePos isFlatEmpty [0, 0, _lootMaxRadius * 0.03, _lootMaxRadius, 0, false, objNull];
					if (count _basePos >= 2) then {
						_basePos set [2, 0];
						if ((0 == count (nearestObjects [_basePos, [], _lootMaxRadius])) AND {(0 == { ((_x select 0) distance _basePos) < _placeMinDistance } count _campList)}) then {
							_campList set [count _campList, [_basePos,_amount,_radius]];
							//diag_log(format["%1 found a nice spot at %2 (%3)", __FILE__, _basePos call fa_coor2str,_x select 1]);
							[_basePos, random 360, _baseClass] call spawnComposition;
							[_basePos, _baseClass, _lootMinRadius, _lootMaxRadius, _randomLoot, _guaranteedLoot] call _addLoot;
							[_basePos, _lootMinRadius, _lootMaxRadius, _randomObjects, _guaranteedObjects] call _addWrecks; //more removable wreckshit ??
							_qty = _qty - 1;
						};
					};
				};
			};
			//sleep 0.01;
		};
	_b = _b - 1;
	} forEach selectBestPlaces [_centerPos, _placeSearchRadius, _placeSearchExpr, _placePrecision, _qty];
};
deleteVehicle _tmpobject;

diag_log(format["%1: found %2 camps spots in %3 sec.", __FILE__, count _campList, round(time - _time)]);

_campList
 

 

this is for DZE 105x - its untest, tell me if its working.

 

cheers

Link to comment
Share on other sites

replace content of fn_bases.sqf with this...

/*
       Created exclusively for ArmA2:OA - DayZMod.
       Please request permission to use/alter/distribute from project leader (R4Z0R49).
	   adapted and modified by jOoPs
*/
private ["_b","_amount","_radius","_lootMinRadius","_lootMaxRadius","_objectMinRadius","_objectMaxRadius","_randomObjects","_guaranteedObjects","_randomLoot","_guaranteedLoot","_nextPos","_basePos","_tmpobject","_qty","_baseClass","_centerPos","_placeSearchRadius","_placeMinDistance","_addLoot","_addWrecks","_placeSearchExpr","_small","_medium","_large","_placePrecision","_campList","_time"];

_qty = _this select 0;
_centerPos = getMarkerPos (_this select 1);
_placeSearchRadius = _this select 2;
_placeMinDistance = _this select 3;

// add some loot around the camp
_addLoot = {
private ["_clutter","_index","_lootMaxRadius2","_itemType","_position","_item","_nearby","_basePos","_baseClass","_lootMinRadius","_lootMaxRadius","_randomLoot","_guaranteedLoot","_lootTable","_num","_itemTypes","_weights","_cntWeights","_config", "_CBLBase","_index1","_index2"];

	_basePos = _this select 0;
	_baseClass = _this select 1;
	_lootMinRadius = _this select 2;
	_lootMaxRadius = _this select 3;
	_randomLoot = _this select 4;
	_guaranteedLoot = _this select 5;
	_lootMaxRadius2 = _lootMaxRadius + 5;
		
			_lootTable = ["HeliCrash","HeliCrash_No50s"] call BIS_fnc_selectRandom;
		
		    _num = round(random _randomLoot) + _guaranteedLoot;
			if (DZE_MissionLootTable) then {
				_itemTypes = [] + getArray (missionConfigFile >> "CfgBuildingLoot" >> _lootTable >> "lootType");
			} else {
				_itemTypes = [] + getArray (configFile >> "CfgBuildingLoot" >> _lootTable >> "lootType");
			};
			_CBLBase = dayz_CBLBase find (toLower(_lootTable));
			_weights = dayz_CBLChances select _CBLBase;
			_cntWeights = count _weights;
	
			for "_x" from 1 to _num do {
				//create loot
				_index1 = floor(random _cntWeights);
				_index2 = _weights select _index1;
				_itemType = _itemTypes select _index2;
				
				_position = [];
				_position = [_basePos,_lootMinRadius,_lootMaxRadius,0,0,0,0] call BIS_fnc_findSafePos;
				_position = [_position select 0,_position select 1,0];
				
				if ((count _position) >= 2) then {
					_position set [2,0];
					_item = [_itemType select 0, _itemType select 1, _position, 1] call spawn_loot;
					_item setVariable ["permaLoot",true];
					
					if (dayz_spawnInfectedSite_clutterCutter == 1) then { // shift loot upward to 5cm
						_position set [2,0.05];
						_item setPosATL _position;
					}
					else { if (dayz_spawnInfectedSite_clutterCutter >= 2) then { // cutterclutter
						_clutter = createVehicle ["ClutterCutter_small_2_EP1", _position, [], 0, "CAN_COLLIDE"];
						_clutter setPos _position;
						if (dayz_spawnInfectedSite_clutterCutter == 3) then { // debug
							createVehicle ["Sign_sphere100cm_EP1", [_position select 0, _position select 1, 0.30], [], 0, "CAN_COLLIDE"];					
						};
					};};
					sleep 0.001;
					diag_log(format["Infected Camps: Loot spawn at '%1:%3' with loot table '%2'", _baseClass, str(_itemType), _basePos]); 

					// ReammoBox is preferred parent class here, as WeaponHolder wouldn't match MedBox0 and other such items.
					_nearby = _basePos nearObjects ["ReammoBox", _lootMaxRadius2];
					{
						_x setVariable ["permaLoot",true];
					} forEach _nearby;
				};
			}; // loot loop
};

// add some dead bodies and veh wrecks all around
_addWrecks = {
	private ["_randomObjects","_guaranteedObjects","_position","_basePos","_objectMinRadius","_objectMaxRadius","_Bodys","_randomvehicle","_chance","_DeadBody","_wreck","_z"];
	_basePos = _this select 0;
	_objectMinRadius = _this select 1;
	_objectMaxRadius = _this select 2;
	_randomObjects = _this select 3;
	_guaranteedObjects = _this select 4;
	_z = 0;

    while {_z < ((round(random _randomObjects)) + _guaranteedObjects)} do {
		_position = [_basePos,_objectMinRadius,_objectMaxRadius,1,0,20,0] call BIS_fnc_findSafePos;
		_position = [_position select 0,_position select 1,0];
		_Bodys = ["Body1","Body2"] call BIS_fnc_selectRandom;
		_randomvehicle = ["SKODAWreck","HMMWVWreck","UralWreck","datsun01Wreck","hiluxWreck","datsun02Wreck","UAZWreck","BMP2Wreck","T72Wreck","LADAWreck"] select round(random 4);
		_chance = random 1;
		if (_chance < 0.9) then {
			_DeadBody = createVehicle [_Bodys, _position, [], 0, "CAN_COLLIDE"];
		} else {
			_wreck = createVehicle [_randomvehicle, _position, [], 0, "CAN_COLLIDE"];
		};
		_z = _z + 1;
	};
};


_placeSearchExpr = "(5 * forest) + (4 * trees) + (3 * meadow) - (20 * houses) - (30 * sea)";
_small = ["Camp1_Small","Camp2_Small","Camp3_Small"];
_medium = ["Camp2_Medium","Camp3_Medium","Camp4_Medium","Camp5_Medium"]; // "Camp2_Medium","Camp3_Medium","Camp4_Medium","Camp5_Medium"];
_large = [];
_baseArray = ["Camp1_Small","Camp2_Small","Camp3_Small","Camp2_Medium","Camp3_Medium","Camp4_Medium","Camp5_Medium"]; //use this for selection

_placePrecision = 30;
_amount = 0;
_radius = 0;
_lootMinRadius = 0; 
_lootMaxRadius = 0; 
_objectMinRadius = 0; 
_objectMaxRadius = 0; 
_randomObjects = 0; 
_guaranteedObjects = 0; 
_randomLoot = 0; 
_guaranteedLoot = 0;
_baseClass = "";
_campList = [];
_basePos = [];
_markerPos = getMarkerPos "respawn_west";
_b = _qty * 20;

_time = time;
_tmpobject = "Land_HouseV2_05" createVehicleLocal _markerPos;
while {(_b > 0) && (_qty > 0) && (round(time - _time) < 35)} do {
	_baseClass = _baseArray select round(random ((count _baseArray) - 1));
	if (_baseClass in _small) then { _amount = 10; _radius = 100; _lootMinRadius = 8; _lootMaxRadius = 13; _objectMinRadius = 10; _objectMaxRadius = 20; _randomObjects = 8; _guaranteedObjects = 2; _randomLoot = 3; _guaranteedLoot = 4; };
	if (_baseClass in _medium) then { _amount = 25; _radius = 150; _lootMinRadius = 13; _lootMaxRadius = 20; _objectMinRadius = 10; _objectMaxRadius = 20; _randomObjects = 8; _guaranteedObjects = 2; _randomLoot = 4; _guaranteedLoot = 5; };
	if (_baseClass in _large) then { _amount = 40; _radius = 200; _lootMinRadius = 20; _lootMaxRadius = 30; _objectMinRadius = 10; _objectMaxRadius = 20; _randomObjects = 8; _guaranteedObjects = 2; _randomLoot = 5; _guaranteedLoot = 6; };
	{
		if (_x select 1 > 3) then {
			_basePos = _x select 0;
			if (count _basePos >= 2) then {
				_basePos set [2, 0];
				_nextPos = _basePos findEmptyPosition [0, _placePrecision, "Land_HouseV2_05"];
				_basePos = _nextPos;
				if (count _basePos >= 2) then {
					_basePos set [2, 0];
					_tmpobject setPosATL _basePos;
					//sleep 0.003;
					_basePos = _tmpobject modelToWorld (boundingCenter _tmpobject); 
					//sleep 0.003;
					_basePos set [2, 0];
					_tmpobject setPosATL _markerPos;
					//sleep 0.003;
					_basePos = _basePos isFlatEmpty [0, 0, _lootMaxRadius * 0.03, _lootMaxRadius, 0, false, objNull];
					if (count _basePos >= 2) then {
						_basePos set [2, 0];
						if ((0 == count (nearestObjects [_basePos, [], _lootMaxRadius])) AND {(0 == { ((_x select 0) distance _basePos) < _placeMinDistance } count _campList)}) then {
							_campList set [count _campList, [_basePos,_amount,_radius]];
							//diag_log(format["%1 found a nice spot at %2 (%3)", __FILE__, _basePos call fa_coor2str,_x select 1]);
							[_basePos, random 360, _baseClass] call spawnComposition;
							[_basePos, _baseClass, _lootMinRadius, _lootMaxRadius, _randomLoot, _guaranteedLoot] call _addLoot;
							[_basePos, _lootMinRadius, _lootMaxRadius, _randomObjects, _guaranteedObjects] call _addWrecks; //more removable wreckshit ??
							_qty = _qty - 1;
						};
					};
				};
			};
			//sleep 0.01;
		};
	_b = _b - 1;
	} forEach selectBestPlaces [_centerPos, _placeSearchRadius, _placeSearchExpr, _placePrecision, _qty];
};
deleteVehicle _tmpobject;

diag_log(format["%1: found %2 camps spots in %3 sec.", __FILE__, count _campList, round(time - _time)]);

_campList
 

 

this is for DZE 105x - its untest, tell me if its working.

 

cheers

Thank you!! It's worked! But no spawn zombies.. I not teleport to camp, no error rpt log.. 

Link to comment
Share on other sites

  • 1 month later...

Thanks to shootingblanks on opendayz, he made a video on how to add map markers and posted it on my topic over there .. here is the video ... its soo freakin easy when u know how lol!   :D 
NOW I have map markers all over .. I even placed my self in the map and made a marker to da Squirrel on a bill board .. info stand click to hear msg from da Squirrel LOL

Link to comment
Share on other sites

  • 3 months later...

Hi, 

 

Not sure if this is an out-of-date thread, but I fixed the issue with zeds not spawning. Got back into DayZ after not playing for about 18months-2 years, and am incorporating customizations like this into my 1.7.6.1 based vanilla server. Looks like everyone is playing Epoch now :) . First off thanks JOoPs for providing this guide. The zeds will spawn if you are the first connecting player, as the "dayzInfectedCamps" public variable event handler gets called on both the server and the client after the server calls fn_bases (since the server and first connecting client initialize together). This causes the client to call 'infectedcamps' (object_infectedcamps.sqf) and generate the client side triggers. 

 

The problem is when new connecting clients join, or the first client disconnects and re-joins, the  "dayzInfectedCamps" public variable is not called after initialization so the client side triggers dont get created in  (object_infectedcamps.sqf).

 

My solution after referring to (http://killzonekid.com/arma-scripting-tutorials-basic-multiplayer-coding/) was, in the ' dayz_code/init/publicEH.sqf'  file to also add:

 

//'gcipacket' used to spawn client side triggers for infected camps on clients after server is done creating them
if (isDedicated) then { 
    "gcipacket" addPublicVariableEventHandler {
        _pcid = owner (_this select 1 select 0);
        gcipacket = dayzInfectedCamps;
        _pcid publicVariableClient "gcipacket";
    };
} else {
    "gcipacket" addPublicVariableEventHandler {
(_this select 1 ) call infectedcamps};
    
};
 
You can add this under "dayzInfectedCamps"        addPublicVariableEventHandler {(_this select 1) call infectedcamps}; ​if you like.
 
Then I created a new sqf file called client_create_camp_trigs.sqf  and put this under a directory called 'custom'.
 
So In custom/client_create_camp_trigs.sqf I added:
 
gcipacket = [player,time]; 
publicVariableServer "gcipacket"; //'dummy' variable to force server to give the client it's dayz_infectedcamps value on initialization.
 
Finally at the bottom of the init.sqf file I made a call to it like so:
 
if (!isDedicated) then
 {
[] execVM "custom\client_create_camp_trigs.sqf";
};  

 

There are probably more elegant ways to solve it, and there *might* be some potential issues, but it worked for me after testing. Triggers to spawn the zeds/infected get created for the first connecting client, as well as subsequent connections.The 'gcipacket' public variable is set  on the client when initializing, which calls the server's public eventhander for it, which sends the 'dayzInfectedCamps' collection to that specific client's 'gcipacket' event handler which finally calls the infectedcamps function to create the triggers. :P

 

Anyways this took me a while to solve, but glad to have the camps working, they are very cool.

 

EDIT: You dont need to set gcipacket = [player,time];  You can just use gcipacket = player; Then you can change  _pcid = owner (_this select 1 select 0); to  _pcid = owner (_this select 1);

Link to comment
Share on other sites

  • 5 months later...
RPT Client:
"PLOGIN: Retrying Authentication... (xxxxx)"
"PLOGIN: Retrying Authentication... (xxxxx)"
"PLOGIN: Retrying Authentication... (xxxxx)"
"PLOGIN: Retrying Authentication... (xxxxx)"
"PLOGIN: Retrying Authentication... (xxxxx)"
"PLOGIN: Retrying Authentication... (xxxxx)"
"PLOGIN: Authentication Failed (xxxxx)"
"End Mission"
Use 1.0.5.1 Epoch and Tavi map
When i delete this script all work
Link to comment
Share on other sites

  • 4 months later...

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...