Stack Size Fixed


Fixed/Updated version of 'Stack Size' by OpenBulochka. Change items' stack sizes, now with a multiplier and custom formula parsing.

Tweaks
8 days ago
2.0 - 2.1
216
Storage Cheats

i better to use exponentiation instead of multiplication.

14 days ago

It is better to use exponentiation instead of multiplication.

You can do that.

    if item.stack_size < 2000 then
     if use_static then item.stack_size = val_static end -- set static value first

     if use_multiplier then local tmp222= item.stack_size ^ (1 + val_multiplier / 100)
       if tmp222 >= 10 then tmp222 = math.floor(tmp222/10) * 10 end
       if tmp222 >= 100 then tmp222 = math.floor( tmp222 / 100) * 100 end
       if tmp222 >= 1000 then tmp222 = math.floor( tmp222 / 1000) * 1000 end
       item.stack_size = tmp222
      end
    end

Sorry, I don't know lua scripts well, so it's a bit clumsy

14 days ago

yeah, but... what's the actual point of using an exponential? srry but, I rlly don't see it fitting the logic, and besides, no vanilla or modded item even reaches a stack size over 2K by default.

13 days ago

I just modified your mod for myself. It's more convenient to increase the stack of ore and raw resources. And if I increase high-tech products with this coefficient, my logistics are disrupted.
I'm playing with Krastorio 2 + 248k Redux mods. There are scientific packs with a stack size of 10,000. The size becomes too incredible.

13 days ago
(updated 13 days ago)

ahhh, yeah, now i get it.

yeah, the stack size of other mods could become that inflated... huh, you actually got me an idea. what if i add an extra setting for using a custom math expression? so players can play with the stack sizes even more (with some internal limitations, so stack sizes cannot literraly become negative).

in ur case, probably a "log(x)" could work, the string for the expression setting should look like this ...

LOG(x)*10

"x" would be the "base/vanilla" stack size from the game or other mods.

13 days ago
(updated 13 days ago)

will get into that, probably the parsing logic will be the true challenge here.

i could also add another setting, so players can set specific items' stack sizes, that would be even easier.

11 days ago

done. but still, if you want to use your custom modified version of the mod, that's alright.

New response