Crowborn Posted November 15, 2017 Share Posted November 15, 2017 Hello, i know well how to add distributions for my mod's items, but how could i alter distributions for already existing items? I found no tutorials detailing this. Thanks Link to comment Share on other sites More sharing options...
rez Posted November 16, 2017 Share Posted November 16, 2017 (edited) 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 November 16, 2017 by rez Crowborn 1 Link to comment Share on other sites More sharing options...
Crowborn Posted November 17, 2017 Author Share Posted November 17, 2017 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 More sharing options...
rez Posted November 17, 2017 Share Posted November 17, 2017 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 Crowborn 1 Link to comment Share on other sites More sharing options...
tommysticks Posted December 9, 2017 Share Posted December 9, 2017 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. Crowborn 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now