Havoc302

[SOLVED] Adding to Loot tables

5 posts in this topic

I'd like to add some extra building types to spawn loot and manually enter the locations and a whole new table for these buildings, I don't see any way to do this in the compiler (at least that I could understand how to do), I'm more than happy to do it manually but I don't understand how they're structured. I can see that each building classname has it's own class and it's locations defined as well as which table to draw from, that I'm ok with doing through some trial and error but creating a new table I'm not sure what the below values all do / what they need to be / total up-to to get it to work. Would anyone be able to explain it please.

 

I'll use Medical as an example because it's small.

I don't understand how the chance is calculated exactly? I understand that is has to end in / add up to? 10000?

I also don't understand what purpose count, half and halfindex have.

class Medical
    {
        count = 10;
        half = 8881.48148148148;
        halfIndex = 5;
        sum = 10000;
        items[] = 
        {
            {2592.59259259259, "Exile_Item_Vishpirin"}, // 25.93%
            {5185.18518518519, "Exile_Item_Heatpack"}, // 25.93%
            {6481.48148148148, "Exile_Item_Bandage"}, // 12.96%
            {7281.48148148148, "Exile_Item_Can_Empty"}, // 8.00%
            {8081.48148148148, "Exile_Item_ToiletPaper"}, // 8.00%
            {8881.48148148148, "Exile_Item_PlasticBottleEmpty"}, // 8.00%
            {9400, "Exile_Item_InstaDoc"}, // 5.19%
            {9600, "Exile_Item_Magazine01"}, // 2.00%
            {9800, "Exile_Item_Magazine02"}, // 2.00%
            {10000, "Exile_Item_Magazine03"} // 2.00%
        };
    };

 

 

We're using the Namalsk map and there's some buildings, especially in the main city which have no loot, also things like garbage bins, rubbish piles and other things like that we'd like to add loot to. Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites

In the tools section, grab one of the many loot position tools. Then follow the same format inside your classCfgBuildings within your server config file.

Once the new buildings are placed, assign them a table ie "Industrial"

Then, they will spawn loot, below you can see two custom spawns, the positions were gained by using a loot position tool. I then simply include these new buildings inside the existing cfgBuildings class in the config and they will now spawn loot from that loot table

Example

class Land_Wreck_Car_F
{
	table = "ResidentialGeneral";
	positions[] = {{-1.05664, 3.54688, -0.578613},{0.40918, -2.9082, -0.910034},{-2.29688, -0.116211, -0.853882},{2.79199, -0.308594, -0.578979}}; // Defined
};

class Land_Wreck_Car2_F
{
	table = "ResidentialGeneral"; // Table name to match the compiler tool in the downloads section
	positions[] = {{X,X,X}}; // Undefined positions
};

 

Share this post


Link to post
Share on other sites
Advertisement

Download the loot table compiler from the Downloads section. Edit loottable.h. For example:

///////////////////////////////////////////////////////////////////////////////
// Hospital, Medevac etc.
///////////////////////////////////////////////////////////////////////////////
> Medical

25, Exile_Item_InstaDoc
25, Exile_Item_Bandage
25, Exile_Item_Vishpirin
50, Exile_Item_InstantCoffee
75, Exile_Item_EMRE
3, rzinfection_antivirus_pills
1, rzinfection_antivirus_injector
1, Exile_Item_Knife

The higher the number, the greater the chance of that loot spawning. You can create your own class and put your own items in it, then assign that class to whatever buildings you want. After you've adjusted everything the way you want, copy the contents of loottable.h into the online loot table compiler: 

Replace the loot table from your config.cpp with the output of that website. Make sure you back up your config.cpp first, in case you mess up the cut and paste.

Share this post


Link to post
Share on other sites

Ah right, so it can be done with the tools provided, thanks guys! I was just not sure of the process.

Share this post


Link to post
Share on other sites
Advertisement
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.