tn4799 / DynamicMissionVehicles

3 stars 1 forks source link

Mod incompatibilities #15

Open KZumbusch opened 5 months ago

KZumbusch commented 5 months ago

I played a bit more with your mod and it is great to get the multi fruit harvesters for contracts as the Premium DLC harvesters are really annoying to use in single player even with Courseplay and Autodrive installed. But I stumbled over some mod incompatibility issues and added some logging to your code to figure those out.

Although the Precision Farming DLC is listed as an ignored mod, the missionVehicles.xml of Precision Farming is loaded with your custom loadVehicles function. As the Precision Farming DLC includes a custom John Deere sprayer and your code ignores modded vehicles with an empty mod name, the custom sprayer is not added to the spraying contracts. This results in sprayer missions with just the John Deere tractor and weight of the Precision Farming DLC missionVehicles.xml and no sprayer missions for small fields.

A second mod with compatibility issues is FS22_adurante_R200A_crossplay. It comes with its own missionVehicles.xml adding harvest mission vehicle configs with its trailers. As that XML file lacks the variants section, your mod loads the included missionVehicles.xml instead. Therefore there are no missions with the Adurante trailers available.

Is also seems to be the case that your custom loadVehicles function overwrites all existing mission vehicle configurations instead of adding modded mission configurations to the existing configs. This might be needed for compatibility reasons but could result in false error reporting for other mods as those mods might announce custom mission equipment which might not be if your mod is installed loading the included configurations after other mods and DLCs have added theirs.

This log file is from a fresh savegame with all DLCs, the FS22_adurante_R200A_crossplay and the Precision Farming DLC activated on Hobo's Hollow.

log.txt

As the Adurante mod is loaded after the DLCs and is not compatible with your mod, your fallback config is loaded replacing all existing configurations. Therefore there are no DLC vehicles and no Adurante trailers available for missions. The warning messages

Warning: Cannot load missionVehicle that is neither part of the baseGame nor part of a mod.

are for the sprayer in the Precision Farming DLC. As the Precision Farming DLC configurations are loaded with your custom function, all existing sprayer missions are overwritten with the mission configs from the Precision Farming DLC and the sprayer is missing from all of them. There also is a warning message from FS22_BetterContracts about missing sprayer configs for small fields.

tn4799 commented 5 months ago

Thanks for reporting the bug with precision farming. I'm working on a fix for that bug.

For the incompatibility with the adurante mod, I unfortunally have to say that there is no way how I can handle the loading of the xml with basegame vehicles, modded vehicles and dlc vehicles. The adurante pack unfortunally lands in the category of mods, that add their own missionVehicles. but since I had to change the construction of the path to enable the loading of other vehicles than base game vehicles and onces in the mod where the xml is added, those missionVehicle.xml files are unfortunally incompatible because of the missing modname info. And i can't use g_currentModName since the script is run in my mod which results in the wrong modname compared to what would be needed.

KZumbusch commented 5 months ago

Instead of using your own code for loading the missionVehicles of other mods, you could use the same approach as for the DLCs by calling the superFunc to process the file. This way they are loaded by the base game method. And as the deactivation of the base earth fruit missions is still handled after all mod mission vehicles are loaded, it should be fine to have the mods add their own mission configs.

I already fiddled around a bit with your mod's code to figure our a safe way to load other mods' custom mission vehicles, but I haven't found a really safe way yet. I'll keep digging if you don't mind.

tn4799 commented 5 months ago

The only reason why I use my own code to load the mission vehicles is to enable using vehicles of the modFolder and dlc vehicles. This functionality is not supported by the way how giants is loading the missionVehicles. That is the annoying part. If there would be a way to do it with the base game code I would do that. And the only reason why dlcs get a special treatment is because there is no way that a modder would add the needed xml compatibility entries for DynamicMissionVehicles to work.

And since the mod is built primarily with maps in mind, especially with custom fruits so that the missions for there fruit types can be activated, it is needed to be able to refer to other mods since some maps use other mods as harvester vehicles.

But feel free to try and find a way to add the compatibility. If you find one feel free to open a pull request.