Factorio HD Age: Space Age - Base


This mod contains and integrates HD textures for basic entities (e.g. scrap and plants) of the Space Age DLC.

Tweaks
13 days ago
2.0 - 2.1
22.0K
Armor Character Environment Mining

b attempt to index field 'effect_map_layout' (a nil value)

a month ago

47.279 Loading mod factorio_hd_age_space_age_base 2.1.3 (data-final-fixes.lua)
47.283 Error ModManager.cpp:1786: Не удалось загрузить мод "factorio_hd_age_space_age_base": ...torio_hd_age_space_age_base__/prototypes/transitions.lua:67: attempt to index field 'effect_map_layout' (a nil value)
stack traceback:
...torio_hd_age_space_age_base__/prototypes/transitions.lua:67: in function 'load_transitions'
...torio_hd_age_space_age_base__/prototypes/transitions.lua:76: in main chunk
[C]: in function 'require'
factorio_hd_age_space_age_base/data-final-fixes.lua:14: in main chunk
47.319 Loading mod core 0.0.0 (data.lua)
47.699 Checksum for core: 3413833081
47.762 Error ModManager.cpp:1786: Unknown collision layer "item"

a month ago

Что на самом деле происходит. В transitions у stone-path, concrete и refined-concrete теперь четыре элемента, а не три:

water (группа 1)
ribbonia-water (группа 1), лишний элемент, его вставил другой мод
out-of-map (группа 2)
lava (группа 3)

15 days ago

https://pastebin.com/QEFZDHH7

here is some quick fix in transitions.lua

15 days ago

Hi UDaffi,

As the excerpt from your log file shows, the issue lies with version 2.1.3 of the mod. Since the textures were updated in Factorio Experimental Update 2.1.25, please check if the issue persists after installing mod update 2.1.4, which I released yesterday.

15 days ago
(updated 15 days ago)

I’m using the stable version 2.1.24, since the experimental version breaks several more mods.
However, I installed 2.1.15 and after updating the mod to 2.14, I got the same error.

33.226 Loading mod factorio_hd_age_space_age_base 2.1.4 (data-final-fixes.lua)
33.228 Error ModManager.cpp:1786: Не удалось загрузить мод "factorio_hd_age_space_age_base": ...torio_hd_age_space_age_base__/prototypes/transitions.lua:97: attempt to index field 'effect_map_layout' (a nil value)
stack traceback:
...torio_hd_age_space_age_base__/prototypes/transitions.lua:97: in function 'load_transitions'
...torio_hd_age_space_age_base__/prototypes/transitions.lua:107: in main chunk
[C]: in function 'require'
factorio_hd_age_space_age_base/data-final-fixes.lua:14: in main chunk

15 days ago

Okay, so I was on the wrong track because of the time overlap.

Do you get this error message even when you load the HD Age Space Age Base Mod (2.1.3) as the only mod?

Also, it would be great if you could describe what you changed in your Quick Fix. I can't access my development environment right now to compare the code.

14 days ago

As claude sad Ribbonia broke your mod

Исправление: искать переходы по содержимому, а не по индексу.

lua
local function find_transition(list, tile_name)
for , t in ipairs(list or {}) do
for
, to in ipairs(t.to_tiles or {}) do
if to == tile_name then return t end
end
end
end

local function apply(t, spritesheet, layout, effect_map, lightmap)
if not t then return end
t.spritesheet = spritesheet
t.layout = layout
if lightmap then t.lightmap_layout = { spritesheet = lightmap } end
if effect_map and t.effect_map_layout then
t.effect_map_layout.spritesheet = effect_map
end
end

Блок для transitions внутри load_transitions:

lua
local tile = data.raw.tile[name]
local water = find_transition(tile.transitions, "water")
local lava = find_transition(tile.transitions, "lava-hot")
local oom = find_transition(tile.transitions, "out-of-map")

if not settings.startup["f_hd_a_sa_b_disable_water-transitions"].value and foundation then
apply(water, base .. "water-transitions/" .. name .. ".png",
tile_spritesheet_layout_hd.concrete_layout(refined, false, false), concrete_mask)
-- блок transitions_between_transitions[1] пока оставьте как есть
end

if not settings.startup["f_hd_a_sa_b_disable_out-of-map-transitions"].value and foundation then
apply(oom, base .. "out-of-map-transition/" .. name .. "-out-of-map-transition.png",
tile_spritesheet_layout_hd.concrete_layout(false, true, false))
end

if not settings.startup["f_hd_a_sa_b_disable_lava-transitions"].value then
apply(lava, base .. "lava-transitions/" .. name .. "-lava.png",
tile_spritesheet_layout_hd.concrete_layout(refined, false, false), concrete_mask,
base .. "lava-transitions/" .. name .. "-lava-lightmap.png")
end

Остаются transitions_between_transitions. Скорее всего, у них тот же сдвиг индексов, но по логу я этого не вижу, потому что вы выводили только transitions. Чтобы не гадать, добавьте в начало load_transitions короткий вывод:

lua
for i, t in ipairs(data.raw.tile[name].transitions_between_transitions or {}) do
log(name .. " ttt[" .. i .. "] g1=" .. tostring(t.transition_group1) .. " g2=" .. tostring(t.transition_group2)
.. " sheet=" .. tostring(t.spritesheet) .. " effect_map=" .. tostring(t.effect_map_layout ~= nil))
end

14 days ago

Thanks for the explanation — it's a good approach, but there are still some issues with the implementation. I copied your suggested code exactly and tested it in the game, producing the following image.

The transition between lava and Refined Concrete uses only the SD texture, whereas the transitions to water and oil use the HD lava textures.

I'll try to find a solution to this over the weekend.

13 days ago

Hi, I think I've found a good solution.

However, as it's based on my recent code changes for the Factorio 2.1.25 update, I won't be creating a separate update branch for the stable version.
In your case, you can simply replace the transitions.lua with the new file.

New response