Open Genhis opened 4 years ago
Well, it turns out that male pilots get correct amount but females don't.
Variable data.to.Resources
is empty for females when onEvaStart()
is called - females don't have any resources associated with them? Yet I can see the propellant in the resource GUI...
Male part type: kerbalEVA
Female part type: kerbalEVAfemaleVintage
That makes sense, I'll see if I can get this fixed in the next day or so
Thanks for the quick response.
In the meantime, I have investigated the problem further and managed to find a workaround. In GameData\Squad\Parts\Prebuilt
, copy kerbalEVAfemale.cfg
to kerbalEVAfemaleVintage.cfg
and change the part name in the copied file. I don't know why it works this way and it's likely that future KSP versions may break this workaround, so a proper fix would be welcome. I don't have any DLC installed if that matters.
Hopefully this information will help you fix the bug.
First, can you send me a log file? Second, I'm very puzzled, looking at a 1.10.1 install, in KSP_1.10.1_dev\GameData\Squad\Parts\Prebuilt there are only two files, kerbalEVA.cfg and kerbalEVAfemale.cfg. So, are you copying kerbalEVAfemale.cfg to a new file called kerbalEVAfemaleVintage.cfg?
and while it makes sense (because they are different internally), I don't see anything in the code which would cause this.
Yes, I copied the female file to the new one and edited the part name to kerbalEVAfemaleVintage
. As far as I know, kerbalEVAfemaleVintage.cfg
is included in Making History DLC, but why is it necessary for the stock game...
Here are the log files. I removed the other mods for the testing purposes. before-fix.txt before-fix-modified.txt after-fix-modified.txt
I modified the code to enable logging and to add more debugging statements.
onEvaStart()
:
else
{
Log.Info("resource: " + resourceName);
foreach(PartResource r in data.to.Resources)
Log.Info(r.ToString());
Log.Info(data.to.RequestResource(resourceName, evaTankFuelMax - (fuelRequest + fuelInEVAPack)).ToString());
Log.Info("after");
if (ShowLowFuelWarning && (!DisableLowFuelWarningLandSplash || !data.from.vessel.LandedOrSplashed))
{
PopupDialog.SpawnPopupDialog(new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), "evafuel2", "Low EVA Fuel!", "Warning! Only " + Math.Round(takenFuel, 2).ToString() + " units of " + HighLogic.CurrentGame.Parameters.CustomParams<EVAFuelSettings>().ShipPropellantName + " were available for EVA! Meaning you only have " + Math.Round(fuelRequest, 2).ToString() + " units of " + resourceName + "!", "OK", false, HighLogic.UISkin);
}
}
onEvaHandler()
:
var kerbalResourceList = data.to.Resources;//.Where(p => p.resourceName == shipPropName);
It may be a KSP bug, but why does it work fine when a female kerbal enters a ship (there is no "Failed to add Resource" error message)?
So, an incorrect amount is taken but a correct amount is returned back.
This issue does not seem to be mod-specific, rather a save-specific one. I have 2 save games which work normally and 2 others which don't. I can't seem to figure out what is causing the issue but every time it doesn't work, an error appears in the log 4 times.
Number
-1511737247
is the same but the second negative number changes. Note that I get a message stating that I am low on fuel which has the correct amount (2 units) but my kerbal still gets 5 units.I have tested it with different mod configurations, adding and removing mods, but nothing has helped.
My mod list:
Please let me know if you want the save games or more log files.