Jump to content

SquirrelMan

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by SquirrelMan

  1. Does anyone know how to use IPreFlighCheck? I created a class that inherits from it, and it seems straight forward, but I have no idea how to add this to the list of default preflight checks. I am trying to "capture" the launch button click and add a couple of checks before allowing the launch. Is there a better way to do this?
  2. You didn't say if it's a manned vessel or not. If its only a probe, check to see if you still have ElectricCharge. If that runs out on a probe, nothing works. The other thing that used to happen to me is that I was still time warped. Controls don't respond if you are over 1x.
  3. Ok, so I couldn't get my code to work no matter what I tried, but I downloaded and studied TacPartLister and TacLib and I got something to work following that code. Thank you so much, TaranisElsu. I greatly appreciate the help. On a side note, when I first added your code, it wouldn't load at all. I had to re-target my library to .Net 3.5 and then it loaded fine. For some reason, on .Net 4.5, which is the default for Visual Studio 2012, I was getting assembly load errors. Does KSP have an official .Net target platform that I should make sure I use?
  4. Thank you both for your helpful hints. First, I'm sure its my mod as its the only one I have installed on this instance of KSP. I made a separate copy of KSP and deleted all other mods, and about half of the SQUAD parts as well for fast loading. Everything is fine if I take out my mod. The only reason I was using GUI instead of GUILayout was lack of knowledge. Thank you for the pointers. Having read up on them now, I believe I understand the difference much better. Unfortunately, I tried changing that and it didn't help. I will take a look at TacPartLister and see if I can figure anything out. It's very strange.
  5. Ok, so I'm new to Unity development, and I can't figure out what I'm doing wrong. I have the following code: [KSPAddon(KSPAddon.Startup.EditorVAB, false)] public class Class1 : MonoBehaviour { bool inQ = false; public void Awake() { print("awake"); } public void Start() { print("Starting the test mod"); } public void OnGUI() { if (!inQ) { RenderingManager.AddToPostDrawQueue(0, DrawGui); inQ = true; } } public void DrawGui() { var r = new Rect(300, 50, 200, 200); GUI.Window(0, r, FillWindow, "Test Window"); } public void FillWindow(int windowID) { GUILayout.BeginVertical(); if (GUI.Button(new Rect(20, 20, 50, 50), "Push")) { print("Button pushed"); } GUILayout.EndVertical(); } } It displays a small window with a button exactly as desired. However, in the VAB, when I hover over a part, the tooltip window is blank and I get a message in the log that says "ArgumentException: Getting control 0's position in a group with only 0 controls when doing Repaint Aborting". It appears that somehow my plugin is interfering with the VAB tooltip window. Any ideas? I've tried looking at the code for both Kerbal Alarm Clock, and Engineer Redux and, while I'm not nearly as complex, am trying to follow the same pattern. Any help is greatly appreciated.
  6. So, I have about 200 hours into the game and just found out that I can click on the launchpad to launch from the KSC overview. I always went into the VAB and loaded and rocket and then hit launch. This also helps because it reminds me to add Kerbals to some of my modules before launch, which I always forget to do from the VAB.
  7. I also encountered the NaN issue, but it seems to have caused a bigger issue as well. I switched to a science lab to get my science points and the whole game crashed (Kraken attack). Now, when I go to KSC and the Science building, my Science points for the game just say "Nan". This means I get "infinite" points and can buy any technology, but its also really annoying. Would your fix reset my total science points, or does anyone know how to manually reset them (even to 0) in the persistent file? I have about 50 hours invested in this particular game and was about 3 technologies from the end. I also get NaN on my retrofit points, but I assume this is all related. FYI, thanks for an awesome mod. Loving it!
×
×
  • Create New...