Project Zomboid

Project Zomboid

114 beoordelingen
Easy Distributions API
   
Prijs
Toevoegen aan favorieten
Toegevoegd aan favorieten
Verwijderen uit favorieten
Bestandsgrootte
Geplaatst op
Bijgewerkt op
1.586 MB
24 mei om 23:35
1 jun om 2:34
3 wijzigingsnotities (weergeven)

Abonneren om te downloaden
Easy Distributions API

Omschrijving
A library to simplify loot distribution for modders by allowing a new item to copy an existing item's loot probabilities.

For non-modders:

Install this mod if it is a requirement for another mod you want. This mod can be added and removed freely, but the mods that depend on this may not be so easy-going.

For Modders:

Enabling the Library

Just add the following require line to a lua file in your mod's /media/lua/server folder, then place any calls to library below that so they execute as the .lua file is loaded.

local easyDistroLibrary = require("EasyDistro")

In your mod.info file add require=\NepEasyDistro and add the library as a requirement on Steam to make it easier for users to download.

Adding Items

To copy the loot distribution of an existing item call EasyDistro.Add with the identifier of your new item and the identifier of the item you want to copy. For example, if you create a new type of handgun and want it to show up everywhere the standard 9mm pistol shows up:

easyDistroLibrary.AddItem("Base.MyNewGun","Base.Pistol")

The Add function supports an optional third parameter that will multiply the new items probability. For example, to add a purple pen that appear with 25% of the probability of a green pen:

easyDistroLibrary.AddItem("Base.MyPurplePen", "Base.GreenPen", 0.25)



That's it. Everything else is optional.


Enabling verbose mode

To aid troubleshooting, you can call EnableVerbose() which will list every entry as they are found, and again as they are added to the loot table. Please don't leave this enabled in your mod when publishing, because it will affect all mods using this library and result in log file spam for all users!

Force Updating the Item picker

If for some reason you update the loot tables after the ItemPicker has already initialized, UpdateItemPicker() will force the ItemPicker to re-read the ProceduralDistributions table. This isn't needed if you call AddItem() as described above, but it you call it later for some reason this allows your changes to take effect.


Github Link[github.com]






Workshop ID: 3487312010
Mod ID: NepEasyDistro
4 opmerkingen
Nepenthe  [auteur] 2 sep om 17:01 
Verbose just enable additional logging, it does not change what the library is doing.
sexter morgan 2 sep om 8:38 
is verbose needed for anything to spawn besides the survival rifle cause i can't find anything else but the rifle
Totsnuk 7 jun om 12:54 
oo very noice
freaka the north 31 mei om 6:25 
will be implemented as part of Box more shortly, im working on the update for it