blindcoder Posted July 16, 2015 Share Posted July 16, 2015 Hello. As far as I understood, Suburbsdistribution is a multi-dimensional array of the formSuburbsDistribution[<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 More sharing options...
Spracky Posted July 16, 2015 Share Posted July 16, 2015 What did I just read.... Link to comment Share on other sites More sharing options...
EnigmaGrey Posted July 16, 2015 Share Posted July 16, 2015 I guess there's no reason it can't be both? Link to comment Share on other sites More sharing options...
blindcoder Posted July 16, 2015 Author Share Posted July 16, 2015 I suppose it can be, but assumed it to beSuburbsDistribution["all"]["fridge"]then. Link to comment Share on other sites More sharing options...
blindcoder Posted July 16, 2015 Author Share Posted July 16, 2015 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 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