Project Zomboid

Project Zomboid

[OBSOLETE] Taped TV Shows
 此主题已被置顶,因此可能具有重要性
Tiax  [开发者] 2020 年 11 月 24 日 下午 12:18
Reference: loot.ini
OUTDATED, AS OF 2021-07-30: No longer available



In this new version, I added a file called "loot.ini", generated in the mod's directory if it doesn't exist. The file is read when you load your save, so you need to quit+reload, after you make any changes for them to take effect.

This is the mod's default, I hope it's self-explanatory enough with the comments I included:

# TapedTvShows: loot configuration file [InsertByItem] # Insert a drop by looking for an existing item in the drop tables # lines below are in format: Item type=base chance to drop # make tapes appear anywhere CDs (Disc) appear. Covers mostly shops and shelves. Disc=0.025 [InsertByTable] # Insert a drop by directly inserting into an existing drop table # See ProjectZomboid\media\lua\server\Items\Distributions.lua for the table names # lines below are in format: table name=base chance to drop # make tapes appear on zombie corpses all.inventorymale=-1.0 all.inventoryfemale=-1.0 # makes tapes appear on shelves, e.g. living rooms, general stores all.shelves=0.025

How do the numbers work?
When you come in range of a container (or Zombie) for the first time, the game rolls the items it contains. Every item in the loot table gets at roll. The formula to determine if you "hit" an item or not is as follows:

Rand.Next(10000) <= loot_table_chance × 100.0 × luck_modifier × world_loot_modifier + chunk_zombie_intensity_modifier

So basically it rolls an integer between 0 and 9999 (inclusive) and compares that against that equation.

  • Please be aware that we can only influence the loot_table_chance in this
  • luck_modifier is either 1.0 or 0.9/1.1 if you have the unlucky/lucky traits respectively (10% malus or bonus)
  • world_loot_modifier is basically the sandbox setting (extremely rare=0.2, rare=0.6, normal=1.0, common=2.0, abundant=3.0)
  • chunk_zombie_intensity_modifier is not quite clear. I assume it's got something to do with how many zombies are around in the current chunk to reward you for looting "hot" areas. Either way: the bonus from it maxes out at 80 (i.e. 80/10000 = 0.8% bonus drop chance).
最后由 Tiax 编辑于; 2021 年 7 月 30 日 下午 2:13