Jump to content

[Release] Lootspawner, configurable building loot system


Suppe

Recommended Posts

here.... there are cherno and mas settings in it..... but the shotlist is very very very bad sorted in this example..... clean the shotlist and dont use the highlootstuff and u are ready :D

 

have fun.... :D

Link to comment
Share on other sites

Thanks Wesely and suppe but why not using Highloot.sqf btw?

 

u can control the lootspawn and the lootchance better without it.... there is no need for it.... if u want super rare items just choose in the building lst some "research" builings and make the % in the lootspawner high or down, a easy way to control the spawn....

 

info, i updated teh lootspawner and added a lot of examples in it.... please download again :D

Link to comment
Share on other sites

lootworldobjekts are very not importend... there are normaly something like this in it: "Land_Basket_F", "Land_CanisterPlastic_F", "Land_CanisterFuel_F" so, no need for it...

Chears man thanks just for the recored Cherno + @ mas those wich i will need for my server right since i use cherno and mas

and then pasting it to epochhive/addons and it will vebe activated right?

Sorry i am new to Arma 3 :D

Link to comment
Share on other sites

Suppe, ich bekomm diesen Fehler, und der Lootspawner funzt so auch nicht :

 

 

20:01:28 Error in expression <ot_addon\LSpawner\Lootspawner.sqf"
 
 
 
 
 
getListBuildingnames = {
{
spawnBuilding>
20:01:28   Error position: <getListBuildingnames = {
{
spawnBuilding>
20:01:28   Error Missing ]
20:01:28 File loot_addon\LSpawner\Lootspawner.sqf, line 63
 
In der sqf schaut es so aus: 
 
//-------------------------------------------------------------------------------------
//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;
};

Wasn da los?

 

Link to comment
Share on other sites

UPDATE:

 

-small change in the init

-added cherno buildinglist

-added @MAS example

-added a lot of examples

 

those changes in the init.. what do they do? do u recommend to install it?

so far my lootspawner is running very well on tavi and dont want to break anything, especially not the loot and buildinglist.

answer in german if thats easier for u =D

Link to comment
Share on other sites

Add these to your buildings list for Bornholm.  These are the enterable A2 buildings with correct Bornholm classnames.

 

//Arma 2 Bornholm
["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],

Link to comment
Share on other sites

What would you add to the loot file to have more building loot appear at the building sites and the such?

sorry, what ?

 

you mean:

 

1.1      'Lootspawner.sqf' to change the available variables as needed  (ex. spawninterval, chance of loot, categories of loot...)

 

???

 

in the lootspawner.sqf is only importend:

 

//"spawnClassChance_list" array of [class, %weapon, %magazine, %ICV, %backpack, %object]

//                                    class       : same classname as used in "Buildingstoloot_list"

//                                    %weapon     : % chance to spawn a weapon on spot

//                                    %magazine     : % chance to spawn magazines 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, 4, 6, 25, 9, 7],        // civil

[1, -1, -1, 20, 9, 7],        // military

[2, 4, 6, 15, 9, 7],        // industrial

[3, -1, -1, -1, -1, -1]        // research

];

Link to comment
Share on other sites

I normally like to fix my own bugs but am stuck with this one.

 

if anyone could lend a hand it would be appreciated thanks.

 

.rpt

18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
18:02:10   Error position: <_loot} count exclcontainer_list) > 0) th>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 146
18:02:10 Error in expression <cteditem);
_lootholder = createVehicle [_loot, _tmpPos, [], 0, "CAN_COLLIDE"];
i>
18:02:10   Error position: <_loot, _tmpPos, [], 0, "CAN_COLLIDE"];
i>
18:02:10   Error Undefined variable in expression: _loot
18:02:10 File loot_addon\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 121
18:02:10 Warning Message: No entry 'bin\config.bin/CfgMagazines.arifle_Katiba_C_F'.
18:02:10 Warning Message: No entry '.picture'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.scope'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: Error: creating magazine arifle_Katiba_C_F with scope=private
18:02:10 Warning Message: No entry '.displayName'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.displayNameShort'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.nameSound'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.Library'.
18:02:10 Warning Message: No entry '.libTextDesc'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.type'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.count'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.maxLeadSpeed'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.initSpeed'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.reloadAction'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.modelSpecial'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.ammo'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry 'bin\config.bin/CfgMagazines.arifle_MX_GL_F'.
18:02:10 Warning Message: No entry '.picture'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.scope'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: Error: creating magazine arifle_MX_GL_F with scope=private
18:02:10 Warning Message: No entry '.displayName'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.displayNameShort'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.nameSound'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.Library'.
18:02:10 Warning Message: No entry '.libTextDesc'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.type'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.count'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.maxLeadSpeed'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.initSpeed'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.reloadAction'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.modelSpecial'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.ammo'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry 'bin\config.bin/CfgMagazines.SMG_02_F'.
18:02:10 Warning Message: No entry '.picture'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.scope'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: Error: creating magazine SMG_02_F with scope=private
18:02:10 Warning Message: No entry '.displayName'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.displayNameShort'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.nameSound'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.Library'.
18:02:10 Warning Message: No entry '.libTextDesc'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.type'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.count'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.maxLeadSpeed'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.initSpeed'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.reloadAction'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.modelSpecial'.
18:02:10 Warning Message: '/' is not a value
18:02:10 Warning Message: No entry '.ammo'.
18:02:10 Warning Message: '/' is not a value
18:02:12 Error in expression <d", "repairkit", true];
}; 

 

and the fn_LSgetBuildingstospawnLoot.sqf

 

//	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","_buildPosViable_list","_buildPosZadj_list","_lBuildVar","_posviablecount","_spwnPos","_lootspawned","_randChance","_lootholder","_selecteditem","_loot","_chfullf","_idx_sBlist","_chperSpot","_tmpPos"];

//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;
	_buildPosViable_list = [];
	_buildPosZadj_list = [];
	_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
					_buildPosViable_list set [count _buildPosViable_list, ((Buildingpositions_list select _forEachIndex) select 1)];
					if (swSpZadjust) then {
						//get position adjustments
						_buildPosZadj_list set [count _buildPosZadj_list, ((Buildingpositions_list select _forEachIndex) select 2)];
					};
				};
				sleep 0.001;
			}forEach Buildingstoloot_list;
			//diag_log format["-- LOOTSPAWNER DEBUG BaP: v%1v%2v :: v%3v :: v%4v --", _BaPname, _lootClass, _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 {
						_spwnPos = (_x buildingPos _poscount);
						_tmpPos = [(_spwnPos select 0), (_spwnPos select 1), 60000];
						if ((_spwnPos select 0) == 0 && (_spwnPos select 1) == 0) then {
							_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 5 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: spawn 1-6
									if(_lootType == 2) exitWith {
										_lootholder = createVehicle ["GroundWeaponHolder", _tmpPos, [], 0, "CAN_COLLIDE"];
										_randChance = 1 + floor(random(5));
										for "_rm" from 0 to _randChance do {
											_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 {
					/*Also in the error*/    			_lootholder setVariable["mf_item_id", "repairkit", true];
									        };
										//if container clear its cargo
					/*This is line 146*/			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)];
 

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