ModMash


New Planets, Late game enemy, Land Mines, Underground world, Subways, Valkyries, Ore refining, Crash Site Items and Tech Loot, Subspace Transport, Sub-Dimensional Stacking, Biter harvesting. Placeable spawners, Alien Ooze, Ore Enrichments, conversions, Regenerative Walls and Belts, Recycler, Fluid controls, Mini Boiler, Fishing Machine, Mini Loaders. Titanium Walls, pipes and Belts, Biter Neural Toxin, Fish and Ooze juice. This is a modpack for all splinters.

Overhaul
2 years ago
0.16 - 1.1
4.02K

b Addressing item.icon does not always return the value (Resolved)

4 years ago

Error while loading recipe prototype "craft-personal-roboport-equipment" (recipe): Key "icon_size" not found in property tree at ROOT.recipe.craft-personal-roboport-equipment
and
Key "icon" not found in property tree at "ROOT ... modmash-supermaterial-to-angel_ore1.icons[1]

It seems to me that some mods when modifying the resources of other mods slightly break their "description". Or, since the error occurs during the "build" This can be a bug of optimization, for example, premature removal of unnecessary information about an object from memory, which your script will refer to later on. Although I don't think that's the case and it's really about other people's fashion.

Your function described in "types.lua line-287" is turning to the object "item": line-354 icon_size = item.icon_size.
Because there's no information about "icon_size" in the object for some reason. "nil" comes back.
Of course, you can force your own size (icon_size = item.icon_size or 64), but I think it's wrong and will eventually cause graphic distortions, considering that the game uses the "Atlas of textures", we'll just see either a part of the image or capture the extra one.
Or filter objects without "icon_size" and don't turn to them, let them be indelible. This could be a temporary solution.

Bypassing the first error using (icon_size = item.icon_size or 64), I came across the following error.
For an unknown reason, some resources do not contain a link to the texture (icon).
Function "types.lua line-79"
line-92-103
...
icon = false,
icons =
{
{
icon = "modmash/graphics/icons/super-material.png"
},
{
icon = item.icon, -- returns nil
scale = 0.5,
shift = {7, 8}
}
},
...
Setting a condition to force a sprite to be assigned if it is not specified in the object has solved the problem (icon = item.icon or "modmash/graphics/icons/super-material.png"), but it is just a temporary patch.

After the performed manipulations, factorio has started.

There is another mod that works with matter and it does not cause this error, perhaps you will find a solution there:
Krastorio
...\Krastorio_1.4.34\lib\matter-util.lua
line-33: function matter_func.createMatterRecipe(args)

I hope I've been able to make your work on the compatibility of mods a little easier :)

4 years ago

Right so that's fixed. I'll post an update now. I just a check for icon or icons if it's a regular icon do what I was doing otherwise I add all the layers back from the items icons. Ran with Krastorio and Angles.
You seem to know your stuff any reason your not making a mod?

4 years ago

You seem to know your stuff any reason your not making a mod?

If I understand correctly the question: No, I didn't do modifications, except minor fixes for myself.
I'm learning C++ and a little familiar with lua, so I can show a rough direction to solve the problem.

Once again I apologize for my bad English :)

4 years ago

All good. I do c# and only did this because I figured hey why not learn Lua.

4 years ago

Error while loading recipe prototype "craft-personal-roboport-equipment" (recipe): Key "icon_size" not found in property tree at ROOT.recipe.craft-personal-roboport-equipment
Haven't found the fashion that creates the personal-roboport-equipment.
icon_size = item.icon_size or 64, solves the problem.

4 years ago

I can't seem to replicate but I have thrown in an nil check. Test running then upload soon

This thread has been locked.