Landfill NEW stone cost


Simple mod to change landfill stone cost to your own (default set 4)

Utilities
2 years ago
1.1
1.36K

i Setting?

2 years ago

Hi! On your info page, you've explained how users can modify your mod to change the amount of stone required for landfill. While that works (kind of -- at least on Linux there is no program called "Notepad", so the more general phrasing "Open it with a text editor of your choice" would be better), it's not really convenient. You could improve your mod by providing a startup setting.

In single player games, this is just a matter of convenience (players wouldn't have to edit the file themselves, but could use the game's interface). However, a setting would be really important for multiplayer games! You can't join an MP game unless your running the same version of Factorio and all mods as the server. But if players try to connect to a server with a changed mod, they will have a different version of it although the version number is the same -- so they can't connect.

2 years ago

Hey
First part was changed as you said
Second part. I dont plan any updates to this mod.
1.Im not skilled enough to create interfeace
2.Theres at least three similir mods, a way more advenced
Mine is as i said in description "simplest" ;)
But if you want, You can edit my source and implement your upgrade. I will add it then as next release

2 years ago

Making settings isn't that hard. :-)

settings.lua:

data:extend({
{
    type = "int-setting",
    name = "LandfillNEWcost",
    setting_type = "startup",
    default_value = 4,
    minimum_value = 1,
},
})

data.lua:

…
ingredients =
{
  {"stone", settings.startup.LandfillNEWcost.value}
},
…

locale/en/en.cfg:

[mod-setting-name]
LandfillNEWcost=Cost of landfill (stone)

[mod-setting-description]
LandfillNEWcost=Enter the amount of stone required to make landfill!
2 years ago

Everyone is a specialist in their own field.
As a mechanic I can said: why people dont replace oil personally. It isn't that hard. :-)

There's some kind of problem in data.lua
/unexpected symbol near char (133)/

2 years ago

Everyone is a specialist in their own field.
As a mechanic I can said: why people dont replace oil personally. It isn't that hard. :-)

Sorry, didn't mean to mock you, "making settings is easy" was in response to " 1.Im not skilled enough to create interfeace". The interface is provided by the game (it's not like a custom GUI, which really is more difficult), a setting just adds to it.

There's some kind of problem in data.lua
/unexpected symbol near char (133)/

OK, perhaps it wasn't clear: "…" is a placeholder. In your original data.lua, keep everything that is before or after the ingredients block Just replace the number of stones with "settings.startup.LandfillNEWcost.value}" and it should work.

By the way: Usually you must make sure that the setting exists and that there is a value that can be used. But in the setting definition, we've already made sure that the setting value will be an integer number (determined by setting type), and we've made sure that it always will have a value (determined by default_value) which is greater than 0 (determined by minimum_value). So in this case it's OK to simply use the setting value.

New response