Jump to content

[Release] Lootspawner, configurable building loot system


Suppe

Recommended Posts

  • 1 month later...
  • 3 months later...

Thanks for sharing this @Suppe

This is great I was able to use it to spawn RHSUSAF loot on a Tanoa Life server :biggrin: 

I'm sure it will work on any map with any mod!

---------------------------

What I did:

1) edit the LSlootBuildings.sqf and add the building names from Tanoa. (or any map)

2) Edit the LSlootLists.sqf and add the weapons / gear / ammo and item names from the mod your using 

3) That's it - repack / upload / profit!

--------------------------

FOR TESTING ONLY - try using these variables in the Lootspawner.sqf 

//Variables
//local
_spawnradius = 50;                    //Radius (in meter) around players to spawn loot
_spInterval = 60;                         //Time (in sec.) to pass before an building spawns new loot
_chfullfuel = 35;                          //Chance (in %) of a spawned fuelcan to be full instead of empty
_genZadjust = -0.1;                    //High adjustment (in engine units) thats generally added to every spawnpoint
_tmpTstPlace = [];                     //Coord's, in [x,y,z] of a preferably flat and unocupied piece of land
_chperSpot = 100;                    //Chance (in %) if a spot gets loot

Link to comment
Share on other sites

  • 3 weeks later...
On 2/27/2015 at 3:53 PM, Suppe said:

because now lazy people can no longer view or steal your settings.

What ever happen to epoch being a place you come to share your information? It is the place to come and share. I have built a lot of custom AI cities and have given them out to admins trying to get started, hell there have been times I have given server, mission pbos out.

Just saying. :blink:  

Link to comment
Share on other sites

43 minutes ago, Thug said:

What ever happen to epoch being a place you come to share your information? It is the place to come and share. I have built a lot of custom AI cities and have given them out to admins trying to get started, hell there have been times I have given server, mission pbos out.

Just saying. :blink:  

That was written in 2015 @Thug There was a lot going on back in 2015 that caused some of the attitude you saw in that post.

I think most people in the community today are very, very sharing. I personally have learned many things from others here and received a lot of help on fixing problems and adding functionality.

Link to comment
Share on other sites

  • 3 weeks later...

Still struggling to add loot to buildings.
Running A3 Epoch v.5 + Open Chernarus Project
So problem I guess is adding loot positions to the new "enterable" buildings.
Just adding the buildings to the LSlootBuildings.sqf does not make loot spawn, right?

I'm guessing I have to somewhere add "loot positions" for those buildings.

Can someone please point me to where I can find "how to" do this?

Thanks in advance.

Link to comment
Share on other sites

OCP does not have the LODs defined for buildings yet afaik (lootspawner places loot where AI are defined to stand based on the buildings being defined for this)... This is as far as I understand being worked on. In the interim you would need to use the Epoch tools (specifically saveLootPositionsVector.sqf) to define Epoch loot container positions (beds, chairs, tables, etc.) for any loot to be in those buildings.

Link to comment
Share on other sites

  • 3 weeks later...

One of the reasons I first started using LootSpawner was the fact that I could tailor loot to a specific type of building (e.g. military loot predominantly in military buildings, medical in hospitals, etc.) but one failing has been its reliance on building positions being set up by map developers for each of the buildings used on the map. Recently, for example, I know of someone who really wanted to use Napf for an Epoch server but was really unable to do so because the buildings have not been defined for standard Epoch loot (the beds, tables, chairs, etc.) and the map's new buildings did not have building positions defined, so LootSpawner would not create ground loot.

Well, that got me thinking (as did the fact that I'm using @DirtySanchez's Open Chernarus Project to add additional new buildings to Chernarus. Of course the new buildings do not have positions defined that LootSpawner can use.... but Exile does... :ph34r:

Here I present some code fixes to allow you to use the Exile Loot Position files for any map with the old LootSpawner system. Credit for LootSpawner goes to the original developers and @Suppe(who produced so much good software for Epoch back in the old days).

So, in order to get this working you need to download the original LootSpawner files and make the following changes:

Replace LootSpawner.sqf with:

Spoiler

//	Lootspawner setup and control script
//	Author: Na_Palm (BIS forums)
//	credit to: Ed! (404Forums) and [GoT] JoSchaap (GoT2DayZ.nl) for initial script
//-------------------------------------------------------------------------------------
if (!isServer) exitwith {};
private["_buildingname","_chfullfuel","_chperSpot","_class","_dbgloopTime","_dbgloopTimeplU","_dbgTime","_dbgTurns","_dbgTurnsplU","_endloop","_genZadjust","_hndl","_item","_nearLootdist","_pos","_posAdjustZ","_posAdjustZlist","_poscount","_posIdxlist","_posnew","_posOrg","_posViable","_randomweapontestint","_spawnradius","_spInterval","_testpos","_tmpBuild","_tmpPoslist","_tmpTstPlace","_z"];
//-------------------------------------------------------------------------------------
//Switch
swDebugLS = false;					//Debug messages on/off
swSpZadjust = false;				//needed for ArmA 2 and older Maps/Buildings -> true

//-------------------------------------------------------------------------------------
//Variables
//local
_spawnradius = 80;					//Radius (in meter) around players to spawn loot
_spInterval = 1800;					//Time (in sec.) to pass before an building spawns new loot
_chfullfuel = 35;					//Chance (in %) of a spawned fuelcan to be full instead of empty
//_genZadjust = -0.1;					//High adjustment (in engine units) thats generally added to every spawnpoint
_genZadjust = 0;					//High adjustment (in engine units) thats generally added to every spawnpoint
_tmpTstPlace = [14730, 16276, 0];	//Coord's, in [x,y,z] of a preferably flat and unocupied piece of land
_chperSpot = 75;					//Chance (in %) if a spot gets loot. Will be considered before 'spawnClassChance_list'

//"spawnClassChance_list" array of [class, %weapon, %magazine, %ICV, %backpack, %object]
//									class   	: same classname as used in "Buildingstoloot_list"
//									%magazine 	: % chance to spawn magazines on spot
//									%weapon 	: % chance to spawn a weapon on spot
//									%ICV	   	: % chance to spawn item/cloth/vests on spot
//									%backpack 	: % chance to spawn a backpack on spot
//									%object 	: % chance to spawn an world object on spot
//-------------- A VALUE OF '-1' RESULTS IN NO LOOT FOR THIS CLASS AND TYPE ----------------
spawnClassChance_list = [
[0, 13, 21, 24, 18, 22],	// civil
[1, 22, 36, 28, 26, 18],	// military
[2, 10, 21, 28, 26, 36],	// industrial
[3, 12, 36, 36, -1, -1]		// research
];

//"exclcontainer_list" single array of container classnames to NOT to delete if filled
exclcontainer_list = [
"Box_East_Ammo_F", "Box_East_AmmoOrd_F", "Box_East_AmmoVeh_F", "Box_East_Grenades_F", "Box_East_Support_F",
"Box_East_Wps_F", "Box_East_WpsLaunch_F", "Box_East_WpsSpecial_F",
"Box_IND_Ammo_F", "Box_IND_AmmoOrd_F", "Box_IND_AmmoVeh_F", "Box_IND_Grenades_F", "Box_IND_Support_F",
"Box_IND_Wps_F", "Box_IND_WpsLaunch_F", "Box_IND_WpsSpecial_F",
"Box_NATO_Ammo_F", "Box_NATO_AmmoOrd_F", "Box_NATO_AmmoVeh_F", "Box_NATO_Grenades_F", "Box_NATO_Support_F",
"Box_NATO_Wps_F", "Box_NATO_WpsLaunch_F", "Box_NATO_WpsSpecial_F"
];

//-------------------------------------------------------------------------------------
//DONT change these, will be filled in MAIN -------------------------------------------
spawnBuilding_list = [];
Buildingpositions_list = [];
LSusedclass_list = ["GroundWeaponHolder"];
//DONT change these, will be filled in MAIN -------------------------------------------
//-------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------
//Buildings that can spawn loot go in this list
#include "LSlootBuildings.sqf"
//Loot goes in these lists
#include "LSlootLists.sqf"

//-------------------------------------------------------------------------------------
//function only runs once on beginning of mission, not really needs a compile 
//fill spawnBuilding_list with buildingnames only
getListBuildingnames = {
	{
		spawnBuilding_list set [count spawnBuilding_list, (_x select 0)];
		//diag_log format["-- LOOTSPAWNER DEBUG add to spawnBuilding_list: %1 ", (_x select 0)];
	}forEach Buildingstoloot_list;
};

//-------------------------------------------------------------------------------------
//function only runs once on beginning of mission, not really needs a compile 
//get list of all Lootspawner generatable 'Worldobjects'
getUsedclasses = {
	for "_class" from 0 to ((count lootworldObject_list) - 1) do {
		for "_item" from 0 to ((count ((lootworldObject_list select _class) select 1)) - 1) do {
			if !((((lootworldObject_list select _class) select 1) select _item) in LSusedclass_list) then {
				LSusedclass_list set [count LSusedclass_list, (((lootworldObject_list select _class) select 1) select _item)];
			};
			sleep 0.001;
		};
		sleep 0.001;
	};
};

EPOCH_returnConfigV2 = {
	private ["_missionconfig","_return"];
	_return = configfile;
	_missionconfig = missionConfigFile;
	{
		_return = (_return >> _x);
		_missionconfig = (_missionconfig >> _x);
	} forEach _this;
	if (isClass _missionconfig) then{
		_return = _missionconfig;
	};
	_return
};

//-------------------------------------------------------------------------------------
//function only runs once on beginning of mission, not really needs a compile 
//fill Buildingpositions_list with [_buildingname, [_posIdxlist], [_posAdjustZlist]] 
getListBuildingPositionjunction = {
	_tmpTstPlace = _this select 0;
	_randomweapontestint = 0.01;	//Sets the highintervals in which weaponpositions are tested. (Lower = slower, but more accurate. Higher = faster, but less accurate.)
	_nearLootdist = 0.5;
	{
		_buildingname = _x;
			_poscount = 0;
			_posAdjustZlist = [];
			_posIdxlist = [];
			_tmpPoslist = [];

				_cfgLootPositions = ["CfgLootPositions", _buildingname] call EPOCH_returnConfigV2;
				_BuildingLocs = getArray(_cfgLootPositions >> "positions");

				{
					_pos = _x;
					_posOrg = _pos;
					_posViable = true;
					_tmpPoslist set [count _tmpPoslist, _pos];
					//get Z adjustment for position
					if (_posViable) then {
						_posIdxlist set [count _posIdxlist, _poscount];
						_posAdjustZ = 0;
						if (swSpZadjust) then {
							if(_pos select 2 < 0) then {
								_pos = [_pos select 0, _pos select 1, 1];
							};
							_z = 0;
							_posnew = _pos;
							_testpos = true;
							while {_testpos} do 
							{
								if((!lineIntersects[ATLtoASL(_pos), ATLtoASL([_pos select 0, _pos select 1, (_pos select 2) - (_randomweapontestint * _z)])]) && (!terrainIntersect[(_pos), ([_pos select 0, _pos select 1, (_pos select 2) - (_randomweapontestint * _z)])]) && (_pos select 2 > 0)) then {
									_posnew = [_pos select 0, _pos select 1, (_pos select 2) - (_randomweapontestint * _z)];
									_z = _z + 1;
								} else {
									_testpos = false;
								};
							};
							_posnew = [_posnew select 0, _posnew select 1, (_posnew select 2) + 0.05];
							_posAdjustZ = (_posOrg select 2) - (_posnew select 2);
//							diag_log format["-- LOOTSPAWNER DEBUG adjusted %1 times", _z];
							_posAdjustZlist set [count _posAdjustZlist, _posAdjustZ];
						} else {
							_posAdjustZlist set [count _posAdjustZlist, _posAdjustZ];
						};
					};
					_poscount = _poscount + 1;
				} foreach _BuildingLocs;
				//diag_log format["-- LOOTSPAWNER DEBUG add to Buildingpositions_list: v%1v v%2v v%3v v%4v added", _buildingname, _tmpPoslist, _posIdxlist, _posAdjustZlist];
				Buildingpositions_list set [count Buildingpositions_list, [_buildingname, _tmpPoslist, _posIdxlist, _posAdjustZlist]];
	}forEach spawnBuilding_list;
};

//-------------------------------------------------------------------------------------
// MAIN
//-------------------------------------------------------------------------------------
diag_log format["-- LOOTSPAWNER initialise ------------------------"];
if ((count Buildingstoloot_list) == 0) then {
	diag_log format["--!!ERROR!! LOOTSPAWNER Buildingstoloot_list in lootBuildings.sqf MUST have one entry at least !!ERROR!!--"];
	diag_log format["-- LOOTSPAWNER disabled --"];
} else {
	_dbgTime = time;
	_hndl = [] spawn getListBuildingnames;
	waitUntil{scriptDone _hndl};
	diag_log format["-- LOOTSPAWNER spawnBuilding_list ready, d: %1s", (time - _dbgTime)];
	_dbgTime = time;
	_hndl = [_tmpTstPlace] spawn getListBuildingPositionjunction;
	waitUntil{scriptDone _hndl};
	diag_log format["-- LOOTSPAWNER Buildingpositions_list ready, d: %1s", (time - _dbgTime)];
	_dbgTime = time;
	_hndl = [] spawn getUsedclasses;
	waitUntil{scriptDone _hndl};
	diag_log format["-- LOOTSPAWNER LSusedclass_list ready, d: %1s", (time - _dbgTime)];
	//run loot deleter continously
	null = _spInterval spawn LSdeleter;
	diag_log format["-- LOOTSPAWNER LSDer started..."];
	if (swDebugLS) then {
		dbgTime = time;
		dbgTurns = 0;
		dbgTurnsplU = 0;
		dbgloopTime = 0;
		dbgloopTimeplU	= 0;
	};
	diag_log format["-- LOOTSPAWNER ready and waiting for players -----"];
	//go into mainloop till mission ends
	while {true} do {
		_playersalive = false;
		{
			if (swDebugLS) then {
				dbgTimeplU = time;
			};
			//is Player online and alive?
			if ((isPlayer _x) && (alive _x)) then {
				_playersalive = true;
				//jogging has 4.16..., sprinting has 5.5... so if player velocity is < 6 spawn loot
				//works for players in vehicles too
				if (((velocity _x) distance [0,0,0]) < 6) then {
				//if ((vehicle _x isKindOf "Land") || (vehicle _x isKindOf "Ship")) then {
					_posPlayer = getPos _x;
					//get list of viable buildings around player
					_BaP_list = nearestObjects [_posPlayer, spawnBuilding_list, _spawnradius];
					if ((count _BaP_list) > 0) then {
						//give to spawn function
						_hndl = [_BaP_list, _spInterval, _chfullfuel, _genZadjust, _chperSpot] spawn fn_getBuildingstospawnLoot;
						waitUntil{scriptDone _hndl};
					};
				};
			};
			sleep 0.001;
			if (swDebugLS) then {
				dbgloopTimeplU = dbgloopTimeplU + (time - dbgTimeplU);
				dbgTurnsplU = dbgTurnsplU + 1;
			};
		}forEach allPlayers;
		if (swDebugLS) then {
			dbgloopTime = dbgloopTime + dbgloopTimeplU;
			dbgloopTimeplU	= 0;
			dbgTurns = dbgTurns + 1;
			//every 30 sec. give stats out
			if ((time - dbgTime) > 30) then {
				if (dbgTurnsplU > 0) then {
					diag_log format["-- DEBUG LOOTSPAWNER MAIN turns (spawned): %1(%2), duration: %3sec, average: %4sec.",dbgTurns ,dbgTurnsplU , dbgloopTime, (dbgloopTime / dbgTurnsplU)];
				} else {
					diag_log format["-- DEBUG LOOTSPAWNER MAIN waiting for players"];
				};
				dbgTime = time;
				dbgTurns = 0;
				dbgTurnsplU = 0;
				dbgloopTime = 0;
			};
		};
		//if no players online wait a bit
		if (!_playersalive) then {
			sleep 2;
		};
	};
};

 

Spoiler

 

 

Spoiler
 

If, like me you have altered the chances of loot spawning or added additional loot building classes do not forget to change that in this file.

Replace fn_LSgetBuildingstospawnLoot.sqf with:

Spoiler

//	Lootspawner spawn script
//	Author: Na_Palm (BIS forums)
//-------------------------------------------------------------------------------------
//local to Server Var. "BuildingLoot" array of [state, time], placed on buildings that can spawn loot
//												state: 0-not assigned, 1-has loot, 2-currently in use/blockaded
//												time : timestamp of last spawn
//
//local to Server Var. "Lootready" time, placed on generated lootobject, needed for removing old loot
//									time: timestamp of spawn, object is ready for use by player and loot deleter
//-------------------------------------------------------------------------------------
private["_begintime","_BaP_list","_spInterval","_chfullfuel","_chpSpot","_genZadjust","_BaPname","_lootClass","_buildPosPosition_list","_buildPosViable_list","_buildPosZadj_list","_lBuildVar","_posviablecount","_spwnPos","_lootspawned","_randChance","_lootholder","_selecteditem","_loot","_chfullf","_idx_sBlist","_chperSpot","_tmpPos","_bldgPos","_BaPPos"];

//BaP - Buildings around Player
_BaP_list = _this select 0;
_spInterval = _this select 1;
_chfullfuel = _this select 2;
_genZadjust = _this select 3;
_chpSpot = _this select 4;

_begintime = time;
{
	_BaPname = "";
	_lootClass = 0;
	_buildPosPosition_list = [];
	_buildPosViable_list = [];
	_buildPosZadj_list = [];
	_bldgPos = [];
	_BaPPos = [];
	_lBuildVar = (_x getVariable ["BuildingLoot", [0, 0]]);
	//diag_log format["-- LOOTSPAWNER DEBUG BaP _lBuildVar: v%1v v%2v --", _lBuildVar ,_x];
	if ((_lBuildVar select 0) < 2) then {
		//flag immediately as in use
		_x setVariable ["BuildingLoot", [2, (_lBuildVar select 1)]];
		if (((_lBuildVar select 1) == 0) || ((time - (_lBuildVar select 1)) > _spInterval)) then {
			//get building class
			_BaPname = typeOf _x;
			//here an other _x
			{
				//if junction found, get lists and -> exit forEach
				if (_BaPname == (_x select 0)) exitWith {
					_lootClass = (_x select 1);
					//get viable positions Idx
					_buildPosPosition_list set [count _buildPosPosition_list, ((Buildingpositions_list select _forEachIndex) select 1)];
					_buildPosViable_list set [count _buildPosViable_list, ((Buildingpositions_list select _forEachIndex) select 2)];
					if (swSpZadjust) then {
						//get position adjustments
						_buildPosZadj_list set [count _buildPosZadj_list, ((Buildingpositions_list select _forEachIndex) select 3)];
					};
				};
				sleep 0.001;
			}forEach Buildingstoloot_list;
			//diag_log format["-- LOOTSPAWNER DEBUG BaP: v%1v%2v :: v%3v :: v%4v :: v%5v --", _BaPname, _lootClass, _buildPosPosition_list, _buildPosViable_list, _buildPosZadj_list];
			//get spawn position, here the former _x
			_posviablecount = 0;
			for "_poscount" from 0 to 100 do {
				//check if position is viable
				if (_poscount == ((_buildPosViable_list select 0) select _posviablecount)) then {
					_posviablecount = _posviablecount +1;
					//consider chance per Slot
					if ((floor random 100) < _chpSpot) then {
						_bldgPos = ((_buildPosPosition_list select 0) select _poscount);
						_spwnPos = ASLToATL (AGLToASL (_x modelToWorld _bldgPos));
						if (_spwnPos select 2 < 0.05) then
						{
							_spwnPos set [2, 0.05];
						};

						_tmpPos = [(_spwnPos select 0), (_spwnPos select 1), 60000];
						//diag_log format["-- LOOTSPAWNER DEBUG Checking spawn point: v%1v v%2v --", _spwnPos, _tmpPos];

						if ((_spwnPos select 0) == 0 && (_spwnPos select 1) == 0) then {
							//diag_log format["-- LOOTSPAWNER: Do not want to be here"];
							_spwnPos = getPosATL _x;
							_tmpPos = [(_spwnPos select 0), (_spwnPos select 1), 60000];
						};
						if (swSpZadjust) then {
							_spwnPos = [_spwnPos select 0, _spwnPos select 1, (_spwnPos select 2) + ((_buildPosZadj_list select 0) select _poscount)];
						};
						//generally add 0.1 on z
						_spwnPos = [_spwnPos select 0, _spwnPos select 1, (_spwnPos select 2) + _genZadjust];
						//check if position has old loot
						if ((count (nearestObjects [_spwnPos, LSusedclass_list, 0.5])) == 0) then {
							sleep 0.001;
							//check what type of loot to spawn
							_lootspawned = false;
							for "_lootType" from 1 to 4 do {
								//get chance for loot every time, so all combos in spawnClassChance_list are viable
								_randChance = floor(random(100));
								if (((spawnClassChance_list select _lootClass) select _lootType) > _randChance) then {
									_lootspawned = true;
									//special for weapons
									if(_lootType == 1) exitWith {
										_lootholder = createVehicle ["GroundWeaponHolder", _tmpPos, [], 0, "CAN_COLLIDE"];
										_selecteditem = (floor(random(count((lootWeapon_list select _lootClass) select 1))));
										_loot = (((lootWeapon_list select _lootClass) select 1) select _selecteditem);
										_lootholder addWeaponCargoGlobal [_loot, 1];
										_lootholder setdir (random 360);
										_lootholder setPosATL _spwnPos;
									};
									//special for magazines
									if(_lootType == 2) exitWith {
										_lootholder = createVehicle ["GroundWeaponHolder", _tmpPos, [], 0, "CAN_COLLIDE"];
										_selecteditem = (floor(random(count((lootMagazine_list select _lootClass) select 1))));
										_loot = (((lootMagazine_list select _lootClass) select 1) select _selecteditem);
										_lootholder addMagazineCargoGlobal [_loot, 1];
										_lootholder setdir (random 360);
										_lootholder setPosATL _spwnPos;
									};
									//special for item/cloth/vests
									if(_lootType == 3) exitWith {
										_lootholder = createVehicle ["GroundWeaponHolder", _tmpPos, [], 0, "CAN_COLLIDE"];
										_selecteditem = (floor(random(count((lootItem_list select _lootClass) select 1))));
										_loot = (((lootItem_list select _lootClass) select 1) select _selecteditem);
										_lootholder addItemCargoGlobal [_loot, 1];
										_lootholder setdir (random 360);
										_lootholder setPosATL _spwnPos;
									};
									//special for backpacks
									if(_lootType == 4) exitWith {
										_lootholder = createVehicle ["GroundWeaponHolder", _tmpPos, [], 0, "CAN_COLLIDE"];
										_selecteditem = (floor(random(count((lootBackpack_list select _lootClass) select 1))));
										_loot = (((lootBackpack_list select _lootClass) select 1) select _selecteditem);
										_lootholder addBackpackCargoGlobal [_loot, 1];
										_lootholder setdir (random 360);
										_lootholder setPosATL _spwnPos;
									};
									//special for world objects: account for Wasteland and other items
									//if(_lootType == 5) exitWith {
										//_selecteditem = (floor(random(count((lootworldObject_list select _lootClass) select 1))));
										//_loot = (((lootworldObject_list select _lootClass) select 1) select _selecteditem);
										//_lootholder = createVehicle [_loot, _tmpPos, [], 0, "CAN_COLLIDE"];
										//if(_loot == "Land_CanisterFuel_F") then {
											//_chfullf = (random 100);
											//if (_chfullfuel > _chfullf) then {
												//_lootholder setVariable["mf_item_id", "jerrycanfull", true];
											//} else {
												//_lootholder setVariable["mf_item_id", "jerrycanempty", true];
											//};
										//};
										//if(_loot == "Land_CanisterOil_F") then {
											//_lootholder setVariable["mf_item_id", "syphonhose", true];
										//};
										//if(_loot == "Land_Can_V3_F") then {
											//_lootholder setVariable["mf_item_id", "energydrink", true];
										//};
										//if(_loot == "Land_Basket_F") then {
											//_lootholder setVariable["mf_item_id", "cannedfood", true];
										//};
										//if(_loot == "Land_CanisterPlastic_F") then {
											//_lootholder setVariable["mf_item_id", "water", true];
										//};
										//if(_loot == "Land_Suitcase_F") then {
											//_lootholder setVariable["mf_item_id", "repairkit", true];
										//};
										//if container clear its cargo
										//if (({_x == _loot} count exclcontainer_list) > 0) then {
										//	clearWeaponCargoGlobal _lootholder;
										//	clearMagazineCargoGlobal _lootholder;
										//	clearBackpackCargoGlobal _lootholder;
										//	clearItemCargoGlobal _lootholder;
										//};
										//_lootholder setdir (random 360);
										//_lootholder setPosATL _spwnPos;
									//};
								};
								//1 category loot only per place so -> exit For
								//no lootpiling
								if (_lootspawned) exitWith {
									_lootholder setVariable ["Lootready", time];
								};
							};
						};
					};
				};
				//if all viable positions run through -> exit For
				if (_posviablecount == (count (_buildPosViable_list select 0))) exitWith {};
			};
			//release building with new timestamp
			_x setVariable ["BuildingLoot", [1, time]];
		} else {
			//release building with old timestamp
			_x setVariable ["BuildingLoot", [1, (_lBuildVar select 1)]];
		};
	};
	sleep 0.001;
}forEach _BaP_list;
//diag_log format["-- LOOTSPAWNER DEBUG BaP: %1 buildings ready, needed %2s, EXIT now --", (count _BaP_list), (time - _begintime)];

Now, find an Exile CfgBuildings.h for the map you are using. You need to create a new file in your mission file in epoch_config/Configs called CfgLootPositions.hpp. Copy the code from the CfgBuildings.h into this and wrap the whole thing in:

class CfgLootPositions {

... the original file contents ...

};

UPDATE: I did, of course, forget to mention that this new file must be loaded along with the standard Epoch config files in the mission's epoch_config/sandbox_config.hpp. Just add this line to that file:

#include "Configs\CfgLootPositions.hpp"

Now just make sure that all the buildings are listed in the LootSpawner LSlootBuildings.sqf file.

Rebuild the loot_spawner and mission PBOs and upload to your server. Now you have loot spawning on the ground, on bunks, under them, on tables and shelves, depending on what the original author of the loot position config provides.

If you want to change a building's loot positions or add a new building not covered in the CfgLootPositions then simply download the Exilemod Loot Position Creator which does not require that other mod to run and is pretty easy to use and set things up how you would like them.

TODO: Tidy up the code and add error checking on whether the buildings defined in LSlootBuildings.sqf are defined in the new CfgLootPositions.hpp

Link to comment
Share on other sites

  • 1 month later...

@Grahame

wow yet another top shelf solution thx

thou weapons spawn with no ammo

// what i use
if(_lootType == 1) exitWith {
	_lootholder = createVehicle ["WeaponHolderSimulated", _tmpPos, [], 0, "CAN_COLLIDE"];
	_selecteditem = (floor(random(count((lootWeapon_list select _lootClass) select 1))));
	_loot = (((lootWeapon_list select _lootClass) select 1) select _selecteditem);
	_lootholder addWeaponCargoGlobal [_loot, 1];
	//Function to add the right magazine for a weapon. added 12 feb 17 line 84 to 87 thx Cameltoe
	_ammo = [] + getArray (configFile >> "cfgWeapons" >> _loot >> "magazines");
	_lootholder addMagazineCargoGlobal [(_ammo select 0),(round(random 4))]; //max 4 magazines per weapon
	//end custom function
	_lootholder setdir (random 360);
	_lootholder setPosATL _spwnPos;
};

// what you put up
if(_lootType == 1) exitWith {
	_lootholder = createVehicle ["GroundWeaponHolder", _tmpPos, [], 0, "CAN_COLLIDE"];
	_selecteditem = (floor(random(count((lootWeapon_list select _lootClass) select 1))));
	_loot = (((lootWeapon_list select _lootClass) select 1) select _selecteditem);
	_lootholder addWeaponCargoGlobal [_loot, 1];
	_lootholder setdir (random 360);
	_lootholder setPosATL _spwnPos;
};

hope it helps

Edited by natoed
added shit
Link to comment
Share on other sites

10 hours ago, natoed said:

@Grahame

wow yet another top shelf solution thx

thou weapons spawn with no ammo


// what i use
if(_lootType == 1) exitWith {
	_lootholder = createVehicle ["WeaponHolderSimulated", _tmpPos, [], 0, "CAN_COLLIDE"];
	_selecteditem = (floor(random(count((lootWeapon_list select _lootClass) select 1))));
	_loot = (((lootWeapon_list select _lootClass) select 1) select _selecteditem);
	_lootholder addWeaponCargoGlobal [_loot, 1];
	//Function to add the right magazine for a weapon. added 12 feb 17 line 84 to 87 thx Cameltoe
	_ammo = [] + getArray (configFile >> "cfgWeapons" >> _loot >> "magazines");
	_lootholder addMagazineCargoGlobal [(_ammo select 0),(round(random 4))]; //max 4 magazines per weapon
	//end custom function
	_lootholder setdir (random 360);
	_lootholder setPosATL _spwnPos;
};

// what you put up
if(_lootType == 1) exitWith {
	_lootholder = createVehicle ["GroundWeaponHolder", _tmpPos, [], 0, "CAN_COLLIDE"];
	_selecteditem = (floor(random(count((lootWeapon_list select _lootClass) select 1))));
	_loot = (((lootWeapon_list select _lootClass) select 1) select _selecteditem);
	_lootholder addWeaponCargoGlobal [_loot, 1];
	_lootholder setdir (random 360);
	_lootholder setPosATL _spwnPos;
};

hope it helps

LOL, true. I had added that functionality to my version after posting on the forum:

									if(_lootType == 1) exitWith {
										_lootholder = createVehicle ["GroundWeaponHolder", _tmpPos, [], 0, "CAN_COLLIDE"];
										_selecteditem = (floor(random(count((lootWeapon_list select _lootClass) select 1))));
										_loot = (((lootWeapon_list select _lootClass) select 1) select _selecteditem);
										_lootholder addWeaponCargoGlobal [_loot, 1];
										// Add a magazine with a random number of rounds in items
										_mags = getArray (configFile >> "CfgWeapons" >> _loot >> "magazines");
										if !(_mags isEqualTo []) then {
											_magazineSize = getNumber (configFile >> "CfgMagazines" >> (_mags select 0) >> "count");
											_lootholder addMagazineAmmoCargo[_mags select 0, 1, ceil(random(_magazineSize))];
										};
										_lootholder setdir (random 360);
										_lootholder setPosATL _spwnPos;
									};

I took the code from Epoch's loot generator, which is why it was not posted, but it includes a check that magazines returns an array with elements defined... 

Link to comment
Share on other sites

Also note that the code I use for random magazines, spawns one mag with a variable number of rounds left. I feel personally that that is more realistic but there should probably be a variable where you can specify whether you want that or a random number of mags (and be able to specify the maximum number of mags if so)

Link to comment
Share on other sites

LSlootBuildings.sqf

altis, Chernarus and Isla Abramia maps

btw i use second_coming version ie:

spawnClassChance_list = [
[0, 31, 28, 38, 28, -1],      // civil
[1, 31, 28, 42, 28, -1],    // military
[2, 12, 19, 16, 10, -1],    // industrial
[3, 22, 22, 32, 11, -1],      // research
[4, 10, 19, 17, 12, -1],    // medical
[5, -1, 50, 50, -1, -1],     // food
[6, 15, 15, 22, 10, -1]        // hangars
];

 

Spoiler

//    Lootspawner junction list for buildings to classes
//    Author: Na_Palm (BIS forums)
//-------------------------------------------------------------------------------------
//"Buildingstoloot_list" array of [buildingname, class]
//                                buildingname:     building class name (in editor debug console use "typeof BIS_fnc_camera_target"
//                                                to monitor and then copy/paste or any other method you know...)
//                                class:             0-civil, 1-military, ... (add more as you wish)
//
//!!!EVERY building must have only ONE entry here AND been in ONE class!!!
//-------------------------------------------------------------------------------------
Buildingstoloot_list = [

// Civilian buildings
//["Land_Church_01_V1_F", 0],				//has no building positions
//["Land_HouseV2_04_interier", 0],			//has no building positions
//["Land_HouseV_2L", 0],					//has no building positions
//["Land_Panelak2", 0],						//has no building positions
//["Land_Shed_W01", 0],						//has no building positions
//["Land_A_Office02", 0],					//has no building positions	
//["CUP_A1_Panelak2", 0],					//has no building positions	
//["CUP_A1_Panelak3", 0],					//has no building positions	
//["CUP_A2_office02", 0],					//has no building positions	
//["CUP_A2_office02_dam", 0],				//has no building positions	
//["CUP_A1_Panelak", 0],					//has no building positions		
["CUP_A2_houseb_tenement", 0],					
["Land_Offices_01_V1_F", 0],
["Land_i_House_Small_01_V1_F", 0],
["Land_i_House_Small_01_V1_dam_F", 0],
["Land_i_House_Small_01_V2_F", 0],
["Land_i_House_Small_01_V2_dam_F", 0],
["Land_i_House_Small_01_V3_F", 0],
["Land_i_House_Small_01_V3_dam_F", 0],
["Land_u_House_Small_01_V1_F", 0],
["Land_u_House_Small_01_V1_dam_F", 0],
["Land_i_House_Small_02_V1_F", 0],
["Land_i_House_Small_02_V2_F", 0],
["Land_i_House_Small_02_V3_F", 0],
["Land_u_House_Small_02_V1_F", 0],
["Land_i_House_Small_03_V1_F", 0],
["Land_i_House_Small_03_V1_dam_F", 0],
["Land_i_House_Big_01_V1_F", 0],
["Land_i_House_Big_01_V1_dam_F", 0],
["Land_i_House_Big_01_V2_F", 0],
["Land_i_House_Big_01_V2_dam_F", 0],
["Land_i_House_Big_01_V3_F", 0],
["Land_i_House_Big_01_V3_dam_F", 0],
["Land_u_House_Big_01_V1_F", 0],
["Land_u_House_Big_01_V1_dam_F", 0],
["Land_d_House_Big_01_V1_F", 0],
["Land_u_House_Big_02_V1_F", 0],
["Land_i_Stone_HouseBig_V1_F", 0],
["Land_i_Stone_HouseBig_V1_dam_F", 0],
["Land_i_Stone_HouseBig_V2_F", 0],
["Land_i_Stone_HouseBig_V2_dam_F", 0],
["Land_i_Stone_HouseBig_V3_F", 0],
["Land_i_Stone_HouseBig_V3_dam_F", 0],
["Land_d_Stone_HouseBig_V1_F", 0],
["Land_i_Stone_HouseSmall_V1_F", 0],
["Land_i_Stone_HouseSmall_V1_dam_F", 0],
["Land_i_Stone_HouseSmall_V2_F", 0],
["Land_i_Stone_HouseSmall_V2_dam_F", 0],
["Land_i_Stone_HouseSmall_V3_F", 0],
["Land_i_Stone_HouseSmall_V3_dam_F", 0],
["Land_d_Stone_HouseSmall_V1_F", 0],
// 	Chernarus Buildings
["Land_Farm_Cowshed_a", 0],
["Land_Farm_Cowshed_b", 0],
["Land_Farm_Cowshed_c", 0],
["Land_HouseBlock_A1", 0],
["Land_HouseB_Tenement", 0],
["Land_HouseV2_01A", 0],
["Land_HouseV2_02_Interier", 0],
["Land_HouseV_1I1", 0],
["Land_HouseV_1I4", 0],
["Land_HouseV_1L1", 0],
["Land_HouseV_1L2", 0],
["Land_kulna", 0],
["Land_Panelak", 0],
["Land_Rail_House_01", 0],
["Land_rail_station_big", 0],
["Land_Misc_Cargo1Ao", 0],
["Land_Misc_Cargo1Bo", 0],
["Land_Nav_Boathouse", 0],
["Land_Airport_left_F", 0],
["Land_Airport_right_F", 0],
["Land_A_Office01", 0],
["Land_i_House_Big_02_V1_F", 0],
["Land_i_Stone_HouseBig_V1_dam_F", 0],
["Land_d_House_Big_01_V1_F", 0],
["Land_i_Stone_HouseBig_V3_dam_F", 0],
["Land_i_House_Small_02_V3_dam_F", 0],
// Isla Abramia Buildings
["Land_House_C_4_EP1", 0],
["Land_Hotel", 0],
["Land_House_C_5_EP1", 0],
["Land_Sara_Domek_sedy", 0],
["Land_Hotel_riviera2", 0],
["Land_Hotel_riviera1", 0],
["Land_Deutshe_mini", 0],
["Land_HouseV2_04", 0],
["Land_Sara_domek_zluty", 0],
["Land_House_C_5_V3_EP1", 0],
["Land_HouseBlock_A1_1", 0],
["Land_HouseBlock_A3", 0],
["Land_HouseV2_03", 0],
["Land_Hruzdum", 0],
["Land_HouseV2_01B", 0],
["Land_Dum_istan3_hromada2", 0],
["Land_Dum_mesto2", 0],
["Land_HouseV2_05", 0],
["Land_HouseV_1I4", 0],
["Land_Dum_rasovna", 0],
["Land_Sara_domek_vilka", 0],
["Land_HouseV2_03B", 0],
["Land_Dum_mesto3", 0],
["Land_Sara_hasic_zbroj", 0],
["Land_Dum_mesto2l", 0],
["Land_House_C_11_EP1", 0],
["Land_Dum_istan3_pumpa", 0],
["Land_House_C_5_dam_EP1", 0],
["Land_A_Villa_EP1", 0],
["Land_ZalChata",0],
["Land_Ryb_domek", 0],
["Land_Sara_domek03", 0],
["Land_Sara_domek05", 0],
["Land_i_House_Big_02_V3_F", 0],
["Land_u_House_Small_02_V1_dam_F", 0],
["Land_i_House_Big_02_V2_F", 0],
["Land_Slum_House02_F", 0],
["Land_Slum_House03_F", 0],
["Land_Slum_House03_F", 0],
["Land_Vysilac_budova", 0],
// Military buildings
//["Land_TentHangar_V1_F", 1],			//has no building positions
//["Land_Bunker_F", 1],					//has no building positions
//["Land_HBarrierTower_F", 1],			//has no building positions
//["Land_BagBunker_Small_F", 1],		//has no building positions
//["Land_BagBunker_Tower_F", 1],		//has no building positions
//["C130J_wreck_EP1", 1],				//has no building positions
["Land_Airport_01_controlTower_F", 1],
["Land_GuardHouse_01_F", 1],
["Land_Cargo_Patrol_V1_F", 1],
["Land_Cargo_Patrol_V2_F", 1],
["Land_Cargo_Patrol_V3_F", 1],
["Land_i_Barracks_V1_F", 1],
["Land_i_Barracks_V1_dam_F", 1],
["Land_i_Barracks_V2_F", 1],
["Land_i_Barracks_V2_dam_F", 1],
["Land_u_Barracks_V2_F", 1],
["Land_Cargo_House_V1_F", 1],
["Land_Cargo_House_V2_F", 1],
["Land_Cargo_House_V3_F", 1],
["Land_Cargo_HQ_V1_F", 1],
["Land_Cargo_HQ_V2_F", 1],
["Land_Cargo_HQ_V3_F", 1],
["Land_BagBunker_Large_F", 1],
["Land_Cargo_Tower_V1_F", 1],
["Land_Cargo_Tower_V1_No1_F", 1],
["Land_Cargo_Tower_V1_No2_F", 1],
["Land_Cargo_Tower_V1_No3_F", 1],
["Land_Cargo_Tower_V1_No4_F", 1],
["Land_Cargo_Tower_V1_No5_F", 1],
["Land_Cargo_Tower_V1_No6_F", 1],
["Land_Cargo_Tower_V1_No7_F", 1],
["Land_Cargo_Tower_V2_F", 1],
["Land_Cargo_Tower_V3_F", 1],
["Land_MilOffices_V1_F", 1],
["Land_Radar_F", 1],
["Land_Hangar_F", 1],
// 	Chernarus Buildings
["Land_a_stationhouse", 1],
["Land_A_TVTower_Base", 1],
["Land_Hlidac_budka", 1],
["Land_Mil_Barracks_i", 1],
["Land_Mil_ControlTower", 1],
["Land_Misc_deerstand", 1],
["Land_Ind_IlluminantTower", 1],
["Land_vez", 1],
["Land_i_Barracks_V1_F", 1],
["Land_i_Barracks_V2_F", 1],
["Land_Cargo_Tower_V1_F", 1],
["Land_Airport_Tower_F", 1],
["Land_Mil_Barracks_i_EP1", 1],
["Land_Cargo_HQ_V1_F", 1],
["Land_SS_hangar", 1],
// Isla Abramia Buildings
["Land_Mil_ControlTower_dam", 1],
["Land_Mil_ControlTower_EP1",1],
["Land_Mil_Barracks_EP1",1],
["Land_Mil_Repair_center_EP1",1],
["Land_Hlidac_Budka_EP1",1],
["Land_A_Stationhouse_ep1",1],
["Land_House_K_7_dam_EP1",1],
["Land_Ammostore2",1],
["Land_Bouda2_vnitrek",1],
["Land_Garaz_bez_tanku",1], 
["Land_Army_hut_int",1],
["Land_Army_hut2_int",1],
["Land_Budova4_in",1],
["Land_Barrack2_EP1",1],
["Land_fortified_nest_big_EP1",1],
["Land_Vysilac_budova",1],
["Land_Helfenburk_cimburi",1],
// 2 Industrial and Outbuildings
//["Land_Shed_Big_F", 2],				//has no building positions
//["Land_Shed_Small_F", 2],				//has no building positions
//["Land_ReservoirTower_F", 2],			//has no building positions
//["Land_dp_smallFactory_F", 2],		//has no building positions
//["Land_dp_smallTank_F", 2],			//has no building positions
//["Land_IndPipe2_bigBuild2_L", 2],		//has no building positions
//["Land_IndPipe2_big_18", 2],			//has no building positions
//["Land_IndPipe2_big_9", 2],			//has no building positions
//["Land_IndPipe2_big_ground2", 2],		//has no building positions
["Land_WIP_F", 2],
["Land_dp_bigTank_F", 2],
["Land_Factory_Main_F", 2],
["Land_spp_Tower_F", 2],
["Land_i_Shed_Ind_F", 2],
["Land_u_Shed_Ind_F", 2],
["Land_u_Addon_01_V1_F", 2],
["Land_d_Addon_02_V1_F", 2],
["Land_u_Addon_02_V1_F", 2],
["Land_i_Addon_02_V1_F", 2],
["Land_i_Addon_03_V1_F", 2],
["Land_i_Addon_03mid_V1_F", 2],
["Land_i_Addon_04_V1_F", 2],
["Land_Metal_Shed_F", 2],
["Land_Unfinished_Building_01_F", 2],
["Land_Unfinished_Building_02_F", 2],
// 	Chernarus Buildings
["Land_A_BuildingWIP", 2],
["Land_Barn_Metal", 2],
["Land_Ind_Expedice_1", 2],
["Land_Ind_Expedice_3", 2],
["Land_Ind_Garage01", 2],
["Land_Ind_Mlyn_01", 2],
["Land_Ind_Pec_01", 2],
["Land_Ind_Vysypka", 2],
["Land_Ind_Workshop01_01", 2],
["Land_Ind_Workshop01_02", 2],
["Land_Ind_Workshop01_04", 2],
["Land_Ind_Workshop01_L", 2],
["Land_Shed_Ind02", 2],
["Land_Tovarna2", 2],
["Land_Hangar_2", 2],
// Isla Abramia Buildings
["Land_Com_tower_ep1", 2],
["Land_Ind_Workshop01_03", 2],
["Land_Ind_FuelStation_Shed_EP1", 2],
["Land_stodola_old_open", 2],
["Land_Ind_Garage01_EP1", 2],
["Land_Stodola_open", 2],
["Land_A_Crane_02a", 2],
["Land_A_Crane_02b", 2],
["Land_Barn_W_01", 2],
["Land_Barn_W_02", 2],
["Land_Hut_old02", 2],
["Land_Misc_Cargo1Bo", 2],
["Land_Misc_Cargo1Ao", 2],
["Land_dp_mainFactory_F", 2],
["Land_dp_bigTank_F", 2],
// 3 Research Buildings
//["Land_Dome_Big_F", 3],			    //has no building positions
//["Land_Dome_Small_F", 3],			    //has no building positions
["Land_Research_house_V1_F", 3],
["Land_Research_HQ_F", 3],
// 	Chernarus Buildings
// Isla Abramia Buildings
// 4 Medical Buildings
//["Land_A_Hospital", 4],				//has no building positions
["Land_Hospital_main_F", 4],
["Land_Hospital_side1_F", 4],
["Land_Hospital_side2_F", 4],
["Land_Medevac_house_V1_F", 4],
["Land_Medevac_HQ_V1_F", 4],
// 	Chernarus Buildings			
["Camp", 4],
["CampEast", 4],
["CampEast_EP1", 4],
// Isla Abramia Buildings
// 5 Shops and Public Buildings
//["Land_Kiosk_blueking_F", 5],			//has no building positions
//["Land_Kiosk_gyros_F", 5],			//has no building positions
//["Land_Kiosk_papers_F", 5],			//has no building positions
//["Land_Kiosk_redburger_F", 5],		//has no building positions
//["Land_Airport_center_F", 5],			//has no building positions
//["Land_LandMark_F", 5],				//has no building positions
//["Land_GH_MainBuilding_entry_F", 5],	//has no building positions
//["Land_GH_Platform_F", 5],			//has no building positions
//["Land_GH_Pool_F", 5],				//has no building positions
//["Land_GH_Stairs_F", 5],				//has no building positions
//["Land_Stadium_p1_F", 5],				//has no building positions
//["Land_Stadium_p2_F", 5],				//has no building positions
//["Land_Stadium_p3_F", 5],				//has no building positions
//["Land_Stadium_p6_F", 5],				//has no building positions
//["Land_Stadium_p7_F", 5],				//has no building positions
//["Land_Stadium_p8_F", 5],				//has no building positions
//["Land_Stadium_score_F", 5],			//has no building positions
["Land_i_Shop_01_V1_F", 5],
["Land_i_Shop_01_V2_F", 5],
["Land_i_Shop_01_V3_F", 5],
["Land_u_Shop_01_V1_F", 5],
["Land_d_Shop_01_V1_F", 5],
["Land_i_Shop_02_V1_F", 5],
["Land_i_Shop_02_V2_F", 5],
["Land_i_Shop_02_V3_F", 5],
["Land_u_Shop_02_V1_F", 5],
["Land_d_Shop_02_V1_F", 5],
["Land_Airport_left_F", 5],
["Land_Airport_right_F", 5],
["Land_Airport_Tower_F", 5],
["Land_GH_Gazebo_F", 5],
["Land_GH_House_1_F", 5],
["Land_GH_House_2_F", 5],
["Land_GH_MainBuilding_left_F", 5],
["Land_GH_MainBuilding_middle_F", 5],
["Land_GH_MainBuilding_right_F", 5],
["Land_Stadium_p4_F", 5],
["Land_Stadium_p5_F", 5],
["Land_Stadium_p9_F", 5],
["Land_Chapel_V1_F", 5],
["Land_Chapel_V2_F", 5],
["Land_Chapel_Small_V1_F", 5],
["Land_Chapel_Small_V2_F", 5],
["Land_i_Stone_Shed_V1_F", 5],
["Land_i_Stone_Shed_V2_F", 5],
["Land_i_Stone_Shed_V3_F", 5],
["Land_d_Stone_Shed_V1_F", 5],
// 	Chernarus Buildings
["Land_A_FuelStation_Build", 5],
["Land_A_GeneralStore_01", 5],
["Land_A_GeneralStore_01a", 5],
["Land_A_Pub_01", 5],
// Isla Abramia Buildings
["Land_Afbarabizna", 5],
["Land_Ind_FuelStation_Build_EP1", 5],
["Land_Cihlovej_Dum_in", 5],
["Land_House_C_5_V1_EP1", 5],
["Land_House_C_5_V2_EP1", 5],
["Land_Church_03", 5],
["Land_d_Windmill01_F", 5],
["Land_i_Stone_Shed_V1_dam_F", 5],
["Land_Vysilac_budova", 5],
// 6 Garages-CarService
["Land_CarService_F", 6],
["Land_i_Garage_V1_F", 6],
["Land_i_Garage_V2_F", 6]
// 	Chernarus Buildings
// Isla Abramia Buildings

];

opps forgot the spoiler

 

Link to comment
Share on other sites

Since we are sharing, here's mine for Chernarus and all it's flavours (vanilla, OCP, DS Houses, Plus and Redux):

Spoiler

//	Lootspawner junction list for buildings to classes
//	Author: Na_Palm (BIS forums)
//-------------------------------------------------------------------------------------
//"Buildingstoloot_list" array of [buildingname, class]
//								buildingname: 	building class name (in editor debug console use "typeof BIS_fnc_camera_target"
//												to monitor and then copy/paste or any other method you know...)
//								class: 			0-civil, 0-military, ... (add more as you wish)
//
//!!!EVERY building must have only ONE entry here AND been in ONE class!!!
//-------------------------------------------------------------------------------------
Buildingstoloot_list = [
//industrial
["Land_stan_east", 1],
["CampEast_EP1", 1],
["Land_tent_east", 1],
["MASH_EP1", 4],
["Land_mash", 4],
["Land_Cargo_Patrol_V1_F", 1],
["Land_NavigLight", 5],
["Land_Barrack2", 1],
["Land_Runway_PAPI", 2],
["Land_Runway_PAPI_2", 7],
["Land_Vez", 1],
["Land_Mil_Barracks_i", 1],
["Land_Shed_W03", 0],
["Land_PowLines_WoodL", 0],
["Land_Mil_Barracks_L", 1],
["Land_Psi_bouda", 0],
["Land_Ind_Workshop01_03", 7],
["Land_Ind_Workshop01_L", 2],
["Land_Mil_Barracks", 1],
["Land_Offices_01_V1_F", 1],
["Land_Ind_Workshop01_01", 2],
["Land_Hlidac_budka", 1],
["Land_Ss_hangar", 3],
["Land_HouseV_2I", 0],
["Land_Shed_M03", 0],
["Land_Mil_ControlTower", 3],
["Land_Mil_House", 1],
["Land_Helfenburk", 1],
["Land_a_stationhouse", 1],
["Land_Stodola_old_open", 2],
["Land_Hut06", 0],
["Land_Ind_Garage01", 5],
["Land_Repair_center", 5],
["Land_Misc_Cargo1D", 2],
["Land_Misc_Cargo1B", 2],
["Land_Shed_Ind02", 2],
["Land_Ind_Workshop01_04", 2],
["Land_Shed_W01", 0],
["Land_Misc_WaterStation", 7],
["Land_Barn_W_01", 0],
["Land_Misc_deerstand", 1],
["Land_Shed_W4", 0],
["Land_Ind_Workshop01_02", 1],
["Land_KBud", 7],
["Land_HouseV2_03", 0],
["Land_houseV_2T2", 0],
["Land_HouseV_1L1", 0],
["Land_Komin", 7],
["Land_HouseV_1I4", 0],
["Land_A_FuelStation_Build", 7],
["Land_HouseV2_01A", 0],
["Land_HouseV_2L", 0],
["Land_HouseV_3I4", 0],
["Land_HouseV2_01B", 0],
["Land_Barn_W_02", 0],
["Land_HouseV_1T", 7],
["Land_HouseV_1I2", 0],
["Land_houseV_2T1", 0],
["Land_HouseV2_05", 0],
["Land_Farm_Cowshed_a", 0],
["Land_Church_01", 7],
["Land_HouseV_1I1", 7],
["Land_Misc_Cargo1Bo", 5],
["Land_HouseV_3I3", 0],
["Land_Farm_Cowshed_b", 0],
["Land_Farm_Cowshed_c", 0],
["Land_HouseV_1L2", 0],
["Land_HouseV_3I2", 7],
["Land_Farm_WTower", 1],
["Land_Nasypka", 5],
["Land_HouseV2_02_Interier", 7],
["Land_HouseV_1I3", 7],
["Land_Mil_Guardhouse", 1],
["Land_HouseV_3I1", 0],
["Land_HouseV2_04_interier", 0],
["Land_HouseBlock_A3", 7],
["Land_HouseV2_03B", 0],
["Land_A_GeneralStore_01a", 7],
["Land_Kulna", 7],
["Land_A_Office01", 1],
["Land_HouseBlock_A1_1", 0],
["Land_HouseBlock_C4", 0],
["Land_Hangar_2", 2],
["Land_A_statue01", 7],
["Land_A_FuelStation_Shed", 5],
["Land_Church_02", 7],
["Land_Barn_Metal", 0],
["Land_Church_02a", 7],
["Land_Misc_Cargo1C", 5],
["Land_Ind_TankBig", 2],
["Land_ruin_01", 7],
["Land_Church_03", 7],
["Land_Stodola_open", 2],
["Land_A_Castle_Gate", 1],
["Land_A_Castle_Donjon", 1],
["Land_A_Castle_Wall2_30", 1],
["Land_A_Castle_Stairs_A", 1],
["Land_A_Castle_Bergfrit", 1],
["Land_Sara_domek_zluty", 0],
["Land_A_TVTower_Base", 1],
["Land_Misc_PowerStation", 2],
["Land_Ind_SawMill", 2],
["Land_Sara_hasic_zbroj", 5],
["Land_HouseBlock_C5", 0],
["Land_Church_05R", 7],
["Land_Misc_Cargo1Ao", 5],
["Land_Lampa_ind_zebr", 4],
["Land_Misc_Scaffolding", 2],
["Land_A_BuildingWIP", 5],
["Land_rails_bridge_40", 7],
["Land_HouseBlock_B6", 0],
["Land_HouseBlock_B4", 0],
["Land_HouseBlock_B3", 0],
["Land_Shed_wooden", 0],
["Land_HouseBlock_B5", 0],
["Land_Panelak", 0],
["Land_A_Office02", 0],
["Land_Ind_Pec_02", 2],
["Land_A_Hospital", 4],
["Land_Panelak2", 0],
["Land_Ind_Expedice_3", 2],
["Land_HouseBlock_A1_2", 0],
["Land_Ind_Expedice_1", 2],
["Land_Ind_Pec_03b", 1],
["Land_Rail_House_01", 7],
["Land_A_statue02", 7],
["Land_ind_silomale", 2],
["Land_Ind_Mlyn_01", 2],
["Land_A_Pub_01", 7],
["Land_Vez_Silo", 2],
["Land_Ind_SiloVelke_02", 2],
["Land_Ind_Pec_01", 2],
["Land_Ind_Vysypka", 2],
["Land_Ind_SiloVelke_01", 2],
["Land_Tovarna2", 2],
["Land_Ind_Pec_03a", 2],
["Land_rail_station_big", 7],
["Land_A_GeneralStore_01", 7],
["Land_A_MunicipalOffice", 7],
["Land_A_MunicipalOffice2", 7],
["Land_HouseB_Tenement", 0],
["Land_HouseBlock_A1", 0],
["Land_wagon_box", 0],
["Land_NAV_Lighthouse2", 0],
["Land_LightHouse_F", 0],
["Land_Lighthouse_small_F", 0],
["Land_TentHangar_V1_F", 3],
["Land_Hangar_F", 3],
["Land_Ss_hangar", 3],
["Land_d_HouseV_3I4", 0],
["Land_d_HouseV_1L2", 0],
["Land_d_HouseV_1t", 0],
["Land_d_HouseV_2I", 0],
["Land_d_HouseV_2t2", 0],
["Land_d_HouseV_2t1", 0],
["Land_d_HouseV_2L", 0],
["Land_d_HouseV_3I1", 0],
["Land_d_HouseV_3I2", 0],
["Land_d_HouseV_3I3", 0],
["Land_d_dom01", 0],
["Land_d_dom02", 4],
["Land_Nav_Boathouse", 0],
["Land_WIP_F", 5],
["Land_Cargo_House_V1_F", 1],
["Land_Cargo_HQ_V1_F", 1],
["Land_Cargo_Tower_V1_No3_F", 1],
["Land_Cargo_Tower_V2_F", 1],
["Land_PillboxBunker_01_big_F", 1],
["Land_Cargo_Tower_V1_No6_F", 1],
["Land_Cargo_Tower_V1_No1_F", 1],
["Land_Cargo_Tower_V1_No4_F", 1],
["Land_i_Barracks_V1_F", 1],
["Land_MilOffices_V1_F", 1],
["Land_A_MunicipalOffice2", 1],
["Land_Misc_StreetBooth_grocery", 7],
["Land_Misc_NewsStand", 7],
["Land_Ikarus_Dayz", 7],
["Land_Tenement_building_Big", 0],
["Land_Tenement_building_small", 0],
["Land_BusStation_building", 7],
["Land_KrasnoAir_Hangars", 3],
["Land_KrasnoAir_Control", 3],
["Land_Health_care_center", 4],
["Land_Police_Station", 1],
["Land_Village_pub", 7],
["Land_Village_store", 7],
["Land_CampHouse_white", 7],
["Land_CampHouse_red", 7],
["Land_CampHouse_brown", 7],
["Land_Abandoned_Ship_FrontB", 2],
["Land_Abandoned_Ship_BackA", 2],
["Land_tent_east", 1],
["Land_Fort_Watchtower", 1],
["Land_posed", 1],
["Land_fortified_nest_big", 1],
["Land_Misc_FeedShack", 0],
["Land_Ind_GarageRow", 5],
["Land_school_building", 4],
["Land_ural_wrecked", 5],
["Land_Volha_DayZ", 5],
["Land_Volha_grey_DayZ", 5],
["Land_Lada_red_DayZ", 5],
["Land_Skodovka_wrecked", 5],
["Land_s1203_baige_DayZ", 5],
["Land_Prison_MainCastle_EXT", 1],
["Land_Prison_SideBuilding_EXT", 1],
["Land_Airport_Tower_F", 3],
// Redux Positions
["Land_chz_vesnice_dum12", 0],
["Land_HouseV2_04_interier_dam", 0],
["Land_chz_tabor_budova_3", 0],
["Land_HouseBlock_B1", 7],
["Land_chz_pristav2", 0],
["Land_chz_train_vagon_01_open_br1", 7],
["Land_chz_train_vagon_suburban_01", 7],
["Land_chz_train_vagon_suburban_02", 7],
["Land_chz_janov_boudicka", 2]
];

 

I use the following building types:

[0, 8, 15, 20, 15, -1],	// civil
[1, 15, 25, 25, 20, -1],	// military
[2, 10, 18, 25, 20, -1],	// industrial
[3, 15, 25, 30, -1, -1],	// research
[4, 0, 0, 25, -1, -1],	// hospital
[5, 10, 18, 25, -1, -1],	// construction
[6, 12, 18, 20, -1, -1],	// airport
[7, 10, 15, 25, -1, -1]		// commercial

 

Link to comment
Share on other sites

And for those wondering why we like lootspawner so much, a lot of it is about tailoring loot for the type of building, something that is problematic with vanilla Epoch loot containers. For example, on my Origins server (just a name, it's an Epoch server not using the Origins mod), these are the building types (note that on this server I reversed the checking of types of loot so that the magazines category's percentage is first to reduce further the number of weapons spawned):

spawnClassChance_list = [
[0, 15, 3, 15, 10, 5, -1],			// Residential (village)
[1, 15, 3, 15, 10, 5, -1],		// Residential (urban)
[2, 15, 5, 10, 5, 5, -1],		// Hi-Value Military
[3, 15, 5, 10, 5, 5, -1],		// Lo-Value Military
[4, 15, 3, 10, 5, 5, -1],			// Light Industrial
[5, 15, 3, 10, 5, 5, -1],		// Heavy Industrial
[6, 15, 3, 10, 5, 5, -1],		// Commercial
[7, 25, 3, 40, 10, 5, -1],		// Medical
[8, 10, 3, 20, 5, 5, -1],		// Vehicle Repair
[9, 15, 5, 15, 10, 5, -1],		// Hanger
[10, 15, 3, 15, 10, 5, -1],		// Tourism
[11, 15, 5, 15, 10, 5, -1],		// Hunting
[12, 15, 5, 15, 10, 5, -1],		// Farming
[13, 15, 3, 15, 10, 5, -1],		// Construction
[14, 15, 3, 15, 10, 5, -1],		// Fire Station
[15, 15, 5, 15, 10, 5, -1],		// Police Station
[16, 15, 3, 15, 10, 5, -1],		// Maritime
[17, 15, 5, 15, 10, 5, -1]		// Airport
];

So, get with the program and deploy it today :wink:

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



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