[quote=“Coolthulhu, post:64, topic:12858”]But no, probability is not a field of item because each item can have multiple different probabilities.
That’s the whole problem: you have to access the item groups (not sure if it can be done right now, but if someone really cared we could open them up to lua), go through all of the item groups, find item IDs that represent items which are food, decrease probabilities there and then pad the remaining item group properly (padding is not necessary, just makes it work better).
Item groups are nested, but you wouldn’t want to recurse, just go through all of them “flat”.[/quote]
Sounds very complicated for me. Btw, I found this:
But if probability can not be decreased while loot spawn for whole item category and your solution is the most simple, then better just go through every mapgen json and decrease probability there, really.
Item groups with food very often contains other stuff which must be not affected. Example under the spoiler.
P.S. "repeat": [ 1, 3 ] – 1, 3 means from 1 to 3 spawn cycles am i right?
[Spoiler]
"type" : "item_group",
"id" : "livingroom",
"items":[
["rootbeer", 65],
["mag_computer", 35],
["purple_drink", 35],
["creamsoda", 35],
["lemonlime", 35],
["orangesoda", 20],
["crispycran", 20],
["colamdew", 35],
["television", 30],
["clock", 10],
["cola", 70],
["choc_drink", 10],
["cig", 90],
["chaw", 20],
["cigar", 5],
["ecig", 10],
["advanced_ecig", 8],
["nicotine_liquid", 8],
["pipe_tobacco", 5],
["tobacco", 5],
["weed", 10],
["joint", 10],
["seed_weed", 5],
["rolling_paper", 5],
["mask_hockey", 5],
["mask_guy_fawkes", 5],
["hockey_stick", 10],
["news_regional", 4],
["many_years_old_newspaper", 2],
["years_old_newspaper", 2],
["one_year_old_newspaper", 3],
["months_old_newspaper", 4],
["weeks_old_newspaper", 5],
["newest_newspaper", 8],
["mag_bashing", 10],
["mag_cutting", 10],
["mag_stabbing", 5],
["child_book", 50],
["tall_tales", 10],
["story_book", 4],
["novel_pulp", 16],
["fairy_tales", 10],
["mag_unarmed", 10],
["tailor_portfolio", 1],
["trappers_companion", 1],
["puck", 5],
["baseball", 5],
["football", 5],
["golf_club", 10],
["jersey", 10],
["fan", 10],
["pipe_glass", 5],
["coke", 8],
["meth", 2],
["sneakers", 80],
["boots", 70],
["knee_high_boots", 10],
["boots_combat", 10],
["boots_winter", 60],
["boots_hiking", 10],
["runner_bag", 5],
["flip_flops", 35],
["lowtops", 45],
["dress_shoes", 50],
["dance_shoes", 5],
["heels", 50],
["coat_rain", 50],
["hood_rain", 20],
["jacket_windbreaker", 25],
["wetsuit", 2],
["wetsuit_spring", 2],
["wetsuit_gloves", 3],
["wetsuit_booties", 3],
["wetsuit_hood", 2],
["dive_bag", 3],
["poncho", 15],
["folding_poncho", 5],
["gloves_light", 35],
["mittens", 30],
["armguard_soft", 40],
["armguard_hard", 20],
["legguard_hard", 15],
["gloves_wool", 33],
["thermal_socks", 2],
["thermal_gloves", 2],
["thermal_suit", 2],
["thermal_mask", 2],
["thermal_outfit", 1],
["gloves_winter", 40],
["gloves_liner", 25],
["gloves_leather", 45],
["gloves_fingerless", 20],
["gloves_work", 2],
["bandana", 35],
["scarf", 45],
["knit_scarf", 35],
["long_knit_scarf", 5],
["scarf_long", 2],
["hairpin", 5],
["fc_hairpin", 1],
["barrette", 3],
["hat_cotton", 45],
["hat_knit", 25],
["hat_fur", 15],
["hat_newsboy", 20],
["hat_sombrero", 3],
["helmet_bike", 35],
["helmet_motor", 40],
["touring_suit", 15],
["briefcase", 2],
["mag_tv", 40],
["mag_dude", 40],
["mag_glam", 40],
["mag_beauty", 30],
["mag_news", 35],
["lighter", 60],
["ref_lighter", 2],
["matches", 60],
["extinguisher", 20],
["sm_extinguisher", 10],
["mp3", 18],
["portable_game", 8],
["game_watch", 2],
["usb_drive", 5],
["beer", 35],
["european_pilsner", 25],
["pale_ale", 25],
["india_pale_ale", 25],
["stout", 15],
["belgian_ale", 10],
["imperial_stout", 4],
["cell_phone", 50],
["wristwatch", 15],
["pocketwatch", 5],
["umbrella", 50],
["teleumbrella", 20],
["fish_bowl", 1],
["lsd", 1],
["laptop", 10],
["file", 5],
["eink_tablet_pc", 2],
["mobile_memory_card", 8],
["camera", 3],
["gum", 30],
["caff_gum", 3],
["flask_hip", 5],
["sm_extinguisher", 10],
["atomic_light", 1],
["atomic_lamp", 1],
["dog_whistle", 5],
["pet_carrier",2],
["dogfood", 10],