Asphalt Roads

by Arcitos

Asphalt pavement for increased vehicle speed. Also includes tiles for lane marking (single and double lines) and various hazard areas.

Tweaks
4 years ago
0.14 - 0.18
311

g Incompability with Omnimatter

6 years ago
(updated 6 years ago)

Omnimatter was throwing an error. After talking to Zelos he found out that asphaltroads changed one table.
Quote:

{
{
icon = "omnimatter/graphics/icons/processed-omnicium.png"
},
count = 8,
picture = "AsphaltRoads/graphics/terrain/asphalt/asphalt-inner-corner.png"
}

The two lower lines, he is for some reason adding that to my processed-omnicium, whatfore I do not know :shrug:
the error occures because it is meant to look

{
{
icon = "omnimatter/graphics/icons/processed-omnicium.png"
},
{
icon = "omnimatter/graphics/icons/processed-omnicium.png"
}, {
icon = "omnimatter/graphics/icons/processed-omnicium.png"
},
etc
}<<

and it expects that table constantly but count and picture there are not tables, so somehow it shoves that into icon anyway which would give error anyway<

I'm using a custom modpack. When Asphalt Roads is enabled I get an error in omnimatter. Without enabling Asphalt Roads, the game is loading without any problems

5 years ago
(updated 5 years ago)

I've recently encountered the same error, and it occurs when Omnimatter, Angel's Smelting, and Asphalt Roads are enabled at the same time (I disabled all other mods except those three and their dependencies, and that was the minimal set for Factorio to fail to load on the "processed-omnicium" recipe. I tracked it down to global namespace contamination, specifically func.createTileSetB in prototypes/tile_n2.lua sets a global variable called "ic" and ItemGen::addSmallIcon from the prototypes/recipe-generation.lua in Omnilib (a dependency of Omnimatter, and a function that gets called when the Omnimatter recipes like processed-omnicium are created) uses "ic" as a for loop variable in one branch. I'm not exactly sure how/why only processed-omnicium is getting corrupted with Asphalt Roads data, but commenting out 'require("prototypes.tile_n2")' in Asphalt Road's data.lua or applying the patch below cause the error to go away and Factorio to load properly. I also have a more extensive patch that tries to make all assigned variables in Asphalt Roads (basically everything not declared in a "for" loop or config.lua)

diff -rudpw --strip-trailing-cr AsphaltRoads_1.1.3.old/prototypes/tile_n2.lua AsphaltRoads_1.1.3/prototypes/tile_n2.lua
--- AsphaltRoads_1.1.3.old/prototypes/tile_n2.lua   2018-01-10 02:49:56.000000000 -0800
+++ AsphaltRoads_1.1.3/prototypes/tile_n2.lua   2018-12-21 06:00:46.356265130 -0800
@@ -82,10 +82,10 @@ function func.createTileSetB(tileset, nu

     -- part 1: tile definition
     for k=1, numDirections do
-        thisdir = dirNames[k]
-        nextdir = dirNames[k+1-math.floor(k/numDirections)*k]
-        ic = {} -- inner-corner parameter
-        tilelayer = asphalt_base_layer
+        local thisdir = dirNames[k]
+        local nextdir = dirNames[k+1-math.floor(k/numDirections)*k]
+        local ic = {} -- inner-corner parameter
+        local tilelayer = asphalt_base_layer
         if diagonalTile ~= nil and diagonalTile == true then 
             ic = func.diagonal_value(tileset, thisdir) 
             tilelayer = asphalt_priority_layer
5 years ago

Hi kira78, i just had the time to check this issue and you're right: The declaration of some of the variables as global seem to be the cause of the problems. At the time i wrote this code, i was unaware that in data stage global variables are shared among all mods. I changed the declarations accordingly and hope, that this will fix this problem.

New response