Jump to content

linuxgurugamer

Bug Hunter
  • Posts

    24,928
  • Joined

  • Last visited

Everything posted by linuxgurugamer

  1. If you could post the cfg, I'll get it merged tomorrow.
  2. It's taken a bit longer to fix than I thought. I just finished, but haven't had time to do a full test. I hope to get it out by tomorrow eve at the latest.
  3. Good description, I'm adding it right now
  4. If you know C, you should be able to pick up c#. I'd suggest trying it, and ask for help when you need it
  5. Thanks. I'm busy debugging another mod, so am relying on you guys for this
  6. I'm having a very strange problem with onVesselSwitching event. So, to start, here is a class I use for logging: namespace EvaFuel { public static class Log { public enum LEVEL { OFF = 0, ERROR = 1, WARNING = 2, INFO = 3, DETAIL = 4, TRACE = 5 }; static string PREFIX = "EVAFuel: "; [ConditionalAttribute("DEBUG")] public static void Info(String msg) { if (IsLogable(LEVEL.INFO)) { UnityEngine.Debug.Log(PREFIX + msg); } } This is the beginning of the class with the problems: [KSPAddon(KSPAddon.Startup.SpaceCentre, true)] public class EvaFuelManager : MonoBehaviour { private void Start() { Log.Info("Start"); DontDestroyOnLoad(this); } public void Awake() { Log.Info("Awake"); GameEvents.onVesselSwitching.Add(this.onVesselSwitching); } And here is where I'm having problems: void mylog(string s) { // Set a variable to the My Documents path. string mydocpath = @"R:\tmplog.txt"; System.IO.StreamWriter sw = System.IO.File.AppendText(mydocpath); try { string logLine = System.String.Format( "{0:G}: {1}.", System.DateTime.Now, s); sw.WriteLine(logLine); } finally { sw.Close(); } } public string resourceName { get { return HighLogic.CurrentGame.Parameters.CustomParams<EVAFuelSettings>().EvaPropellantName; } } private void onVesselSwitching(Vessel from, Vessel to) { mylog("onVesselSwitching"); Log.Info("onVesselSwitching"); if (to == null || from == null) { Log.Info("to or from are null"); return; } mylog("onVesselSwitching 1"); Log.Info("onVesselSwitching 1"); if (lastPart == null) return; mylog("lastPart not null: " + lastPart.partInfo.title); Log.Info("lastPart not null: " + lastPart.partInfo.title); mylog("onVesselSwitching 2"); Log.Info("onVesselSwitching 2"); mylog("onVesselSwitching: from: " + from.Parts.First().partInfo.title + " to: " + to.Parts.First().partInfo.title); Log.Info("onVesselSwitching: from: " + from.Parts.First().partInfo.title + " to: " + to.Parts.First().partInfo.title); Log.Info("lastPart == data.to"); KerbalEVA kEVA = to.Parts.First().FindModuleImplementing<KerbalEVA>(); if (to.parts == null || to.parts.Count == 0) return; if (from.parts == null || from.parts.Count == 0) return; PartResource kerbalResource = null; PartResource shipResource = null; // When the following return is here (or the following two lines are commented out) no errors. return; kerbalResource = to.parts.First().Resources.Where(p => p.resourceName == resourceName).First(); shipResource = from.parts.First().Resources.Where(p => p.resourceName == resourceName).First(); } What is strange is that I'm getting an error if the last two lines are there, but no error if commented out. The strange part is that NONE of those logging statements are executed when the error occurs, but when the lines are commented out, the logging statements work. Additional strangeness is that if I have a return in front of those lines, no error happens. Originally, those two lines were using: to.Parts from.Parts I added that "mylog" function because I was thinking that there may have been a race condition, and that writing directly to a file would at least show it's being called. I even tried adding a try/catch around those two lines, but didn't make any difference. When I run with the two lines disabled, I see the following: EVAFuel: onVesselSwitching (Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42) EVAFuel: to or from are null When not disabled, the error: Exception handling event onVesselSwitching in class EvaFuelManager:System.TypeLoadException: Could not load type 'System.Func`2' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. at EventData`2[Vessel,Vessel].Fire (.Vessel data0, .Vessel data1) [0x00000] in <filename unknown>:0 (Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42) TypeLoadException: Could not load type 'System.Func`2' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. at EventData`2[Vessel,Vessel].Fire (.Vessel data0, .Vessel data1) [0x00000] in <filename unknown>:0 UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object) UnityEngine.DebugLogHandler:LogException(Exception, Object) UnityEngine.Logger:LogException(Exception, Object) UnityEngine.Debug:LogException(Exception) EventData`2:Fire(Vessel, Vessel) FlightGlobals:setActiveVessel(Vessel, Boolean) FlightGlobals:SetActiveVessel(Vessel) FlightDriver:Start()
  7. Do you have Janitor's Closet installed? If so, did you hide the Squad parts in the mod filter?
  8. Make sure you don't have the option set which limits the eva fuel for the entire mission Also,do you have EVA Enhancements installed? If so, check it as well for the same option
  9. .version is used by the AVC and Mini-AVC mod, to check and report versions. Very useful, and CKAN uses it if available. You can have the file without needed to include any dll. Read about it here:
  10. Probably not. I see it's on Spacedock, if that is what CKAN is using, it will get the version # from Spacedock fairly quickly. Does it have a .version file included?
  11. They probably aren't oriented correctly. Make sure the arrows (V) on the wheels are pointing down
  12. I haven't yet contacted him, but as long as it uses the same modules that his other ones use, it shouldn't be a problem
  13. Mods currently on the list to investigate for adding to Fusebox: Near Future Electrical WildBlue Solar Panels/SSTU Solar Panels Surface Mounted Stock-Alike lights
  14. Actually, could you comment out the first one, and only put it in the 2nd one? Regarding the AB twin turbo, please check the alignment of the standard twin turbo. You should see the same misalignment issue. And yes, it does require a change in the model
  15. Thanks, glad you were able to find it. just so you know, I can reproduce it, but not sure if it's anything that can be fixed. Looks like it may have to do with how close the seats are in the Lark, and not much I can do about that. I'll keep looking into it.
×
×
  • Create New...