[0.14.22] Variable conflicts when loading different mods
Posted: Tue Mar 28, 2017 9:50 am
I tried loading 2 differents mods which use an internal lua variable with the same name, and there is a conflict during the game initial loading, the second mod uses the variable from the first mod to load its resources.
In my case, I am currently using the Logistic Train Network mod and the WaiTEX mod
For Logistic Train Network 0.9.11
and for WaiTEX 1.2.0
In this case, the variable name is only used to load graphic resources, and since both mods use a different convention for the graphic resource location the game simply fails to load : LTN does not includes the underscores to specify the mod root in the variable, whereas WaiTex does.
But if the variables from one mod are not constrained to the scope of the mod, it could lead to potential hard to decipher bugs.
I don't think this is a mod bug, since both mods work fine separately, and also together when I edit the LTN mod to hardcode the mod root for the resource loading.
In my case, I am currently using the Logistic Train Network mod and the WaiTEX mod
For Logistic Train Network 0.9.11
Code: Select all
MOD_NAME = "LogisticTrainNetwork"
Code: Select all
MOD_NAME = "__WaiTex_Full__"
Code: Select all
if wagon.name == "rail-tanker" then
signal.icon = "__"..MOD_NAME.."__/graphics/icons/rail-tanker.png"
end
VS
stripe =
{
filename = MOD_NAME.."/graphics/entity/accumulator/accumulator.png",
width_in_frames = 1,
height_in_frames = 1
}
I don't think this is a mod bug, since both mods work fine separately, and also together when I edit the LTN mod to hardcode the mod root for the resource loading.