Jump to content

How to alter distribution of vanilla items?


Crowborn

Recommended Posts

You can alter the file itself,

.\ProjectZomboid\media\lua\server\Items\Distributions.lua

...but that means every time it is changed by release you lose your customization. So make backups, often.

 

Other way is to make a mod that alters several items distributions you are interested in.

Example (adapted from better_canning mod):

require 'Items/SuburbsDistributions'

table.insert(SuburbsDistributions["burgerkitchen"]["counter"].items, "Base.Salt");
table.insert(SuburbsDistributions["burgerkitchen"]["counter"].items, 2);
table.insert(SuburbsDistributions["burgerkitchen"]["counter"].items, "Base.Pepper");
table.insert(SuburbsDistributions["burgerkitchen"]["counter"].items, 2);

You should note that it uses SuburbsDistributions, but that's no problem at the time.

Other thing to pay attention to is to insert paired parameters: first is the item name, second is the weight (chance, not a carryweight). That's not pretty, but it works for me.

Maybe devs could provide more elegant way.

Edited by rez
Link to comment
Share on other sites

20 hours ago, rez said:

You can alter the file itself,


.\ProjectZomboid\media\lua\server\Items\Distributions.lua

...but that means every time it is changed by release you lose your customization. So make backups, often.

 

Other way is to make a mod that alters several items distributions you are interested in.

Example (adapted from better_canning mod):


require 'Items/SuburbsDistributions'

table.insert(SuburbsDistributions["burgerkitchen"]["counter"].items, "Base.Salt");
table.insert(SuburbsDistributions["burgerkitchen"]["counter"].items, 2);
table.insert(SuburbsDistributions["burgerkitchen"]["counter"].items, "Base.Pepper");
table.insert(SuburbsDistributions["burgerkitchen"]["counter"].items, 2);

You should note that it uses SuburbsDistributions, but that's no problem at the time.

Other thing to pay attention to is to insert paired parameters: first is the item name, second is the weight (chance, not a carryweight). That's not pretty, but it works for me.

Maybe devs could provide more elegant way.

Thanks! How do i include the edited distributions file in a mod folder, so that it overrides the base one? I'm unsure of the folder structure.

Link to comment
Share on other sites

6 hours ago, Crowborn said:

How do i include the edited distributions file in a mod folder, so that it overrides the base one? I'm unsure of the folder structure.

Try this structure:

c:\Users\<username>\Zomboid\mods\<your_modname>\media\lua\server\Items\modified_distributions.lua

 

Link to comment
Share on other sites

  • 3 weeks later...

 

On 11/17/2017 at 6:23 AM, Crowborn said:

Thanks! How do i include the edited distributions file in a mod folder, so that it overrides the base one? I'm unsure of the folder structure.

I'm pretty sure that if you name it exactly as the game has it, it overrides the base game file, so if you put it like this:

c:\Users\<username>\Zomboid\mods\<your_modname>\media\lua\server\Items\Distributions.lua

...it should work.

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
×
×
  • Create New...