#Adding the same fill type with different XML parts in two mods causes conflicts

1 messages · Page 1 of 1 (latest)

queen elbow
#

In short:

If a mod adds a fill type including a texture, and a second mod adds the same fill type, but without a texture, the game produces invalid paths like C:/mods/FS25_modB/C:/mods/FS25_modA/path/to/texture.png.

Smallest possible reproducer:

Load the game with the two attached dummy mods.

  • The first one adds a new fill type MY_WHEAT and - for simplicity - reuses base game textures.
  • The second one defines the same fill type, but changes only the price
  • When loading into the map, you will see several errors and warnings in the logs where for example $data/fillPlanes/wheat_diffuse.png was transformed into C:/.../FS25_modB/data/fillPlanes/wheat_diffuse.png which does not exist.

Impact

Several modders have already received mod conflict reports for mods on the modhub. The issue was also detected when combining the current development version of Maize Plus with the Straw Harvest pack

Reason

In FillTypeDesc.lua, texture (also pallet and hud icon) paths are loaded from the XML using the current value as a default value. If the XML file does not contain the entry, the function will prepend the base directory to the default value:

self.layerTextures.diffuseMapFilename = xmlFile:getValue(key .. ".textures#diffuse", self.layerTextures.diffuseMapFilename, baseDirectory)

Possible fix

One possible way to fix this would be

self.layerTextures.diffuseMapFilename = xmlFile:getValue(key .. ".textures#diffuse", nil, baseDirectory) or self.layerTextures.diffuseMapFilename

but you might also find a way to fix this in the xmlFile:getValue function so you don't have to change all the calls to it

devout plover
#

Issue has been fixed, should not cause these issues anymore. If there still are issues, please report them in the bugreport tool.

#

!bugreport