DeepPockets


Adds options to change many stack sizes (and fluid capacities). Fork of ReStack to improve compatibility with other mods and add new features

Utilities
3 years ago
0.17 - 1.1
1.80K

g Compatability with Angels/Bobs?

4 years ago
(updated 4 years ago)

Hello Honktown. Are there some issues between DeepPockets and Angels&Bobs mods? I have been having issues getting the stack sizes to affect certain items from Angel's Refining, namely the raw ore, crushed ore, chunks, and geodes. I have adjusted several different startup stack sizes for DeepPockets per the guidelines; ore, smelting result, tile, wall & gate, intermediate product multiplier, raw material, and even raw resources multiplier. Nothing seems to adjust the stack sizes in game though. I still see them as the default 200 stack size. I've tried adjusting the conflict resolution as well, same results though. Am I missing something or does this not work? I had re-stack installed as well, but I have disabled it for now; DeepPockets is the only stack size mod active for the map I'm currently playing.

*edit: I have tried both positive and negative numbers but neither option has produced the desired stack adjustments.

4 years ago
(updated 4 years ago)

A quick look at angelsrefining (one I have already) puts some Angel's stuff in the subgroups "ore-processing-X" where X is a, b, c, d, t0... what a mess. A bunch of the ores from the same mod use "angels-ores". Of course for angels smelting each metal has its own subgroup, so there are like a dozen. I can write a script to handle that, and try to generalize it.

In override.lua (top folder) there is an outline of how the changes are set-up... if you have any mod experience you can play with it yourself. Try copy-pasting this into override.lua, and (if you have angels refining) some of the stuff should change. There is an option to log what is changed in the Mod Options (startup, near the bottom). Turn that on and you can see in the log what is being changed and where a change is coming 'from'.

local extra_subgroups = {
  "ore-processing-a",
  "ore-processing-b",
  "ore-processing-c",
  "ore-processing-d",
  "ore-processing-t0",
}

local stack_data = {
  from = "override",
  category = "item",
  size = 1000,

  search_property = "subgroup"
  search_property_value = ""
}

for _, subgroup in pairs(extra_subgroups) do
  stack_data.search_property_value = subgroup
  SearchByCategory(stack_data)
end
4 years ago

uh oh, item should be in quotes. Or it should be "resources". Will double-check and edit.

4 years ago

Thank you Honktown. I have tried playing around with the override.lua option some but haven't had any success with it yet. I haven't played with modding much in Factorio beyond just general (simple) fixes here and there. I'll keep plugging at it though.

4 years ago

Ooof I am really sorry about this. override isn't loaded. user.lua is. At some point I must have forgotten to remove override, when I switched to "user.lua" being that extra file

4 years ago

Thanks again. Still doesn't seem to work no matter what I try in the user.lua file. I turned logging on earlier, but I'm not seeing anything in the file related to ores. Everything else is in here, just not that one for whatever reason. In game, the only thing I see modding any of the ores is either AngelsRefining or BobsOres>AngelsSmelting.

4 years ago

I'll do a quick check with what Angel's mods I have

4 years ago
(updated 4 years ago)

First, I had a missing comma. If you are not getting an error, it is not loading the files you are changing :D

  search_property = "subgroup" <------ missing comma
  search_property_value = ""

After that, and changing item to "item", it is working fine for me:

...
29.132 Script @DeepPockets/data-final-fixes.lua:10: Setting stack size of angels-iron-nugget from 200 to 1000 because of override
29.132 Script @DeepPockets/data-final-fixes.lua:10: Setting stack size of angels-iron-pebbles from 200 to 1000 because of override
29.132 Script @DeepPockets/data-final-fixes.lua:10: Setting stack size of angels-iron-slag from 200 to 1000 because of override
29.132 Script @DeepPockets/data-final-fixes.lua:10: Setting stack size of angels-ore1-chunk from 200 to 1000 because of override
29.132 Script @DeepPockets/data-final-fixes.lua:10: Setting stack size of angels-ore1-crushed from 200 to 1000 because of override
29.132 Script @DeepPockets/data-final-fixes.lua:10: Setting stack size of angels-ore1-crystal from 200 to 1000 because of override
29.132 Script @DeepPockets/data-final-fixes.lua:10: Setting stack size of angels-ore1-pure from 200 to 1000 because of override
29.132 Script @DeepPockets/data-final-fixes.lua:10: Setting stack size of angels-ore2-chunk from 200 to 1000 because of override
...
29.132 Script @DeepPockets/data-final-fixes.lua:10: Setting stack size of angels-ore9-crystal from 200 to 1000 because of override
29.132 Script @DeepPockets/data-final-fixes.lua:10: Setting stack size of angels-ore9-dust from 200 to 1000 because of override
29.132 Script @DeepPockets/data-final-fixes.lua:10: Setting stack size of angels-ore9-powder from 200 to 1000 because of override
...

There is a faster way to do the searching, but doing it subgroup-by-subgroup isn't causing me any problems. If you have like 1500 items and it's taking a while, then I'd be worried.

This is what I have at the end of user.lua:
local extra_subgroups = {
"ore-processing-a",
"ore-processing-b",
"ore-processing-c",
"ore-processing-d",
"ore-processing-t0",
}

    local stack_data = {
      from = "override",
      category = "item",
      size = 1000,

        search_property = "subgroup",
        search_property_value = ""
    }

    for _, subgroup in pairs(extra_subgroups) do
      stack_data.search_property_value = subgroup
      SearchByCategory(stack_data)
    end

all the indentation is messed up. Not important.

4 years ago

Thank you so very much. That did the trick. If there's any way to support you, let me know.

4 years ago

Are you interested in more items, etc? I could make it official, somehow (a separate add-on maybe, I've been meaning to make the mod have a remote interface).

https://drive.google.com/file/d/1pmpwjdJjmeHCZhAC-d0ZoG50iycZKcBe/view?usp=sharing

https://drive.google.com/file/d/1v7nJBgy9k3JxpdJAheXTi4NYFnOShqoQ/view?usp=sharing

4 years ago

I wouldn't be opposed to such an idea. :)

3 years ago

So... I added some support, and 1.1 version of the mod is now out. Thinking of how to make it a bit more convenient with "overhauling" mods that have a dozen+ new subgroups etc... The most user-friendly thing would probably be to combine groups, so for example, add vanilla and a bunch of modded belts to "belts", combine modded ores into ores, etc.

3 years ago

I'm curious if this mod can alter literally every item to "xxxx" stacks because this how I want to play... my alternative is a mix of ReStack + BigBags + Custom Detailed Stack Sizes(which is outdated I have to update it for myself) then I have finally a peace of mind... every item is 1k max.

3 years ago
(updated 3 years ago)

There are a few simpler mods with one stack size for "everything", but let's see:

    local function doesnt_have_not_stackable(prototype)
        if prototype.flags then
            for _, flag in pairs(prototype.flags) do
                if flag == "not-stackable" then return false end
            end
        end
        return true
    end

    local new_stack_size = 1000
    for category, prototypes in pairs(data.raw)
        for name, prototype in pairs(prototypes) do
            if (prototype.stack_size and prototype.stack_size ~= 1) and doesnt_have_not_stackable(prototype) then
                if prototype.stack_size < new_stack_size then
                    prototype.stack_size = new_stack_size
                end
            end
        end
    end

If you put that in the user file, it will just write everything that is probably fine to stack higher. Any changes greater than that will still pass through without explicitly setting them to 0, but any smaller should be disregarded (a previous compatibility patch). May want to set the soft multipliers to 0 or you could end up with 20k stacks of chips and things

Edit: There, a little protection for stuff that stacks higher already. I remembered space science :P

New response