Jump to content

@MAS weapons Lootspawner script (More weapons!)


BlackPlague_81st

Recommended Posts

Theres a Grenade in the lootspawner, which is named as "Stone" ingame, but looks like a grenade.

Do you know, is it the HandGrenade or the MiniGrenade? Need to remove it, cause people get kicked when throwing it.

Thanks

It's: HandGrenade_Stone

 

I had the same issue with it and a few other items in the spawn list. You can remove them from the loot spawner list, or add them to your BE filters.

Link to comment
Share on other sites

Can I add this as an additional loot spawn script but not have MAS weapons on the server?

 

Or does anyone have success with using a high loot spawn script?

 

I know a few servers that use an A2 type loot spawner and want to implement this on ours...

 

You don't need the @MAS folder. Just copy the files into your pbo, and the necessary lines to your init.sqf, and update the BE filters or loot lists to allow everything to spawn that you want without players getting kicked.

Link to comment
Share on other sites

anyone know whats up with this error and how to fix it?

if (({_x == _loot} count exclcontainer_list) > 0) th>
14:57:16   Error position: <_loot} count exclcontainer_list) > 0) th>
14:57:16   Error Undefined variable in expression: _loot
14:57:16 File mpmissions\__cur_mp.Chernarus\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 155
14:57:16 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
14:57:16   Error position: <_loot} count exclcontainer_list) > 0) th>
14:57:16   Error Undefined variable in expression: _loot
14:57:16 File mpmissions\__cur_mp.Chernarus\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 155
14:57:16 Error in expression <cteditem);
_lootholder = createVehicle [_loot, _tmpPos, [], 0, "CAN_COLLIDE"];
i>
14:57:16   Error position: <_loot, _tmpPos, [], 0, "CAN_COLLIDE"];
i>
14:57:16   Error Undefined variable in expression: _loot
14:57:16 File mpmissions\__cur_mp.Chernarus\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 130
14:57:16 Error in expression <d", "repairkit", true];
};

if (({_x == _loot} count exclcontainer_list) > 0) th>
14:57:16   Error position: <_loot} count exclcontainer_list) > 0) th>
14:57:16   Error Undefined variable in expression: _loot
14:57:16 File mpmissions\__cur_mp.Chernarus\LSpawner\fn_LSgetBuildingstospawnLoot.sqf, line 155
14:57:16 Error in expression <d", "repairkit", true];
};

fn_LSgetBuildingstospawnLoot

//	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 {
											_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)];
 

Link to comment
Share on other sites

You don't need the @MAS folder. Just copy the files into your pbo, and the necessary lines to your init.sqf, and update the BE filters or loot lists to allow everything to spawn that you want without players getting kicked.

 

 

Thanks Vake, 

 

I have tried it but nothing seems to spawn and no reports of an issue in the logs...

 

Anyone have an idea?

Link to comment
Share on other sites

Do the players need the MAS addon installed to use this?

FIXED: No you don't need MAS addon to install LootSpawner 

 

 

As long as the add on isn't called through a command line change and you only spawn epoch weapons, the players don't need anything extra.\

Link to comment
Share on other sites

when I put in the script I could not see any loot as a admin but when I was spectating other normal players they were finding loot every were.as long as your rpt is fine I would keep watching for a bit

 

Normal users are reporting that there is no loot, and don't see anything in the rpt. Have had to remove it as players are complaining - no surprise there!

 

Have to come back to it at a later date and see if its something I have done or if anyone else finds a similar issue and a fix.

Link to comment
Share on other sites

As long as the add on isn't called through a command line change and you only spawn epoch weapons, the players don't need anything extra.

 

Ya that was my bad i didnt think when i was reading what they said i thought they where asking if the server had MAS would players need it to was a Derp on my part lol

Link to comment
Share on other sites

anyone notice loot will not spawn in hospitals (Land_A_Hospital)

 

says no positions all the time and its annoying since i edited list to spawn medi shit in there :/

 

"-- !!LOOTSPAWNER WARNING!! in Buildingstoloot_list: Land_A_Hospital has no building positions --"
"-- !!LOOTSPAWNER WARNING!! in Buildingstoloot_list: Land_A_Hospital_dam has no building positions --"
 
gave both versions on my map too :/
 
also cant get any of these to spawn with it
 
"CinderBlocks",
"MortarBucket",
"ItemScraps",
"ItemCorrugated",
"ItemCorrugatedLg",
"PartPlankPack",
"WoodLog_EPOCH"   
 
seems my coding is wrong or something..i change the buildings in building list to 2 for industrial and add spawns but it dont work..so i just added items to civil and they spawn no problem.
 
dont know wat i am missing tbh
 
[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
 
so set buildings u want to 2 and spawn those items i posted above
 
wont work :/...any help be great thanks
 
so civil and military work fine but industrial and research dont work..thats wierd :/
 
ok figured it out my bad just wierd to understand...
 
still the hospitals not seen on map ill try the big hospital :)
Link to comment
Share on other sites

I need some help here as my head is melting,

 

When a server has l MAS Weapons l listed as one of its mods in the Launcher, is that what we are doing here?

 

and do we need @MAS in the server or Launcher?

 

I'm getting confused with the Armaholics MAS Weapons download and what this is

 

Feels like Deluxe have a complete room painting system with every attachment and this is a paintbrush and pot of paint with the same name. something in my head is saying this is not the same thing??

Link to comment
Share on other sites

@mas folder in your arma 3 (same folder as @epoch @epochhive)

 

add @mas to your launch parameters in server

 

make sure all players who join have it too or they will see people holding invisible guns

 

but there is no mention of making an @mas folder in the server in the original post? the MAS Weapons script is 500-700Mb this is KB's why are they both under @mas is one cut down?

Link to comment
Share on other sites

download it and extract it..then drop that into your server foler where @epoch @epochhive is and add to launch parameters and it will run fine..thats the way to do it...have it running my self

 

Make sure you install @MAS addon to your server, and to your ARMA 3 directory

 

http://www.armaholic...ge.php?id=21912

 

Add @MAS to your launch parameters for your server.

 

 

he tells ya wat to do there

Link to comment
Share on other sites

I really do hate a lack of instructions when these things are made. when I write instructions I give a full breakdown of exactly what you will see and what to do because not everyone knows what to do.

 

the instructions in that 1.5 download basically say this....

 

---------------------------------------------------------------------------
Installation.
---------------------------------------------------------------------------

Put the addon in "mod folder" of your preference and load it trough steam app properties.
In Editor you'll find:

 

If you were building a bed it would be the same as this....

 

"some screws are there, wood needs to be on the floor, sides go somewhere, springs are included put them where you like",

 

I cant be the only one who downloads a new mod and then proceeds to throw coffee at the wall through blind rage of not knowing what people mean? :D

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