Jump to content

uberk

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by uberk

  1. Because of the horrible misspellings. I mean, they have to revisit the code anyway, it's leaking memory badly.
  2. I'm using a pedal as a continuous throttle input (as opposed to the incremental throttle). When the pedal is completely released, the throttle drops to (near) 0%, as expected. When the pedal is completely depressed, the throttle rises to 100%, also as expected. However, the deadzone appears to be applied in the middle of the range, instead of at the ends. When applying continuous force, the throttle rises until it reaches the deadzone limit, then it jumps to and stays at 50% thrust. Continuing to apply force, it stays at 50% until you reach the upper bound of the deadzone, and then continues rising to 100%.
  3. Okay, so it looks like it's TemperatureGagueSystem (not a typo). It doesn't expose any static methods, so I'm not sure how to find out if it's on. Is there any way to figure out how to access the instance of it? - - - Updated - - - ...And because no one could possibly be tired of me updating my own threads, here's the answer: I'm an idiot, TemperatureGagueSystem.Instance is static. You can check the state using TemperatureGagueSystem.Instance.showGagues. I expect that'll change on a future patch.
  4. I asked this in another unrelated thread, but it may have gotten buried... Anyway, how can I figure out whether the temperature gauges are enabled? They're the ones you turn on and off with F10 and currently have memory leak issues. I can't find anything in PhysicsGlobals that seems correct, which is where I'd expect it to be.
  5. PhysicsGlobals got me everything except the temperature gauges, the ones you turn on and off with F10. Is that somewhere else? Or am I blind? (I figured it was PhysicsGlobals.ThermalDataDisplay, but that doesn't seem to be it.)
  6. I'm unfamiliar with how to programmatically access UI elements, and I'm not finding much in the docs. Is there a way to detect whether the navball is currently open? Edit: Same question, but for overlay elements, like the temperature gauges, temperature overlay, aerodynamic forces overlay, etc. Just point me in the right direction to start looking, I'll probably figure out it.
  7. Huh, interesting, I wouldn't have thought to try that. Still, I'd like this to be easily distributable, so I went with hacky-but-standard file-based IPC instead of named pipes. Thanks for digging into the DLL, it's very helpful to understand how everything works.
  8. Close, but nope. PlayerSettings.apiCompatibilityLevel is a component of UnityEditor, which is only accessible in the actual Unity editor mode. You can't access it after compilation.
  9. Sorry, I don't want to confuse the issue, so here's how (I'm pretty sure) everything works. Unity uses Mono, which is a .NET compatible library developed by Xamarin, not strictly tied to Microsoft's .NET framework. Xamarin has chosen what features of .NET to recreate and implement. Any code you write will look and feel like .NET, but under the hood it's Mono. All the library linking happens at runtime, so even if you think you're using Microsoft's libraries, Mono's are being swapped in instead. Meanwhile, Unity has various compatibility levels. Basically, they decided on a subset of Mono classes that most games will want to use, and made the rest optional. They did this cut down on load time and size. The core functions are (confusingly) called ".NET 2.0 Subset", while the extended functions are called ".NET 2.0". The version numbers don't really mean anything, it's just the name they went with when they built the editor. Games use the core subset by default, unless you specifically configure Unity to use the full suite. Mono itself implements various different .NET functions, but not all of the features from either .NET 4.0 or .NET 3.5, which is why there's so much confusion about what library version to target. As far as I can tell, it doesn't matter what you choose, so long as you're only using classes that exist in the version of Mono used by KSP. The full list of Mono classes used by Unity, and the API compatibility level that exposes them, can be found here: http://docs.unity3d.com/410/Documentation/ScriptReference/MonoCompatibility.html So, my actual problem: I don't know how to tell what compatibility level KSP was compiled with. If it uses the ".NET 2.0 Subset" suite, I'm totally out of luck, because named pipes are not included in that level. There's an ApiCompatibilityLevel enumeration under UnityEditor, but I can't find any reference to the compatibility level that I can query at runtime. Please correct me if I've made an mistakes, I'd hate to muddy the waters even more, and I've only been at this for two days.
  10. I'm trying to use a System.IO.Pipes.NamedPipeServerStream to do some interprocess communication between my KSP plugin and another application running on my box. Doing that, I'm getting this error: [Exception]: TypeLoadException: Could not load type 'System.IO.Pipes.NamedPipeServerStream' from assembly 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. In Visual Studio, I've tried targeting both versions of .NET Framework 3.5 (vanilla and Client Profile) to no avail. System.IO.Pipes.NamedPipeServerStream was new in .NET 3.5, so it should be supported OK. Am I failing to set up my plugin properly? I can't imagine having to do anything special to include standard System libraries. Could this evidence of more forbidden namespaces? (I know, I know, jumping right to the worst possible conclusion...) Here's my plugin in its entirety, there's absolutely nothing special going on besides the pipe: using System;using System.IO; using System.IO.Pipes; using UnityEngine; namespace KSPSBC { [KSPAddon(KSPAddon.Startup.MainMenu, false)] public class KSPSBC : MonoBehaviour { public void Awake() { } public void Start() { print("Attempting to create NamedPipeServerStream object..."); using (NamedPipeServerStream pipeServer = new NamedPipeServerStream("testpipe", PipeDirection.Out)) { print("Success!"); } } } } - - - Updated - - - Hmm, this might be a Unity issue... According to this help request, "Unity deliberately removes some of the less commonly-used classes from the Mono library to reduce the memory and storage requirements of the game. In the Player Settings (menu: Edit > Project Settings > Player) you will find a setting called API Compatibility Level in the Other Settings panel. If you set this to .NET 2.0 instead of .NET 2.0 Subset, you will get all the Mono classes that Unity implements. The Pipes class is implemented in Unity, so you should be OK after you change this setting." Is there any way to figure out what compatibility level KSP was compiled with?
  11. I just started looking into KSP modding, so forgive me if this common knowledge, I haven't been able to find any examples of what I'm trying accomplish. All the tutorials I've involve binding code to new parts that you add to a vessel. I'd like to create a plugin that runs regardless of whether it's bound to a part. Are there any examples of that anywhere? Context: I wrote a C# software controller for a joystick with light-up buttons. I'd like to be able to figure out what buttons to light up based on the current state of the game. For example, the "Toggle SAS" button on the joystick could light up when SAS is enabled on the active vessel. Further, I'd like to detect when the user is in the VAB, so I can dynamically change the joystick's button bindings. I'd like the plugin to work without having to explicitly add a part to the ship. Is this possible? Thanks! - - - Updated - - - And one more search answered my question.... [KSPAddon(KSPAddon.Startup.MainMenu, false)] public class YourPlugin: MonoBehaviour { public void Awake() { } public void Start() { print("Holy Sh*t the plugin started correctly!!"); } } - - - Updated - - - One more followup, are there any blacklisted libraries anymore? The wiki mentioned System.IO used to blacklisted, and I need a System.IO.Pipe for the interprocess communication to my joystick controller.
  12. I just picked up one of these controllers pretty cheap, looking to use it for KSP too. Have you done any more work on it? Does it use a custom .cs file for the driver controller, and if so, would you mind sharing it? Thanks for putting this up, it looks great!
×
×
  • Create New...