Tweaks
3 months ago
2.0
2.20K
Cheats

i Base settings feel cheaty

9 months ago

Hi,

I love the idea of this mod a lot. I really hate everything not laser, especially in the early game, due to having to deal with restocking ammo.

That said, increasing the cost by just 4x feels too cheaty. Could you consider adding a setting that allows for the unlimited version of an Ammo to consume X of the limited version? Personally, I'd set it to 100x or so then, I guess. (Not entirely sure. I considered stack size, but artillery stacks are too small, and bullets on planets are widely spread, and rarely used, while in space it's the opposite, which kinda makes me thinking about special space ammo, but that's certainly out of scope of this mod.)

Also, if you do it, could you consider increasing the weight of the unlimited versions by the same factor, or just plainly make them so heavy they can not be sent to space at all and have to be produced there?

Again, I really love the idea of being able to ignore ammo management altogether, but I think it has to become expensive enough that sometimes using the limited version should be the better option.

Cheers

9 months ago

I just pushed 0.2.3 which give you the option to change the multiplier for recipe cost and craft time. Using 1 means unchanged and max is 100.

Also another checkbox if you want to make the ammo to heavy for shipping of planet into space.

8 months ago
(updated 8 months ago)

My reply from yesterday seems to have gotten lost in the ether somehow. Sorry for the late feedback. :/

I gave it a try and it seems to work. Thanks a lot!

I wanted to make one last suggestion for another change/improvement:

  • The unlimited version recipes should not use the raw materials of the limited version, but the limited version itself as the ingredients.
  • More importantly: The unlimited version of an ammo recipe that uses the previous tier ammo as an ingredient should use the unlimited version of the previous tier ammo.

Example:

  • X is the multiplier from the settings.
  • Unlimited firearm ammo (yellow) should require X firearm ammo instead of 4 * X iron plate.
  • Unlimited armor piercing ammo (red) should require X limited armor piercing ammo and one unlimited firearm ammo instead of 5 * X copper plate, X steel and X firearm ammo.

Motivation:

  • Unlimited ammo of previous tiers that is being replaced can be repurposed/reused.
  • Personally, being unable to reuse something old always feels bad, like a waste.
  • Recycling reduces that feeling somewhat, but not really, due to other mods and low productivity on the unlimited ammo recipes as only hundreds, maybe thousands, but not millions or billions have been produced, the yield from recycling will be ridiculously low, like 0.3% or so.
  • Unlimited ammo use is made slightly more complex if putting it in a rocket is disabled. Intermediates (limited ammo) has to be constructed where the unlimited ammo is being used. (Avoids trivializing ammo especially on space platforms.)
  • Seems like a fair tradeoff due to the perceived peace of mind by unlimited ammo.
8 months ago
(updated 8 months ago)

That thing about missing replies I recognize, In my experience it happens if you spend too much time writing a message and your CRSF-token expires. If you press Submit, you get a tiny message saying so. But in my case I always think the message was sent and continue my day😅

Those are some interesting suggestions and I appreciate the feedback 😊, but I think I'll leave it as it is right now.
Mainly because I feel it would complicate thing and I'm unsure how to fix that. Right now if you don't check Keep original I just modify the original recipes, and when you check it I clone the recipes and modify them, this way it is compatible with many other mods adding their own ammo.

I'm unsure for example how to achieve this without hand crafting recipes for everything.

Unlimited armor piercing ammo (red) should require X limited armor piercing ammo and one unlimited firearm ammo`

8 months ago

As far as TooHeavyForRocket goes, the 10 tons that it is set to assumes the constant data.raw["utility-constants"]["default"].rocket_lift_weight is not modified. That is what defines how much a rocket can lift. The normal setting for that constant is one ton. Code could instead of using a hard-coded value, instead go ammo.weight = data.raw["utility-constants"]["default"].rocket_lift_weight * 10, and that would guarantee that even when the constant is modified, the ammo will still be too heavy for a rocket.

8 months ago

Cool thanks CaitSith2! I'm using that value now in 0.2.4.

8 months ago
(updated 8 months ago)

I adjusted the code to do what I suggested. In case you want to consider to implement it, here it is:

-- Change recipe to require ammo instead of raw ingredients
-- Replace predecessor ammo with unlimited version
for i = #unlimitedRecipe.ingredients, 1, -1 do
    local ingredient = unlimitedRecipe.ingredients[i]
    if data.raw["ammo"][ingredient.name] then
        -- Replace limited ammo with unlimited ammo
        unlimitedRecipe.ingredients[i] = {
            type = "item",
            name = "unlimited-" .. ingredient.name,
            amount = unlimitedRecipe.ingredients[i].amount / costMultiplier
        }
    else
        -- Remove ingredient that is not ammo
        table.remove(unlimitedRecipe.ingredients, i)
    end
end
-- Add the limited ammo as an ingredient
local limited_ingredient = {
    type = "item",
    name = name,
    amount = costMultiplier
}
table.insert(unlimitedRecipe.ingredients, limited_ingredient)

I added it after unlimitedRecipe = transformRecipe(unlimitedRecipe) (at around line 120 in your current version, my line numbers are slightly off, as I added a few comments.
It could easily be wrapped into a setting.

If you would be willing to host your mod as a GitHub Repo, I'd gladly send you a pull request for your convenience, also wrapping it into a setting and doing it properly, not just as a hack.

Two more things:

  • I saw your dump function. Unfortunately, it seems to not be well known that Factorio already includes the Serpent library, which can do this in both directions, render and parse, I've only learned that it is already included when trying to add it manually recently. serpent.block(x) or serpent.dump(x) might be what you need. It can pretty-print the output quite well.
  • local unlimitedRecipe = table.deepcopy(data.raw["recipe"][name]) will not work if a mod author adds an ammo where the recipe and ammo name differ. It's not good practice to do so, but some do. If you want to address that, you'd have to iterate over all recipes to search for those that output the desired ammo. I am not sure it would be a good idea to do so, as it might introduce other issues in mods that might have ammo as side results or such, but at least I wanted to comment on it.

Cheers.

New response