Could I get help to fix a mod for personal use?

Place to get help with not working mods / modding interface.
kickbackman1277
Burner Inserter
Burner Inserter
Posts: 18
Joined: Sun Feb 08, 2015 9:14 pm
Contact:

Could I get help to fix a mod for personal use?

Post by kickbackman1277 »

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
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3715
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Could I get help to fix a mod for personal use?

Post by DaveMcW »

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.
kickbackman1277
Burner Inserter
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?

Post by kickbackman1277 »

thank you very much :D
User avatar
jamiechi1
Filter Inserter
Filter Inserter
Posts: 267
Joined: Wed Jan 03, 2018 10:12 pm

Re: Could I get help to fix a mod for personal use?

Post by jamiechi1 »

Just for fun I played around with this.

change data.lua:

Code: Select all

--require("prototypes.decoratives")
require("prototypes.entity")
add control.lua:

Code: Select all

function remove_decoratives()
  game.surfaces[1].destroy_decoratives{}
end

script.on_init(remove_decoratives)
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:

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
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).
Post Reply

Return to “Modding help”