i posted a topic on the modding interface requests, noting that the use of count and amount should be consistent across prototype and runtime stage.
why was this deleted?
maybe at least send me a pm when you delete my topics
edit:
thanks for moving the topic, but it's more of an api change request, maybe for the next major release you could make the api a bit more consistent.
another thing to make more consistent is the .name field, which returns a prototype on some stuff since recently (been modding 0.16-0.18 and .name was never anything else than a string iirc)
if it's a prototype, like an item, the field could be named .item for example
Inconsistent use of "count" and "amount" in modding api
Inconsistent use of "count" and "amount" in modding api
creator of 55 mods
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
Re: Inconsistent use of "count" and "amount" in modding api
Hi, thanks for the request. I get the frustration of there being naming inconsistencies, but there are a lot of these all over, and in many cases we don't feel it's worth breaking mods for renames like this.
Re: Inconsistent use of "count" and "amount" in modding api
isn't the difference generally that one is integer and the other one decimal?
Re: Inconsistent use of "count" and "amount" in modding api
Not always. Fluids are usually amount, but items are inconsistent. The most prominent example is that minable and placeable_by uses count, while recipe ingredients and products uses amount.Quezler wrote: Wed May 28, 2025 11:15 am isn't the difference generally that one is integer and the other one decimal?
https://lua-api.factorio.com/latest/typ ... html#count
https://lua-api.factorio.com/latest/typ ... html#count
https://lua-api.factorio.com/latest/typ ... tml#amount
https://lua-api.factorio.com/latest/typ ... tml#amount
Re: Inconsistent use of "count" and "amount" in modding api
Hence "generally". I see that specific example more as fluid can take decimals and the Ingredient and ProductPrototype sharing the keyword matters more than the discontinuity of items using amount.Osmo wrote: Thu May 29, 2025 6:48 pm Not always. Fluids are usually amount, but items are inconsistent. The most prominent example is that minable and placeable_by uses count, while recipe ingredients and products uses amount.