My findings from this adventure:
In standard animation_set = { ... }
you can use layers = { { stuff 1 }, { stuff 2 } } and so on to declare multiple different graphics for a single entity.
An entity that uses a sheet = { ... } such as underground belts
is a different story, but thankfully not difficult to adapt for multiple graphics.
instead of sheet = { ... } just use sheets = { ... }
this should have been apparent to me as it follows the same standard as icon / icons
The next big find was that Factorio by default crops empty space on spritesheets. I was having issues with my belt tint masks being displaced and that threw me off...but my tint mask graphic was just little arrows in a void of alpha emptiness and Factorio was doing it's job. The two solutions to this problem are to
A) Account for this and use shift = { x, y }
or
B) Declare flag = { "no-crop" } to stop Factorio from cropping alpha
In some instances the shift is probably the better thing to use, but since my graphics were already made so that everything would be layered perfectly the no-crop method was my choice.
Hopefully this helps someone else down the road! ...also I know it isn't a quote but it sticks out better this way.
I'm trying to make new graphics for the belts from UltimateBelts. The mod from Pankeko that updated the graphics just didn't do it for me as the color of the base belts themselves was different. Anyways. I've managed to get transport belts and splitters recolored using tint masks, but for the life of me I cannot figure out how to get underground belts to cooperate.
I'm getting this error:
Error loading mods
Failed to load mods: Error while loading entity prototype "original-ultimate-underground-belt" (underground-belt): Value must be a dictionary in property tree at ROOT.underground-belt.original-ultimate-underground-belt.structure.direction_in.sheet
I have a separate lua file setting colors and establishing belt animations. The script for one of the underground belts is here, the rest are identical apart from names and variables that reference tint colors and belt animation sets from the other file.
Code: Select all
data:extend(
{
{
type = "item",
name = "original-ultimate-underground-belt",
icons = {
{
icon = "__zenultimaterecolor__/graphics/icons/underground.png",
icon_size = 32,
},
{
icon = "__zenultimaterecolor__/graphics/icons/underground-mask.png",
icon_size = 32,
tint = t5,
},
},
icon_size = 32,
subgroup = "belt",
order = "b[underground-belt]-h[ultimate-underground-belt]",
place_result = "original-ultimate-underground-belt",
stack_size = 50
},
}
}
{
type = "underground-belt",
name = "original-ultimate-underground-belt",
icons = {
{
icon = "__zenultimaterecolor__/graphics/icons/splitter.png",
icon_size = 32,
},
{
icon = "__zenultimaterecolor__/graphics/icons/splitter-mask.png",
icon_size = 32,
tint = t5,
},
},
icon_size = 32,
flags = {"placeable-neutral", "player-creation"},
minable = {hardness = 0.2, mining_time = 0.5, result = "original-ultimate-underground-belt"},
max_health = 600,
corpse = "small-remnants",
max_distance = 50,
underground_sprite =
{
filename = "__core__/graphics/arrows/underground-lines.png",
priority = "high",
width = 64,
height = 64,
x = 64,
scale = 0.5
},
underground_remove_belts_sprite =
{
filename = "__core__/graphics/arrows/underground-lines-remove.png",
priority = "high",
width = 64,
height = 64,
x = 64,
scale = 0.5
},
resistances =
{
{
type = "fire",
percent = 60
},
{
type = "impact",
percent = 30
}
},
collision_box = {{-0.4, -0.4}, {0.4, 0.4}},
selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
animation_speed_coefficient = 32,
belt_animation_set = t5_belt_animation_set,
fast_replaceable_group = "transport-belt",
speed = 0.9375,
structure =
{
direction_in =
{
sheet =
{
{
filename = "__zenultimaterecolor__/graphics/entities/low/underground.png",
priority = "extra-high",
width = 96,
height = 96,
y = 96,
hr_version =
{
filename = "__zenultimaterecolor__/graphics/entities/high/underground.png",
priority = "extra-high",
width = 192,
height = 192,
y = 192,
scale = 0.5
}
},
{
filename = "__zenultimaterecolor__/graphics/entities/low/underground-mask.png",
priority = "extra-high",
width = 96,
height = 96,
y = 96,
tint = t5,
hr_version =
{
filename = "__zenultimaterecolor__/graphics/entities/high/underground-mask.png",
priority = "extra-high",
width = 192,
height = 192,
y = 192,
scale = 0.5,
tint = t5,
}
}
}
},
direction_out =
{
sheet =
{
{
filename = "__zenultimaterecolor__/graphics/entities/low/underground.png",
priority = "extra-high",
width = 96,
height = 96,
hr_version =
{
filename = "__zenultimaterecolor__/graphics/entities/high/underground.png",
priority = "extra-high",
width = 192,
height = 192,
scale = 0.5
}
},
{
filename = "__zenultimaterecolor__/graphics/entities/low/underground-mask.png",
priority = "extra-high",
width = 96,
height = 96,
tint = t5,
hr_version =
{
filename = "__zenultimaterecolor__/graphics/entities/high/underground-mask.png",
priority = "extra-high",
width = 192,
height = 192,
scale = 0.5,
tint = t5,
}
}
}
},
direction_in_side_loading =
{
sheet =
{
{
filename = "__zenultimaterecolor__/graphics/entities/low/underground.png",
priority = "extra-high",
width = 96,
height = 96,
y = 96*3,
hr_version =
{
filename = "__zenultimaterecolor__/graphics/entities/high/underground.png",
priority = "extra-high",
width = 192,
height = 192,
y = 192*3,
scale = 0.5
}
},
{
filename = "__zenultimaterecolor__/graphics/entities/low/underground-mask.png",
priority = "extra-high",
width = 96,
height = 96,
y = 96*3,
tint = t5,
hr_version =
{
filename = "__zenultimaterecolor__/graphics/entities/high/underground-mask.png",
priority = "extra-high",
width = 192,
height = 192,
y = 192*3,
scale = 0.5,
tint = t5,
}
}
}
},
direction_out_side_loading =
{
sheet =
{
{
filename = "__zenultimaterecolor__/graphics/entities/low/underground.png",
priority = "extra-high",
width = 96,
height = 96,
y = 96*2,
hr_version =
{
filename = "__zenultimaterecolor__/graphics/entities/high/underground.png",
priority = "extra-high",
width = 192,
height = 192,
y = 192*2,
scale = 0.5
}
},
{
filename = "__zenultimaterecolor__/graphics/entities/low/underground-mask.png",
priority = "extra-high",
width = 96,
height = 96,
y = 96*2,
tint = t5,
hr_version =
{
filename = "__zenultimaterecolor__/graphics/entities/high/underground-mask.png",
priority = "extra-high",
width = 192,
height = 192,
y = 192*2,
scale = 0.5,
tint = t5,
}
}
}
},
back_patch =
{
sheet =
{
filename = "__base__/graphics/entity/underground-belt/underground-belt-structure-back-patch.png",
priority = "extra-high",
width = 96,
height = 96,
hr_version =
{
filename = "__base__/graphics/entity/underground-belt/hr-underground-belt-structure-back-patch.png",
priority = "extra-high",
width = 192,
height = 192,
scale = 0.5
}
}
},
front_patch =
{
sheet =
{
filename = "__base__/graphics/entity/underground-belt/underground-belt-structure-front-patch.png",
priority = "extra-high",
width = 96,
height = 96,
hr_version =
{
filename = "__base__/graphics/entity/underground-belt/hr-underground-belt-structure-front-patch.png",
priority = "extra-high",
width = 192,
height = 192,
scale = 0.5
}
}
}
},
},
}
)