Jump to content
  • 0

[help] Custom loot table with wood walls


HellWalker

Question

Hey guys!

I use a custom loot table and i was able to change the % of spawn of some items i wanted. I also could add some extra items to the loot table.

But when it comes to building objects, they are not spawning, even with 100% of chance. So the problem might be with my code (i'm not advanced in scripts).

 

This is the code i'm using for the industrial spawn (only the code i added) :

 

lootType[] = {
.....
{"CinderBlocks","magazine",0.5},
{"MortarBucket","magazine",0.2},
{"cinder_garage_kit","",0.02},
{"cinder_door_kit","",0.03},
{"cinder_wall_kit","",0.05},
{"metal_floor_kit","",0.01},
{"light_pole_kit","",0.5},
{"ItemFireBarrel_kit","",0.1}

So, is there something wrong with the blank " " ?

Do i need to insert a 'magazine' code for those items? Because some of the other itmes has nothing in there, some has magazine, object, single, etc...

 

If anyone can help me.. will be great! =D

 

Thanks!

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Hey guys!

I use a custom loot table and i was able to change the % of spawn of some items i wanted. I also could add some extra items to the loot table.

But when it comes to building objects, they are not spawning, even with 100% of chance. So the problem might be with my code (i'm not advanced in scripts).

 

This is the code i'm using for the industrial spawn (only the code i added) :

 

lootType[] = {
.....
{"CinderBlocks","magazine",0.5},
{"MortarBucket","magazine",0.2},
{"cinder_garage_kit","",0.02},
{"cinder_door_kit","",0.03},
{"cinder_wall_kit","",0.05},
{"metal_floor_kit","",0.01},
{"light_pole_kit","",0.5},
{"ItemFireBarrel_kit","",0.1}

So, is there something wrong with the blank " " ?

Do i need to insert a 'magazine' code for those items? Because some of the other itmes has nothing in there, some has magazine, object, single, etc...

 

If anyone can help me.. will be great! =D

 

Thanks!

 

If it won't work try adding magazine in the "" or "single" might work as well.

Link to comment
Share on other sites

  • 0

It's working, thanks =D

Np, I didn't fully read your post originally, seems you were on the right track already, lol. But yah, in case you're interested, bit of an understanding of it based on my experience with it.

{"SingleItem/CfgLoot","CfgLoot/Function",1},

Either slot can be used to make a call from the CfgLoot.hpp, otherwise the first slot can be used for a single item, and the second can be used for an added call or function. If you want to make a single call to the CfgLoot, just place the class name into the second part.

{"", "trash", 0.30},

Of course when you do it like that, it may call multiple items from that group to spawn since it's assigned to the second part. If you wanted a single trash item to spawn, you'd want to do.

{"trash", "single", 0.30},

This can also be used for the ability to spawn extra loot on single items too. Example.

{"CinderBlocks", "trash", 0.30},

That would make it so your when cinder blocks spawn, they may spawn with some random loot from the trash group in your CfgLoot. You can mix in any manner you wish and it should work without an issue.

 

Other terms also seem to create additional functions in certain situations. For example...

{"assaultrifles", "cfglootweapon", 0.1},

cfglootweapon seems to provide the chance the weapon will spawn with some ammunition associated to the weapon that gets selected to spawn. Using "object" I believe works in a manner where you can just press enter when looking at an item to have it directly added into your inventory without opening the menu (Like when you see "Pickup Crowbar" or "Pickup Jerrycan"). Aside from that, when you're doing single items like in your example above. For basic inventory items you want "magazine" and weapons or toolbelt items "weapon". Overall you have quite a bit of flexibility to work with how your stuff spawns in order to make loot spawn in greater abundance, or a lot more rare without just playing with the percentage rates. There is probably more to it then that, that's just what I've figured out so far.

Link to comment
Share on other sites

  • 0

Well, that was a very good explanation! =D

Now i understand even better how it works..

 

So, for example, instead of addind each item to the loot table, like i did, can i just creat an extra class in the Cfgloot.hpp "mycustomclass" and then i put my items inside this class.

Next, i go to CfgBuildingLoot and just call it like:

 {"","mycustomclass",0.5}

 ?

 

Because this way i'll have a better distributed spawn.

The idea is to increase, and also add base building objects.

 

Players in my server stay a lot of time in safe zones or in the woods getting planks...

 

This way they can run more all over the map looting those items, and server is more balanced.

I can already see this happening, even with the changes i made

 

Thanks mate!

Link to comment
Share on other sites

  • 0

Well, that was a very good explanation! =D

Now i understand even better how it works..

 

So, for example, instead of addind each item to the loot table, like i did, can i just creat an extra class in the Cfgloot.hpp "mycustomclass" and then i put my items inside this class.

Next, i go to CfgBuildingLoot and just call it like:

 {"","mycustomclass",0.5}

 ?

 

Because this way i'll have a better distributed spawn.

The idea is to increase, and also add base building objects.

 

Players in my server stay a lot of time in safe zones or in the woods getting planks...

 

This way they can run more all over the map looting those items, and server is more balanced.

I can already see this happening, even with the changes i made

 

Thanks mate!

Yup, that would work fine. However if you're doing it with the cinder blocks and stuff and only want one to spawn from the custom class you'd want.

{"mycustomclass","single",0.5}

When done the way you just posted, it may place multiple of the items from the class. So you might have 2 cinderblocks or a cinderblock and something else from the group spawn in one spot.

Link to comment
Share on other sites

  • 0

I guess as an addition I should probably explain... In your CfgBuildingLoot.hpp you can also make custom classes as well...

class MilitarySpecial : Default {

If you actually go to bottom you find all the information with buildings, coordinates for spawns, and the class they use like so... (edited a bit to fit better)

class Land_Mil_Barracks_i : MilitarySpecial //THIS PART
    {
        lootPos[] = {{4.56494, -2.67383, -1.14822}, {0.312988, 1.54492, -1.09824}, {-2.95361, 1.49414, -1.11823}};
        lootPosZombie[] = {{-7.97119, 0.0888672, -0.223236}, {-5.29053, -0.952148, -0.223236}};
        lootPosSmall[] = {{3.88037, -0.905273, -0.358246}};
    };

So if you can check the id's of the buildings using your w/e admin tools you may have, you can adjust what classes are loaded for a building, and create new ones.

class building_id : class_to_use

As an example on my server I hated Firestations using military loot so I created a new class. (Note mine uses a few custom classes I added in my CfgLoot)

    class FireStation : Default {
        zombieChance = 0.6;
        zombieClass[] = {"z_worker1", "z_worker2", "z_worker3"};
        maxRoaming = 6;
        lootChance = 0.4;
        lootPos[] = {};
        lootType[] = {
                {"", "trashhouse", 0.32},   
                {"", "generic", 0.12},
                {"", "foodsnack", 0.04},
                {"WeaponHolder_ItemHatchet_DZE", "object", 0.08},
                {"ItemKnife", "weapon", 0.02},
                {"ItemToolbox", "weapon", 0.03},
                {"backpacks", "backpack", 0.06},
                {"WeaponHolder_ItemCrowbar", "object", 0.03},
                {"pistolsammohouse", "single", 0.04},
                {"pistolshousehold", "cfglootweapon", 0.02}
        };
        lootTypeSmall[] = {
                {"", "trashhouse", 0.32},  
                {"pistolsammohouse", "single", 0.03},
                {"pistolshousehold", "cfglootweapon", 0.01},
                {"ItemKnife", "weapon", 0.05}
        };
    };

 

Then found the building id at the bottom and changed it to load that as follows.

    class Land_a_stationhouse : FireStation {
        lootChance = 0.3;
        lootPos[] = {{15.436, 2.85498, -9.47058}, {17.9861, -6.52832, -9.47058}, {1.22583, 2.24463, -9.47058}, {-3.9126, -7.29834, -9.47058}, {-2.28271, -6.21094, -4.6489}, {-1.604, -8.68018, -0.043786}, {-1.104, -5.60938, 4.41139}, {-3.55811, -8.56787, 4.41139}, {-2.99219, -8.27148, 8.49209}};
        lootPosZombie[] = {{0.977295, -0.614746, -8.59558}, {3.88477, 2.83057, -8.59558}, {-2.97949, -5.49365, -8.59558}, {-1.08789, -8.40674, -3.7739}, {-4.22363, -8.68604, 0.831215}, {-0.745117, -8.68896, 5.28639}, {21.0693, -9.00537, -8.63291}, {-11.4531, -9.27734, -8.63291}, {-3.64014, 10.3086, -8.63291}};
        lootPosSmall[] = {{14.6826, 3.55029, -8.25058}, {9.97266, 3.48584, -9.40058}, {19.1477, -6.69629, -9.36058}, {19.1719, -7.47998, -9.36058}, {0.513672, 1.19336, -9.39058}, {0.51416, 3.3418, -8.63058}, {0.52124, 1.92334, -7.87058}, {-1.63623, -8.99756, -9.39058}, {-3.5647, -9.01855, -8.63058}, {-0.76709, -8.99072, -7.87058}, {-2.40137, -9.03027, -8.25058}, {-4.50391, -5.27588, -4.6489}, {-1.02393, -9.02051, 0.0562134}, {-0.771484, -8.3335, 0.0762138}, {-0.7229, -9.03076, 1.19621}, {-4.40308, -8.7666, 4.41139}, {-2.27783, -5.35303, 4.41139}, {-4.4541, -8.81055, 8.49209}, {9.12549, 3.64697, -8.25058}};
    };
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
  • Discord

×
×
  • Create New...