Jump to content
na_palm

Lootspawner, configurable building loot system

Recommended Posts

New Update Made a Mess of Your Loot Script, As of yesterday, the loot script I've been using which is the one for single player, has all loot floating above ground and way up in the air. Can You guys Tell me where and what numbers to change to get the loot back to normal ground level? Thanks

Share this post


Link to post
Share on other sites

I have a working solution, but need a little time to verify all.

Will put an updated version online, later in the evening.

Share this post


Link to post
Share on other sites

Ok, time for the fix then...

Fix for flying loot as of ArmA 3 v1.12

LSUpdf112.zip

(replace existing file with this new version)

greetings Na_Palm

Share this post


Link to post
Share on other sites

thanks to Silent_Sniper, for informing me that the first version of the updated files failed.

I reuploaded them now after crosschecking the result. So please download the fix again.

If you want to lower or higher ALL positions generally you can adjust the var "_genZadjust" in Lootspawner.sqf to your further needs.

The download is replacing following files:

- fn_LSgetBuildingstospawnLoot.sqf

- Lootspawner.sqf

- Lootspawner_SP.sqf

greetings Na_Palm

Share this post


Link to post
Share on other sites

hi i wanted to have the loot spawner spawn in maps and other things so i put in the classnames in the code in different sections *ie millitary spawn only* and now it wont spawn anything at all.....

help... all i have done is remove a few weapons and ammo from the CIV locations and added a map, radio and compass. but it wont load... why

// Lootspawner junction lists for classes to spawn-/lootable items

// Author: Na_Palm (BIS forums)

//-------------------------------------------------------------------------------------

//here place Weapons an usable items (ex.: Binocular, ...)

//used with addWeaponCargoGlobal

//"lootWeapon_list" array of [class, [weaponlist]]

// class : 0-civil, 1-military, ... (add more as you wish)

// weaponlist : list of weapon class names

lootWeapon_list = [

[ 0, [ // CIVIL

"Binocular",

"hgun_ACPC2_F",

"hgun_P07_F",

"hgun_PDW2000_F",

"hgun_Rook40_F",

"SMG_02_F", // Sting 9mm

]],[ 1, [ // MILITARY

"arifle_Katiba_C_F",

"arifle_Katiba_F",

"arifle_Katiba_GL_F",

"arifle_Mk20C_F",

"arifle_Mk20_F",

"arifle_Mk20_GL_F",

"arifle_MXC_F",

"arifle_MXM_F",

"arifle_MX_F",

"arifle_MX_GL_F",

"arifle_MX_SW_F",

"arifle_SDAR_F",

"arifle_TRG20_F",

"arifle_TRG21_F",

"arifle_TRG21_GL_F",

"Binocular",

"hgun_ACPC2_snds_F",

"hgun_P07_snds_F",

"hgun_PDW2000_F",

"hgun_Rook40_snds_F",

"LMG_Mk200_F",

"LMG_Zafir_F",

"Rangefinder",

"SMG_01_F", // Vermin .45 ACP

"SMG_02_F", // Sting 9mm

"srifle_EBR_F",

"srifle_GM6_F",

"srifle_LRR_F"

]],[ 2, [ // INDUSTRIAL

"arifle_Katiba_C_F",

"arifle_Mk20C_F",

"arifle_Mk20_F",

"arifle_MXC_F",

"arifle_SDAR_F",

"arifle_TRG20_F",

"arifle_TRG21_F",

"Binocular",

"SMG_01_F", // Vermin .45 ACP

"SMG_02_F" // Sting 9mm

]],[ 3, [ // RESEARCH

"arifle_Katiba_GL_F",

"arifle_MXC_F",

"arifle_MXM_F",

"arifle_MX_GL_F",

"Rangefinder",

"srifle_GM6_F",

"srifle_LRR_F"

]]];

//here place magazines, weaponattachments and bodyitems(ex.: ItemGPS, ItemMap, Medikit, FirstAidKit, Binoculars, ...)

//used with addMagazineCargoGlobal

//"lootMagazine_list" array of [class, [magazinelist]]

// class : 0-civil, 1-military, ... (add more as you wish)

// magazinelist: list of magazine class names

lootMagazine_list = [

[ 0, [ // CIVIL

"ItemMap",

"ItemCompass",

"ItemRadio",

"16Rnd_9x21_Mag",

"30Rnd_9x21_Mag",

"9Rnd_45ACP_Mag",

"Chemlight_blue",

"Chemlight_green",

"Chemlight_red",

"Chemlight_yellow",

"HandGrenade"

]],[ 1, [ // MILITARY

"ItemMap",

"ItemCompass",

"ItemRadio",

"100Rnd_65x39_caseless_mag",

"150Rnd_762x51_Box",

"16Rnd_9x21_Mag",

"1Rnd_HE_Grenade_shell",

"1Rnd_SmokeBlue_Grenade_shell",

"1Rnd_SmokeGreen_Grenade_shell",

"1Rnd_SmokeOrange_Grenade_shell",

"1Rnd_SmokePurple_Grenade_shell",

"1Rnd_SmokeRed_Grenade_shell",

"1Rnd_SmokeYellow_Grenade_shell",

"200Rnd_65x39_cased_Box",

"20Rnd_556x45_UW_mag",

"20Rnd_762x51_Mag",

"30Rnd_45ACP_Mag_SMG_01",

"30Rnd_556x45_Stanag",

"30Rnd_65x39_caseless_green",

"30Rnd_65x39_caseless_mag",

"30Rnd_9x21_Mag",

"3Rnd_HE_Grenade_shell",

"3Rnd_SmokeBlue_Grenade_shell",

"3Rnd_SmokeGreen_Grenade_shell",

"3Rnd_SmokeOrange_Grenade_shell",

"3Rnd_SmokePurple_Grenade_shell",

"3Rnd_SmokeRed_Grenade_shell",

"3Rnd_SmokeYellow_Grenade_shell",

"5Rnd_127x108_Mag",

"7Rnd_408_Mag",

"9Rnd_45ACP_Mag",

"APERSBoundingMine_Range_Mag",

"APERSMine_Range_Mag",

"APERSTripMine_Wire_Mag",

"Chemlight_blue",

"Chemlight_green",

"Chemlight_red",

"Chemlight_yellow",

"ClaymoreDirectionalMine_Remote_Mag",

"HandGrenade",

"MiniGrenade",

"SatchelCharge_Remote_Mag"

]],[ 2, [ // INDUSTRIAL

"ItemMap",

"ItemCompass",

"ItemRadio",

"20Rnd_556x45_UW_mag",

"30Rnd_45ACP_Mag_SMG_01",

"30Rnd_556x45_Stanag",

"30Rnd_65x39_caseless_green",

"30Rnd_65x39_caseless_mag",

"30Rnd_9x21_Mag",

"Chemlight_blue",

"Chemlight_green",

"Chemlight_red",

"Chemlight_yellow"

]],[ 3, [ // RESEARCH

"ItemMap",

"ItemCompass",

"ItemRadio",

"30Rnd_556x45_Stanag",

"30Rnd_556x45_Stanag",

"30Rnd_65x39_caseless_green",

"30Rnd_65x39_caseless_green",

"5Rnd_127x108_Mag",

"7Rnd_408_Mag"

]]];

//here place hats, glasses, clothes, uniforms, vests

//used with addItemCargoGlobal

//"lootItem_list" array of [class, [itemlist]]

// class : 0-civil, 1-military, ... (add more as you wish)

// itemlist : list of item class names

lootItem_list = [

[ 0, [ // CIVIL

"acc_flashlight",

"FirstAidKit",

"H_Bandanna_gry",

"H_Beret_red",

"H_Beret_Colonel",

"H_Beret_02",

"H_Shemag_olive_hs",

"H_Shemag_khk",

"H_Shemag_tan",

"H_Booniehat_dirty",

"H_Cap_blu",

"H_Cap_grn",

"H_Cap_red",

"H_Hat_brown",

"H_Hat_checker",

"H_Hat_grey",

"muzzle_snds_acp", // .45 ACP

"muzzle_snds_L", // 9mm

"optic_Aco",

"optic_ACO_grn",

"optic_aco_smg",

"optic_Holosight",

"optic_Holosight_smg",

"U_C_Commoner1_1",

"U_C_Poloshirt_redwhite",

"U_IG_Guerilla1_1",

"U_IG_Guerilla2_1",

"U_IG_Guerilla2_3",

"U_IG_Guerilla3_1",

"U_C_Novak",

"U_Rangemaster",

"V_BandollierB_blk",

"V_BandollierB_oli",

"V_TacVestCamo_khk",

"V_TacVestIR_blk",

"V_TacVest_blk",

"V_TacVest_blk_POLICE",

"V_TacVest_brn",

"V_TacVest_camo",

"V_TacVest_khk",

"V_TacVest_oli"

]],[ 1, [ // MILITARY

"acc_flashlight",

"acc_pointer_IR",

"FirstAidKit",

"H_HelmetB_camo",

"H_HelmetB_paint",

"H_HelmetIA_net",

"H_HelmetSpecB_blk",

"H_PilotHelmetFighter_I",

"Medikit",

"muzzle_snds_acp", // .45 ACP

"muzzle_snds_B", // 7.62mm

"muzzle_snds_H", // 6.5mm

"muzzle_snds_H_MG", // 6.5mm LMG

"muzzle_snds_L", // 9mm

"muzzle_snds_M", // 5.56mm

"NVGoggles",

"optic_Aco",

"optic_ACO_grn",

"optic_aco_smg",

"optic_Arco",

"optic_Hamr",

"optic_Holosight",

"optic_Holosight_smg",

"optic_DMS",

"optic_NVS",

"optic_SOS",

"U_B_CombatUniform_mcam",

"U_B_GhillieSuit",

"U_I_CombatUniform",

"U_I_GhillieSuit",

"U_O_CombatUniform_ocamo",

"U_O_GhillieSuit",

"V_Chestrig_blk",

"V_HarnessOGL_brn",

"V_HarnessOSpec_brn",

"V_HarnessO_brn",

"V_PlateCarrier1_blk",

"V_PlateCarrier2_rgr",

"V_PlateCarrier3_rgr",

"V_PlateCarrierGL_rgr",

"V_PlateCarrierIA1_dgtl",

"V_PlateCarrierIA2_dgtl",

"V_PlateCarrierIAGL_dgtl",

"V_PlateCarrierSpec_rgr"

]],[ 2, [ // INDUSTRIAL

"FirstAidKit"

]],[ 3, [ // RESEARCH

"FirstAidKit",

"Medikit",

"NVGoggles",

"optic_NVS",

"optic_SOS",

"U_C_Scientist",

"optic_tws"

]]];

//here place backpacks, parachutes and packed drones/stationary

//used with addBackpackCargoGlobal

//"lootBackpack_list" array of [class, [backpacklist]]

// class : 0-civil, 1-military, ... (add more as you wish)

// backpacklist: list of backpack class names

lootBackpack_list = [

[ 0, [ // CIVIL

"B_AssaultPack_blk", // 34 Mags

"B_AssaultPack_cbr",

"B_AssaultPack_dgtl",

"B_AssaultPack_khk",

"B_AssaultPack_mcamo",

"B_AssaultPack_ocamo",

"B_AssaultPack_rgr",

"B_AssaultPack_sgg",

"B_BergenC_red", // 50 Mags

"B_Bergen_mcamo", // 54 Mags

"B_HuntingBackpack", // 32 Mags

"B_OutdoorPack_blu" // 17 Mags

]],[ 1, [ // MILITARY

"B_BergenG", // 64 Mags

"B_BergenC_red",

"B_Carryall_cbr", // 60 Mags

"B_Kitbag_cbr", // ? Mags

"B_Kitbag_mcamo",

"B_Kitbag_mcamo_Eng",

"B_Kitbag_rgr_Exp",

"B_Kitbag_sgg"

]],[ 2, [ // INDUSTRIAL

"B_Bergen_sgg",

"B_Carryall_cbr", // 60 Mags

"B_TacticalPack_blk", // 42 Mags

"B_TacticalPack_mcamo",

"B_TacticalPack_ocamo",

"B_TacticalPack_oli",

"B_TacticalPack_rgr"

]],[ 3, [ // RESEARCH

"B_BergenG", // 64 Mags

"B_Bergen_mcamo",

"B_Carryall_cbr", // 60 Mags

"B_FieldPack_blk", // 35 Mags

"B_FieldPack_ocamo",

"B_FieldPack_oli",

"B_FieldPack_oucamo"

]]];

//here place any other objects(ex.: Land_Basket_F, Box_East_Wps_F, Land_Can_V3_F, ...)

//used with createVehicle directly

//"lootworldObject_list" array of [class, [objectlist]]

// class : 0-civil, 1-military, ... (add more as you wish)

// objectlist : list of worldobject class names

lootworldObject_list = [

[ 0, [ // CIVIL

]],[ 1, [ // MILITARY

]],[ 2, [ // INDUSTRIAL

]],[ 3, [ // RESEARCH

]]];

Edited by Desai92

Share this post


Link to post
Share on other sites

Hi Desai92,

Remove the ending komma at line 16.

greetings Na_Palm

Share this post


Link to post
Share on other sites
Hi Desai92,

Remove the ending komma at line 16.

greetings Na_Palm

that worked thankyou, but it doesnt spawn in the map, radio or compas, it just has a blank spot where they would have spawned in the inventory... :/

Edited by Desai92

Share this post


Link to post
Share on other sites

Hi, Im trying to use your script in Chernaus not from the AiA mod but the version of A3MP, but nothing spawns anywhere, is it a problem with the builidingpositions?

Share this post


Link to post
Share on other sites

Is there any way to make loot spawn higher in a specific building? i added some new buildings, works great, but some of them spawn stuff halfway into the floor.

Update:

Nvm found it ; change in Lootspawner.sqf

swSpZadjust = false;

#define LOOT_Z_ADJUST -0.1

needed for ArmA 2 and older Maps/Buildings

Edited by Mikederel

Share this post


Link to post
Share on other sites

The normal spawn script works on my Altis test bed, but when I download the fix for floating items, nothing spawns. Is there a way to fix this?

Share this post


Link to post
Share on other sites

we're trying to use this on our server and it doesn't seem to work that well.

loot takes forever to spawn and only seems to do so if everyone is in the same area.

If anyone has a solution that'd be great, but until then I recommend you find another script

Share this post


Link to post
Share on other sites

Could loot spawner be used to place furniture inside buildings? So specific types of buildings would have certain compositions of furniture inside?

Share this post


Link to post
Share on other sites

Kicked off game battleye: createvehicle restriction #0

Anyone know the filter/solution im not very good with filters ect....

thanks in advance

Share this post


Link to post
Share on other sites

Na_Palm,

I've noticed that for Chernarus, most - if not all - loot is in the air at certain places, and some loot is in the ground.

Construction buildings usually have *some* loot in the ground, but about 90% of it you can pick up. Most loot in the hangars at NWAF, or NEAF, are in the air and people can't really pick them up.

I've changed the following:

//Variables

//local

_spawnradius = 80; //Radius (in meter) around players to spawn loot

_spInterval = 1600; //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.5; //High adjustment (in engine units) thats generally added to every spawnpoint

_tmpTstPlace = [5070, 9297, 0]; //Coord's, in [x,y,z] of a preferably flat and unocupied piece of land

//global old

//chBuildhasloot = 60; //The odds that a building is selected to place loot.

//chSpothasloot = 30; //The odds that the selected building's spots will have loot(almost like odds per room).

To represent the adjustable height, however, most loot is still in the ground.

Is there a way to have all loot spawn at a specific height, and then drop for physics? Specifically in Arma 3.

PS - I've already updated the fix files as needed.

Thanks,

Black

Edited by BlackPlague_R2

Share this post


Link to post
Share on other sites

I'm a bit new to implementing scripts for arma3, can anyone lend a hand for the battleye filters used for this?

Loot spawns, but certain items i get restriction kicks for.

Any help is greatly appreciated, great work on the script!

edit: never mind, i read the tutorials and such. Sorry for the spam

Edited by prone

Share this post


Link to post
Share on other sites

Hey first of all id like to say thank you for your time and dedication, your script works very well except the loot still spawns up in the air. I have already downloaded the new files that copy over 3 files but the loot still spawns air born. Also the higher you go like when you climb up the high towers the higher the loot spawns from the floor. I also tried messing with the _genZadjust = -0.1; ive changed it all the way down to 0.01 and still 90% of the loot is still in the air. I only am giving feedback in hopes someone will fix this.

Thanks

Share this post


Link to post
Share on other sites
your script works very well except the loot still spawns up in the air.

If the author is using weaponHolders he needs to use weaponHolderSimulated.

Share this post


Link to post
Share on other sites
Hey first of all id like to say thank you for your time and dedication, your script works very well except the loot still spawns up in the air. I have already downloaded the new files that copy over 3 files but the loot still spawns air born. Also the higher you go like when you climb up the high towers the higher the loot spawns from the floor.

Hi,

Good first post - if the loot is spawning higher, the higher you are then that would be indicative of an ASL problem. Sounds like the position is calculated to ASL but is spawned to ATL so then appears in the air, and further up as you get higher.

...Or maybe the other way round (ATL > ASL) - I can't figure it out in my head at the mo as it's late here.

Good spot :)

Edited by Das Attorney

Share this post


Link to post
Share on other sites
Hello and welcome to the Lootspawner system!

I'am not great at writing long text so to make it short...

The LS system here at hand evolved from the loot spawn system used in 404's and GOT's older Wasteland versions.

This version however is completly rewriten and evolves around the idea to spawn the loot as near as possible to

the player position and therefore gain speed and reduce lag.

It is compatible with every island/map that uses buildings that have buildingpositions.

It is configurable to a great degree and almost, NOT completly ofcourse, Lag and FPS neutral.

The last part, about Lag and FPS for high player counts, has to be tested as i have only a few friends that play ArmA,

but here you all can help me! For small playercounts on Altis, with my PC running client and server simultan on an

Phenom X4 965, it is almost unnoticeable even with a bit edited A3Wasteland dev. build i use.

DOWNLOADS

MultiPlayer example maps for Altis and AiA/Chernarus are available at:

Testmission for Altis and

Testmission for AiA/Chernarus

SinglePlayer example maps for Altis and AiA/Chernarus are available at:

Testmission for Altis(SP) and

Testmission for AiA/Chernarus(SP)

Fix for flying loot as of ArmA 3 v1.12 REUPLOADED

LSUpdf112.zip

(replace existing file with this new version)

The download is replacing following files:

- fn_LSgetBuildingstospawnLoot.sqf

- Lootspawner.sqf

- Lootspawner_SP.sqf

Script as Zip:

LootSpawner_v101.zip

old Version's:

Lootspawner as ZIP

HOWTO:

MultiPlayer: create a init.sqf file in your mission folder and paste this code inside:

if (isServer) then {
fn_getBuildingstospawnLoot = compile preProcessFileLineNumbers "fn_LSgetBuildingstospawnLoot.sqf"; 
LSdeleter = compile preProcessFileLineNumbers "LSdeleter.sqf";
execVM "Lootspawner.sqf";
};

SinglePlayer: create a init.sqf file in your mission folder and paste this code inside:

fn_getBuildingstospawnLoot = compile preProcessFileLineNumbers "fn_LSgetBuildingstospawnLoot.sqf"; 
LSdeleter = compile preProcessFileLineNumbers "LSdeleter.sqf";
execVM "Lootspawner_SP.sqf";

to configure the system, open:

1. 'Lootspawner.sqf' to change the available variables as needed.

(ex. spawninterval, chance of loot, categories of loot...)

2. 'LSlootLists.sqf' to customize the items inside the categories

3. 'LSlootBuildings.sqf' to change the lootcategory of a building or add/remove buildings

credits go to: Ed! (404Forums) and [GoT] JoSchaap (GoT2DayZ.nl) for the initial spawnsystem for Wasteland

greetings Na_Palm

Hello again, I wanted to provide some more feedback on you really great script.

Well Id like to let you know that your script is one of my favorites on my sever it really has much potential and its almost perfect. I have been doing trial and error with the numbers and just cant seem to get the loot to come down after a certain point. Like i said in my previous post, the loot spawn great and the script works awesome, the only issue is the floating loot that gets worse as you climb up on tall buildings like the towers at the military bases. the higher you go the higher the loot spawns in the air. I have used your new upload which is supposed to help but it really hasnt made a difference except with the gas cans and the crates that spawn, these actually spawn perfectly lined up with the floor no matter how high you are, whether ground level or up on the snipping towers in the military base the gas cans and crates spawn perfectly lined up. I thought this information might help you solve the problem. Just so you know your script is being used in many many servers and not just arma but also the arma epoch servers and all of them are having the same issue with the floating loot. If you need help with the script im sure if you ask for help others here would be willing to help but i have confidence that with this new information youll be able to fix the issue cause its a brilliant script. Well im looking forward to your update, take care and again thanks so much for your time and dedication you have invested.

Your friend,

Thebuddhistman

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×