[solved] Why does this cause game to hang?

Place to get help with not working mods / modding interface.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

[solved] Why does this cause game to hang?

Post by aubergine18 »

Solved: It was triggering some broken code (that only ran when fake water existed) in my control.lua

Get's through the data stage no problem, but when I go to generate a new game Factorio hangs...

Code: Select all

-- in data.lua
local waterTypes = { 'water', 'water-green', 'deepwater', 'deepwater-green' }

for _,current in ipairs( waterTypes ) do
  local original = data.raw.tile[current]
  if original then
    local fake = table.deepcopy( original )

    fake.ageing            = original.ageing - 0.0001
    fake.autoplace         = nil
    fake.collision_mask    = { 'ground-tile', 'item-layer', 'doodad-layer', 'resource-layer' }
    fake.name              = 'fake-'..original.name

    data:extend { fake }
  end
end
As autoplace is set to nil on the fake tiles, they should be ignored by map generation, right?
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Post Reply

Return to “Modding help”