tormentedmage Posted April 12, 2020 Share Posted April 12, 2020 (edited) I need a mod to remove items from the original distribution table. Some people have asked the same question before but unfortunately no answers were given. https://steamcommunity.com/app/108600/discussions/0/1639801448929046416/ https://steamcommunity.com/app/108600/discussions/0/1368380934239576475/ As far as I know,there are no answers on the web now. Does anyone know how to remove items from the game? Edited April 13, 2020 by tormentedmage Link to comment Share on other sites More sharing options...
Maris Posted April 25, 2020 Share Posted April 25, 2020 (edited) You need to add custom function. It may be simple or may be complicated like this one: require "Items/ItemPicker" require "Items/SuburbsDistributions" require "Items/ProceduralDistributions" require "Vehicles/VehicleDistributions" --Duplicate loot chances (or remove loot) local function CopyLoot(old_name, new_name, mult) local cache = {} local function patch(t) for i=#t,1,-1 do if t[i] == old_name then local num = (t[i+1] or 0.01) * mult; if old_name == new_name then t[i+1] = num; --overwrite elseif new_name == 0 then table.remove(t,i) table.remove(t,i) else table.insert(t, new_name) table.insert(t, num) end end end end mult = mult or 1; for room,r in pairs(SuburbsDistributions) do for container,c in pairs(r) do if c.items and not cache[c.items] then cache[c.items] = true patch(c.items) end end end for proc,p in pairs(ProceduralDistributions.list) do if p.items and not cache[p.items] then cache[p.items] = true patch(p.items) end if p.junk and not cache[p.junk] then cache[p.junk] = true patch(p.junk) end end for vehicle,p in pairs(VehicleDistributions) do if p.items and not cache[p.items] then cache[p.items] = true patch(p.items) end if p.junk and not cache[p.junk] then cache[p.junk] = true patch(p.junk) end end end CopyLoot('Thread', 'Thread', 4) -- thread loot x4 CopyLoot('Umbrella', 'Umbrella', 2) -- umbrella loot x2 CopyLoot('Needle', 'MyMod.MySuperNeedle', 0.3) --rare super needle CopyLoot('Needle', 0) --Then remove needle from all loot tables Edited April 25, 2020 by Maris Nebula 1 Link to comment Share on other sites More sharing options...
tormentedmage Posted June 7, 2020 Author Share Posted June 7, 2020 Thank you for the answer and sorry about the late reply. I thought nobody answered the question . I'm sure your answer will be very helpful for many people in the future. Thank you! 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