drmag
Members-
Posts
8 -
Joined
-
Last visited
Reputation
5 NeutralProfile Information
-
About me
Bottle Rocketeer
-
Re: SOI I've finally gotten around to poking at this project again, and just updated myself on all the new comments. I saw someone do some rough calculations to extract the SOI from orbital parameters; looking through the API, I think we can get the SOI directly fairly easily. From the API documentation: CelestialBody Class [TABLE=class: wikitable] [TR] [TH=bgcolor: #F2F2F2, align: center]Inherits[/TH] [TH=bgcolor: #F2F2F2, align: center]Implements[/TH] [/TR] [TR] [TD]UnityEngine.MonoBehaviour[/TD] [TD]ITargetable, IDiscoverable[/TD] [/TR] [/TABLE] A CelestialBody represents a planet, moon, or star that acts as a source of gravity and has some sphere of influence. You can find the CelestialBody whose sphere of influence you are currently in with the vessel.mainBody field. We should be able to get to it by having another field in KSPSerialIO: // Early on in the code, define a dictionary with all the possible spheres of influence Dictionary<string, int> celestialBodies = new Dictionary<string, int>() { {"Kerbol", 0}, {"Kerbin", 1}, {"Mun", 2}, {"Minmus", 3} // etc. }; // Add a field to the packet definition, maybe force an 8-bit value here? public int SOI; In the packet packing section, add [COLOR=#000000][FONT=sans-serif]KSPSerialPort.VData.SOI = celestialBodies[ActiveVessel.mainBody.name];[/FONT][/COLOR][COLOR=#000000][FONT=sans-serif] [/FONT][/COLOR] I'm a Python guy, not much experience with C#, so I may have done some of this up incorrectly. We'd also have to check to be sure we're getting the correct strings as used in mainBody.name, and perhaps add some logic to include a {"No SOI", -1} pair (what does mainBody.name hold when not in any SOI? Is that even possible in KSP?) Anyone with some C# knowledge want to look into this and see if it works? :: forum is insisting on adding an extra CODE /CODE pair... no idea why. ::
-
Thanks; that actually helped. I tested a clean installation and was able to figure out that the problem was a conflict between Real Fuels and Modular Fuel Tanks; it's not really clear from the descriptions of the two that they're not supposed to be coupled. In any case, I've got it working now!
-
I'm having trouble getting the mod to work; I'm trying to use MKS, Karbonite, TAC Life Support, and RealFuels. When I put a stock tank on, the GUI shows only the following available: Liquid Fuel Oxidizer MonoPropellant XenonGas Food Water Oxygen Waste WasteWater CarbonDioxide Karbonite No Kerosene. With other modules, like Firespitter, I only get LF, Ox, MP, and Xe. Unfortunately, it does modify the Firespitter engines to require Kerosene, which is never available to me, so I can't use it. This is in KSP_x64; is there a bug in the x64, or am I missing something on how to install this?
-
[1.0.X]Engineering Based Tech Tree (with flight first option)
drmag replied to Probus's topic in KSP1 Mod Development
Perhaps I'm misunderstanding where this mod is in development, but were there supposed to be two tree.cfg files in the download? I'd really like to start with winged flight first, but the only tree.cfg that comes in the current download is rockets... Maybe I'm missing something, and you can point me in the right direction. -
Is there a reason the payload length is limited to 255 bytes other than limiting the value of in the header to a single byte? I'm wondering about changing it to a uint16, which would in principle allow payloads of up to 65535 bytes. (Serial transmission rate, sampling frequency, etc. would have to adjust to accommodate, of course.) What I'm thinking is that this mod could resurrect, in part, some of the functionality of the apparently defunct Flight-Recorder (http://forum.kerbalspaceprogram.com/threads/52403-0-21-1-Flight-Recorder); we could add a part that lets us include data from other rocket parts we want to monitor specifically. (Think temperatures of vital pieces for use with Deadly Reentry, or charge rate from solar panels, or monitoring remaining fuel per stage rather than total fuel, etc.) I'm still trying to track down a copy of the original source code from the Flight-Recorder mod. Edit: Found it! Forum won't let me put in the link cleanly, for some reason. http://.....................com/space/modpart-flight-recorder-979.html, domain is at kerbal space parts
-
Yes, my own code, and no, I did mean the ksp packets have errors. I am error checking, and they were all received correctly, so the errors are with ksp, not the serial stream. It does mean some checking may be required if someone wants to build a flight computer or autopilot system, to not react to bad data, but for display purposes it won't even be seen. Thanks again; I'll let you know if I'm successful at forking the code.
-
Yes, that did it. From the demo video you had, it looked as though your screen was responding on loading the game, so I had assumed there would be a handshaking done there too. So far I've been able to get it to handshake (manually sending the handshake packet from another computer) and receive the telemetry data. Thanks so much for this! I expect this isn't something you'd want to do in the base package, but for me it'd be great to include the O2, H2O, food, etc. from TAC Life Support (http://www.curse.com/ksp-mods/kerbal/221022-tac-life-support). I'll start going through the source code when I get a chance, but not having done something like this before, will it be obvious where to modify the packet definition in the dll? Also, just a note, I saved the telemetry to a file and loaded it up in Python to plot it. Looks like there's an occasional error in some of the data; not a big deal, and actually almost desirable from a realism point of view. Here's an example of what I mean: Another note, I noticed the mission elapsed time reset when I dropped the launch stage on this vehicle; is that expected? I haven't done the test with a multi-stage rocket yet, so I don't know if it's a characteristic of dropping to the reentry vehicle only or not.
-
Alright, I'm trying to get this up and running on my system, but I'm not sure if I'm putting the plugin in the right directory. I don't have an Arduino (I prefer the MSP430 myself), but I've put in an FT232R to at least test if the plugin is working. I've tried putting the folder in both $KSP/GameData and $KSP/Plugins and get the same error on loading for both places. Here's the log: ... [LOG 10:54:20.544] Load(Assembly): Plugins/KSPSerialIO/KSPSerialIO [LOG 10:54:20.545] AssemblyLoader: Loading assembly at C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\Plugins\KSPSerialIO\KSPSerialIO.dll [LOG 10:54:20.546] Load(Assembly): Plugins/KSPSerialIO/SerialPort [LOG 10:54:20.546] AssemblyLoader: Loading assembly at C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\Plugins\KSPSerialIO\SerialPort.dll ... ... ... [LOG 10:55:39.886] KSPSerialIO: Loading settings... [LOG 10:55:39.887] Parsing double [LOG 10:55:39.887] Parsing string [LOG 10:55:39.887] Parsing int [LOG 10:55:39.887] Parsing int [LOG 10:55:39.888] Parsing bool [LOG 10:55:39.888] Parsing bool [LOG 10:55:39.888] Parsing bool [LOG 10:55:39.888] Parsing bool [LOG 10:55:39.889] Parsing bool [LOG 10:55:39.889] Parsing bool [LOG 10:55:39.889] Parsing bool [LOG 10:55:39.890] Parsing double [LOG 10:55:39.890] KSPSerialIO: Default Port = COM7 [LOG 10:55:39.890] KSPSerialIO: Refreshrate = 0.08 [LOG 10:55:39.891] KSPSerialIO: BaudRate = 38400 [LOG 10:55:39.891] KSPSerialIO: Handshake Delay = 2500 [LOG 10:55:39.891] KSPSerialIO: Throttle Enable = False [LOG 10:55:39.892] KSPSerialIO: Pitch Enable = False [LOG 10:55:39.892] KSPSerialIO: Roll Enable = False [LOG 10:55:39.892] KSPSerialIO: Yaw Enable = False [LOG 10:55:39.893] KSPSerialIO: Translate X Enable = False [LOG 10:55:39.893] KSPSerialIO: Translate Y Enable = False [LOG 10:55:39.893] KSPSerialIO: Translate Z Enable = False [LOG 10:55:39.894] KSPSerialIO: SAS Tol = 0.1 [EXC 10:55:39.909] NullReferenceException: Object reference not set to an instance of an object I was hoping to at least see KSP start a handshake to tell me it's searching for the Serial Port, but no luck there. I've tried both 015.1 and 015.2 with the same result. Am I putting things in the wrong place? Or is it searching for a specific tag that is only available from an Arduino? (If so, can we please make it more general for those of us who use other hardware?)