Jump to content
  • 0

[SOLVED]Defining New Loot Positions


Darth_Rogue

Question

How would a person go about configuring new loot positions for buildings on a map that doesn't have them already?  Take Bornholm for instance....many of the A2 buildings have no loot positions defined, so nothing spawns in them with the Loot Spawner addon.  I've been thinking that maybe I could take the loot position table from DayZ since that uses A2 building positions and somehow retrofit that to be included in the lootspawner addon somehow but I'm not sure where to get started on it.  I guess the most important question to start with is, where does the lootspawner addon get its loot positions from?  I assumed it was in the map or building configs, but I've torn those apart and can't find jack.  The only loot position data I've found is in the Epoch configs but that's just for their Epoch loot items (fridge, chair, table, etc.).  So I've got some information but I'm not sure what to do with it or if it's even the correct data or where it goes and I need some guidance.  Help?!  

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

That's not what I'm talking about.  I'm talking about buildings that are already on that list but have no loot positions defined.  Like so....

Cannot create non-ai vehicle Land_A_BuildingWIP,
 8:00:53 "-- !!LOOTSPAWNER WARNING!! in Buildingstoloot_list: Land_A_BuildingWIP has no building positions --"
 8:00:53 Cannot create non-ai vehicle Land_A_FuelStation_Build,
 8:00:53 "-- !!LOOTSPAWNER WARNING!! in Buildingstoloot_list: Land_A_FuelStation_Build has no building positions --"
 8:00:53 Cannot create non-ai vehicle Land_A_GeneralStore_01,
 8:00:53 "-- !!LOOTSPAWNER WARNING!! in Buildingstoloot_list: Land_A_GeneralStore_01 has no building positions --"
 8:00:53 Cannot create non-ai vehicle Land_A_GeneralStore_01a,
 8:00:53 "-- !!LOOTSPAWNER WARNING!! in Buildingstoloot_list: Land_A_GeneralStore_01a has no building positions --"
 8:00:53 Cannot create non-ai vehicle Land_A_Hospital,

There has to be a way to include loot positions for these buildings so the lootspawner knows where to spawn loot inside them.  I'm trying to use this:

 

class Land_HouseV_1I4: Residential {
	lootPos[] = {{0.222168,3.90839,-2.73031},{-1.82983,-1.81403,-2.76768}};
	
};
class Land_kulna: Residential {
	lootPos[] = {{0.213379,1.49707,-1.14344}};
	
};
class Land_Ind_Workshop01_01: Industrial {
	lootPos[] = {{1.31201,-2.71387,-1.29234},{-0.819336,0.449219,-1.29946}};
	
};
class Land_Ind_Garage01: Industrial {
	lootPos[] = {{1.73755,2.71973,-1.24332},{-0.880371,-1.9082,-1.23318},{0.607178,3.2373,-1.23157}};
	
};
class Land_Ind_Workshop01_02: Industrial {
	lootPos[] = {{1.47144,-0.825195,-1.42987},{-1.29663,-0.373047,-1.42896}};
	
};
class Land_Ind_Workshop01_04: Industrial {
	lootPos[] = {{-1.62207,-6.37305,-1.52724},{-0.118408,-3.88281,-1.52788},{-1.01611,2.13428,-1.53099}};
	
};
class Land_Ind_Workshop01_L: Industrial {
	lootPos[] = {{3.89063,-4.09888,-1.31299},{1.80273,-1.88599,-1.31412},{-0.928223,4.50635,-1.31364}};
	
};
class Land_Hangar_2: Industrial {
	lootPos[] = {{-13.1816,10.4204,-2.56318},{-0.127441,-2.88794,-2.56318},{0.291992,3.94775,-2.56318},{8.94482,6.87793,-2.56318},{-13.688,-4.67871,-2.56318},{3.4248,-8.1499,-2.56318}};
	
};
class Land_hut06: Residential {
	lootPos[] = {{0.328125,2.26953,-1.57786},{-0.552368,-0.0620117,-1.53837}};
};
class Land_stodola_old_open: Farm {
	lootPos[] = {{2.5437,-10.6599,2.96444},{-0.4021,-10.6228,2.96444},{-2.56641,-10.8538,-0.995487},{4.6665,3.45386,-5.08055},{-2.24414,10.396,-5.08055},{3.08691,9.24976,-5.08055},{-1.12744,10.5359,-0.993513},{-1.27563,10.6184,2.96444},{2.99268,10.7668,2.96444},{4.35425,-10.5923,-5.08055},{-2.47363,-5.49194,-5.08055}};
	
};

....but it's not working so far.

Link to comment
Share on other sites

  • 0

take a look at the code that throws that error.

 

Also you may want to try this out

https://community.bistudio.com/wiki/BIS_fnc_buildingPositions

 

Spawn in a building, call that function and see what it returns.  If it doesn't return anything then your positions aren't defined.

 

Also can you post us your entire definition file? or is that it?  Because I'm pretty sure you need to encapsulate all of your classes inside of a parent class as well as the variable name lootPos is most likely not correct.

 

From this: https://community.bistudio.com/wiki/buildingPos

 

Most likely this means that the AIA pack did not include them.

 

 

Ok after more digging look into the variable: Buildingpositions_list

 

you may be able to tweak the code to manually add values to this array.

Link to comment
Share on other sites

  • 0

The AiA pack is not needed for Bornholm.  My best guess is as you mentioned, that the map creator of Bornholm used a different variable other than lootPos.  

 

This is my buildings list for Bornholm, which includes the typical A3 buildings and also A2 buildings as well.  Some of these are not even present on the Bornholm map and I'm aware of that.  But many of them are, specifically the barns and a handful of industrial and residential buildings.

 

Buildingstoloot_list = [
//Arma 2
["Land_A_BuildingWIP", 2],
["Land_A_FuelStation_Build", 2],
["Land_A_GeneralStore_01", 0],
["Land_A_GeneralStore_01a", 0],
["Land_A_Hospital", 0],
["Land_A_Pub_01", 0],
["Land_a_stationhouse", 1],
["Land_A_TVTower_Base", 1],
["Land_Barn_Metal", 2],
["Land_Barn_W_01", 0],
["Land_Church_03", 0],
["Land_Farm_Cowshed_a", 0],
["Land_Farm_Cowshed_b", 0],
["Land_Farm_Cowshed_c", 0],
["Land_Hangar_2", 2],
["Land_Hlidac_budka", 1],
["Land_HouseBlock_A1", 0],
["Land_HouseB_Tenement", 0],
["Land_HouseV2_01A", 0],
["Land_HouseV2_02_Interier", 0],
["Land_HouseV2_04_interier", 0],
["Land_HouseV_1I1", 0],
["Land_HouseV_1I4", 0],
["Land_HouseV_1L1", 0],
["Land_HouseV_1L2", 0],
["Land_HouseV_2L", 0],
["Land_IndPipe2_bigBuild2_L", 2],
["Land_IndPipe2_big_18", 2],
["Land_IndPipe2_big_9", 2],
["Land_IndPipe2_big_ground2", 2],
["Land_Ind_Expedice_1", 2],
["Land_Ind_Expedice_3", 2],
["Land_Ind_Garage01", 2],
["Land_Ind_IlluminantTower", 1],
["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_kulna", 0],
["Land_Mil_Barracks_i", 1],
["Land_Mil_ControlTower", 1],
["Land_Misc_deerstand", 1],
["Land_Panelak", 0],
["Land_Panelak2", 0],
["Land_Rail_House_01", 0],
["Land_rail_station_big", 0],
["Land_Shed_Ind02", 2],
["Land_Shed_W01", 0],
["Land_SS_hangar", 1],
["Land_stodola_old_open", 0],
["Land_Tovarna2", 2],
["Land_vez", 1],

//Arma 3
["Land_Airport_left_F", 0],
["Land_Airport_right_F", 0],
["Land_Airport_Tower_dam_F", 2],
["Land_Airport_Tower_F", 2],
["Land_cargo_house_slum_F", 0],
["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_Cargo_Patrol_V1_F", 1],
["Land_Cargo_Patrol_V2_F", 1],
["Land_Cargo_Patrol_V3_F", 1],
["Land_Cargo_Tower_V1_F", 1],
["Land_Cargo_Tower_V3_F", 1],
["Land_CarService_F", 2],
["Land_Chapel_Small_V1_F", 0],
["Land_Chapel_Small_V2_F", 0],
["Land_Chapel_V1_F", 0],
["Land_Chapel_V2_F", 0],
["Land_Crane_F", 0],
["Land_dp_bigTank_F", 2], 
["Land_dp_mainFactory_F", 2],
["Land_d_Stone_Shed_V1_F", 0], 
["Land_d_Windmill01_F", 0],
["Land_FuelStation_Build_F", 0], 
["Land_FuelStation_Shed_F", 0], 
["Land_Hangar_F", 2],
["Land_Hospital_main_F", 0],
["Land_Hospital_side1_F", 0],
["Land_Hospital_side2_F", 0],
["Land_i_Addon_02_V1_F", 0],
["Land_i_Addon_03mid_V1_F", 0], 
["Land_i_Addon_03_V1_F", 0], 
["Land_i_Addon_04_V1_F", 0], 
["Land_i_Barracks_V1_F", 2],
["Land_i_Barracks_V2_F", 1],
["Land_i_Garage_V1_F", 0], 
["Land_i_Garage_V2_F", 0],
["Land_i_House_Big_01_V1_dam_F", 0], 
["Land_i_House_Big_01_V1_F", 0], 
["Land_i_House_Big_01_V2_F", 0],
["Land_i_House_Big_01_V3_F", 0],
["Land_i_House_Big_02_V1_dam_F", 0], 
["Land_i_House_Big_02_V1_F", 0], 
["Land_i_House_Big_02_V2_F", 0],
["Land_i_House_Big_02_V3_F", 0],
["Land_i_House_Small_01_V1_dam_F", 0], 
["Land_i_House_Small_01_V1_F", 0], 
["Land_i_House_Small_01_V2_dam_F", 0], 
["Land_i_House_Small_01_V2_F", 0], 
["Land_i_House_Small_01_V3_F", 0],
["Land_i_House_Small_02_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_i_House_Small_03_V1_dam_F", 0], 
["Land_i_House_Small_03_V1_F", 0], 
["Land_i_Shed_Ind_F", 2],
["Land_i_Shop_01_V1_dam_F", 0], 
["Land_i_Shop_01_V1_F", 0], 
["Land_i_Shop_01_V2_F", 0],
["Land_i_Shop_01_V3_F", 0],
["Land_i_Shop_02_V1_dam_F", 0], 
["Land_i_Shop_02_V1_F", 0], 
["Land_i_Shop_02_V2_F", 0],
["Land_i_Shop_02_V3_F", 0],
["Land_i_Stone_HouseBig_V1_dam_F", 0], 
["Land_i_Stone_HouseBig_V1_F", 0], 
["Land_i_Stone_HouseBig_V2_F", 0],
["Land_i_Stone_HouseBig_V3_F", 0],
["Land_i_Stone_HouseSmall_V1_dam_F", 0], 
["Land_i_Stone_HouseSmall_V1_F", 0], 
["Land_i_Stone_HouseSmall_V2_F", 0],
["Land_i_Stone_HouseSmall_V3_F", 0],
["Land_i_Stone_Shed_V1_dam_F", 0], 
["Land_i_Stone_Shed_V1_F", 0], 
["Land_i_Stone_Shed_V2_F", 0],
["Land_i_Stone_Shed_V3_F", 0],
["Land_i_Windmill01_F", 0],
["Land_LightHouse_F", 0], 
["Land_Lighthouse_small_F", 0], 
["Land_Metal_Shed_F", 2], 
["Land_MilOffices_V1_F", 1],
["Land_Offices_01_V1_F", 0],
["Land_Radar_F", 2],
["Land_Research_house_V1_F", 3],
["Land_Research_HQ_F", 3],
["Land_Slum_House01_F", 0],
["Land_Slum_House02_F", 0],
["Land_Slum_House03_F", 0],
["Land_spp_Tower_F", 2],
["Land_Unfinished_Building_01_F", 2], 
["Land_Unfinished_Building_02_F", 2],
["Land_u_Addon_01_V1_F", 0], 
["Land_u_Addon_02_V1_F", 0], 
["Land_u_Barracks_V2_F", 1],
["Land_u_House_Big_01_V1_F", 0],
["Land_u_House_Big_02_V1_F", 0],
["Land_u_House_Small_01_V1_dam_F", 0], 
["Land_u_House_Small_01_V1_F", 0], 
["Land_u_House_Small_02_V1_dam_F", 0], 
["Land_u_House_Small_02_V1_F", 0], 
["Land_u_Shed_Ind_F", 2],
["Land_u_Shop_01_V1_F", 0],
["Land_u_Shop_02_V1_F", 0],
["Land_WIP_F", 2]
];

 

And this is the loot spawner script itself, specifically the portion where it's erroring out.  There's more to it but this is where building positions are called for and (hopefully) found.

 

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;
		_tmpBuild = _buildingname createVehicleLocal _tmpTstPlace;
		//check if the creation was successful
		if (isNil {_tmpBuild}) then {
			diag_log format["--!!ERROR!! LOOTSPAWNER in Buildingstoloot_list: %1 no viable object !!ERROR!!--", _buildingname];
		} else {
			//get spawnpositions from building
			_poscount = 0;
			_posAdjustZlist = [];
			_posIdxlist = [];
			_tmpPoslist = [];
			_endloop = false;
			while {!_endloop} do {
				if((((_tmpBuild buildingPos _poscount) select 0) != 0) && (((_tmpBuild buildingPos _poscount) select 1) != 0)) then {
					//counter loot piling
					_pos = _tmpBuild buildingPos _poscount;
					_posOrg = _pos;
					_posViable = false;
					if (_poscount != 0) then {
						{
							if ((_pos distance _x) > _nearLootdist) exitWith {
								_posViable = true;
							};
						}forEach _tmpPoslist;
					} else {
						_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;
				} else {
					_endloop = true;
				};
			};
			//save final position Index & adjustments to list
			if (_poscount != 0) then {
				//diag_log format["-- LOOTSPAWNER DEBUG add to Buildingpositions_list: v%1v v%2v v%3v added", _buildingname, _posIdxlist, _posAdjustZlist];
				Buildingpositions_list set [count Buildingpositions_list, [_buildingname, _posIdxlist, _posAdjustZlist]];
			} else {
				diag_log format["-- !!LOOTSPAWNER WARNING!! in Buildingstoloot_list: %1 has no building positions --", _buildingname];
				Buildingpositions_list set [count Buildingpositions_list, [_buildingname, [0], [0]]];
			};
		};
		deleteVehicle _tmpBuild;
	}forEach spawnBuilding_list;
};

 

I'll load the map into the editor and try the BIS function you listed and see if that yields any results.  If so then I may be able to add them manually as you suggested.  

Link to comment
Share on other sites

  • 0

Ok I'm ashamed to admit this, but it's my mistake.  I overlooked the fact that on Bornholm the author added a _bo suffix to all relevant building classes.  This is the correct list for Bornholm A2 buildings:

 

 

["Land_bo_A_GeneralStore_01", 0],
["Land_bo_Barn_W_01", 0],
["Land_bo_Barn_W_02", 0],
["Land_bo_Farm_Cowshed_a", 0],
["Land_bo_Farm_Cowshed_b", 0],
["Land_bo_Farm_Cowshed_c", 0],
["Land_bo_Hlidac_budka", 1],
["Land_bo_HouseBlock_A3", 0],
["Land_bo_HouseBlock_A1_1", 0],
["Land_bo_HouseB_Tenement", 0],
["Land_bo_HouseV2_01A", 0],
["Land_bo_HouseV2_02_Interier", 0],
["Land_bo_HouseV_1I1", 0],
["Land_bo_HouseV_1I4", 0],
["Land_bo_HouseV_1L1", 0],
["Land_bo_HouseV_1L2", 0],
["Land_bo_Misc_deerstand", 1],
["Land_bo_Panelak", 0],
["Land_bo_Panelak2", 0],
["Land_bo_Shed_Ind02", 2],
["Land_bo_stodola_old_open", 0],
["Land_bo_stodola_old_open", 0],
["Land_bo_stodola_open", 0],
["Land_bo_Dum_mesto2", 0],
["Land_bo_Sara_domek_sedy", 0],
["Land_bo_Dum_rasovna", 0],

 

All buildings are now spawning loot as they should.  

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
  • Discord

×
×
  • Create New...