BigFood2307 / FS22_AnimalFoodCalculatorIngame

A mod that shows daily and yearly food requirements per pen
4 stars 2 forks source link

Log entry if FS22_EnhancedAnimalSystem is not used: #3

Open vitalii2011 opened 11 months ago

vitalii2011 commented 11 months ago
2023-10-05 13:43 Error: Failed to open xml file 'C:/Users/Mavra/Documents/My Games/FarmingSimulator2022/mods/FS22_AnimalFoodCalculator/../FS22_EnhancedAnimalSystem/xml/eas_settings.xml'.
2023-10-05 13:43 Warning (script): Unknown entity id 0 for 'object' in method 'getXMLString'.
2023-10-05 13:43 LUA call stack:
  =C:/Users/Mavra/Documents/My Games/FarmingSimulator2022/mods/FS22_AnimalFoodCalculator/AnimalFoodCalculator.lua (135) : getXMLString
  =C:/Users/Mavra/Documents/My Games/FarmingSimulator2022/mods/FS22_AnimalFoodCalculator/AnimalFoodCalculator.lua (120) : loadEASXml
  dataS/scripts/utils/Utils.lua (461) : newFunc
BigFood2307 commented 11 months ago

Hi, thanks for the report. I cant replicate the issue right now. My maps load fine without EAS. This function should never be called when EAS is not loaded. Do you not have EAS at all, or do you have an old version without a eas_settings.xml file? I tried to take care of the second option as well, but I might still have some problem there, since I never used such a version.

vitalii2011 commented 11 months ago

I am using EAS version 1.1.0.0. (I did not like the newer versions due to the fact that they began to require too much feed and, accordingly, produced a lot of manure :) ).

BigFood2307 commented 11 months ago

Ok, that makes more sense. Could you change line 130 of AnimalFoodCalculator.lua to if xmlFileId == 0 then and see if that fixes it.

I tought it would be nil, if no file exists, but from your error it looks like it is actually 0 If that works, I will add that change on github.

vitalii2011 commented 11 months ago

Unfortunately, it's still:

2023-10-06 11:36   Info: Loaded navigation cost map from savegame
2023-10-06 11:36 Error: Failed to open xml file 'C:/Users/Mavra/Documents/My Games/FarmingSimulator2022/mods/FS22_AnimalFoodCalculator/../FS22_EnhancedAnimalSystem/xml/eas_settings.xml'.
2023-10-06 11:36 ------------------------------------
2023-10-06 11:36 REA Dynamic Dirt

In principle, this log entry does not bother me (and the game).

BigFood2307 commented 11 months ago

Ok, I will see if I can check for the existance of the file some other way, but I will do that a little later, since it works for now.