Project Zomboid

Project Zomboid

114 평점
Easy Distributions API
   
어워드
즐겨찾기
즐겨찾기됨
즐겨찾기 해제
파일 크기
게시일
업데이트일
1.586 MB
2025년 5월 24일 오후 11시 35분
2025년 6월 1일 오전 2시 34분
업데이트 노트 3개 (보기)

다운로드 위해 구독하기
Easy Distributions API

설명
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
Nepenthe  [작성자] 2025년 9월 2일 오후 5시 01분 
Verbose just enable additional logging, it does not change what the library is doing.
sexter morgan 2025년 9월 2일 오전 8시 38분 
is verbose needed for anything to spawn besides the survival rifle cause i can't find anything else but the rifle
Totsnuk 2025년 6월 7일 오후 12시 54분 
oo very noice
freaka the north 2025년 5월 31일 오전 6시 25분 
will be implemented as part of Box more shortly, im working on the update for it