I'm not sure if this is allowed so my apologies if it isn't im try to get an old mod to work in the current version but I keep getting the following error
Failed to load mods: SingleColorTerrain/data.lua:1: SingleColorTerrain/prototypes/decoratives.lua:2: attempt to index field 'decorative' (a nil value)
stack traceback:
SingleColorTerrain/prototypes/decoratives.lua:2: in main chunk
[C]: in function 'require'
SingleColorTerrain/data.lua:1: in main chunk
stack traceback:
[C]: in function 'require'
SingleColorTerrain/data.lua:1: in main chunk
the mod is: https://mods.factorio.com/mod/SingleColorTerrain
could anyone help/tell me what I have to do to get it working again? thank you
Could I get help to fix a mod for personal use?
-
- Burner Inserter
- Posts: 18
- Joined: Sun Feb 08, 2015 9:14 pm
- Contact:
Re: Could I get help to fix a mod for personal use?
Delete every line that contains data.raw["decorative"].
The mod is trying to remove them, but they have already been removed from the current version of the game.
The mod is trying to remove them, but they have already been removed from the current version of the game.
-
- Burner Inserter
- Posts: 18
- Joined: Sun Feb 08, 2015 9:14 pm
- Contact:
Re: Could I get help to fix a mod for personal use?
thank you very much
Re: Could I get help to fix a mod for personal use?
Just for fun I played around with this.
change data.lua:
add control.lua:
In entity.lua add:
data.raw["tile"]["stuff"].decorative_removal_probability = 1 -- where stuff = dry-dirt,dirt-1,dirt-2, etc.
after each data.raw ... code as shown:
This will insure you don't get decoratives back when you make new dirt to fill a water area.
It would be best for you to wrap all this up in a 'for loop' to shrink this file immensely and to make it easier to fix if you have issues. I'll leave that up to you as a coding exercise.
Also I only fixed the White stuff; and I tested this on a new game (Factorio_1.1.24) and an existing test save I had with only this mod enabled.
Maybe when I have more time I could post the entire mod if that would be helpful to anyone.
And if anyone posts a new version of this please remember to give credit to DellAquilla.
FYI DellAquilla set the license for this mod to Unlicense (public domain).
change data.lua:
Code: Select all
--require("prototypes.decoratives")
require("prototypes.entity")
Code: Select all
function remove_decoratives()
game.surfaces[1].destroy_decoratives{}
end
script.on_init(remove_decoratives)
data.raw["tile"]["stuff"].decorative_removal_probability = 1 -- where stuff = dry-dirt,dirt-1,dirt-2, etc.
after each data.raw ... code as shown:
Code: Select all
data.raw["tile"]["dry-dirt"].variants = tile_variations_template(
"__SingleColorTerrain__/graphics/white.png", "__base__/graphics/terrain/masks/transition-3.png",
"__SingleColorTerrain__/graphics/hr-white.png", "__base__/graphics/terrain/masks/hr-transition-3.png",
{
max_size = 4,
[1] = { weights = {0.085, 0.085, 0.085, 0.085, 0.087, 0.085, 0.065, 0.085, 0.045, 0.045, 0.045, 0.045, 0.005, 0.025, 0.045, 0.045 } },
[2] = { probability = 0.91, weights = {0.150, 0.150, 0.150, 0.150, 0.018, 0.020, 0.015, 0.025, 0.015, 0.020, 0.025, 0.015, 0.025, 0.025, 0.010, 0.025 }, },
[4] = { probability = 0.91, weights = {0.100, 0.80, 0.80, 0.100, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 }, },
--[8] = { probability = 1.00, weights = {0.090, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.025, 0.125, 0.005, 0.010, 0.100, 0.100, 0.010, 0.020, 0.020} },
}
)
data.raw["tile"]["dry-dirt"].decorative_removal_probability = 1
It would be best for you to wrap all this up in a 'for loop' to shrink this file immensely and to make it easier to fix if you have issues. I'll leave that up to you as a coding exercise.
Also I only fixed the White stuff; and I tested this on a new game (Factorio_1.1.24) and an existing test save I had with only this mod enabled.
Maybe when I have more time I could post the entire mod if that would be helpful to anyone.
And if anyone posts a new version of this please remember to give credit to DellAquilla.
FYI DellAquilla set the license for this mod to Unlicense (public domain).