Jump to content

Understandind SuburbsDistribution


blindcoder

Recommended Posts

Hello.
 
As far as I understood, Suburbsdistribution is a multi-dimensional array of the form

SuburbsDistribution[<roomtype>][<containertype>] = {  rolls = <integer>,  items = {    ItemFulltype = Chance to spawn in %,    ....  }}

Now I've come across some entries that don't conform to this:

SuburbsDistribution["Plasticbag"] = {  rolls = 3,  items = {    "Base.Plasticbag", 5,    "Base.Plasticbag", 5,    "Base.Plasticbag", 5,    "Base.Plasticbag", 5,  },  fillRand = 3,}SuburbsDistribution["fridge"] = {  rolls = 5,  items = {    "Base.Pop", 3,    "Base.Pop2", 3,    "Base.Pop3", 3,    "Base.PopBottle", 3,    "Base.WaterBottleFull", 3,  }}

Is that valid data or a bug?

Link to comment
Share on other sites

Ah, nevermind, I just found the explanation in  ItemPicker.lua line 186ff:

            -- if the item is a container, we look to spawn item inside it            if(SuburbsDistributions[item:getType()]) then              if instanceof(item, "InventoryContainer") and doItemContainer and ZombRand(SuburbsDistributions[item:getType()].fillRand) == 0 then                ItemPicker.rollContainerItem(item, character, SuburbsDistributions[item:getType()]);              end            end
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...