

pydude
Members-
Posts
27 -
Joined
-
Last visited
Content Type
Profiles
Forums
Developer Articles
KSP2 Release Notes
Everything posted by pydude
-
How to disable patched conics for a vessel
pydude replied to pydude's topic in KSP1 C# Plugin Development Help and Support
Okay, so I've made a little bit of progress. Using this code for (var i = 0; i < vessel.patchedConicRenderer.patchRenders.Count(); i++) { vessel.patchedConicRenderer.patchRenders[i].visible = false; } , I have stopped the conics from rendering. However, there are some problems. First, the conics sometimes flicker in if you zoom in and out in the map view. They only show up for a split second, but for my intended use, this would be a problem. How do I stop this from happening? Second, the orbit lines are not rendering. I don't know how to draw the orbit, but not the encounters. How can do this? -
How to disable patched conics for a vessel
pydude replied to pydude's topic in KSP1 C# Plugin Development Help and Support
@sarbian I believe @Benjamin Kerman is talking about this quote when he says " it is set as a constant in the program.." He wasn't responding to your post. -
How to disable patched conics for a vessel
pydude replied to pydude's topic in KSP1 C# Plugin Development Help and Support
Oh. I'm such a noob at c#. Setting renderEnabled to false doesn't work. It seems to change back to true by itself every frame. I had actually already tried that before starting this thread. I'll have look at some of the other properties, though. -
How to disable patched conics for a vessel
pydude replied to pydude's topic in KSP1 C# Plugin Development Help and Support
@Benjamin Kerman Vessel.PatchedConicsUnlocked apparently doesn't exist . It's listed in the documentation, but doesn't seem to actually be there. 'Vessel' does not contain a definition for 'PatchedConicsUnlocked' and no extension method 'PatchedConicsUnlocked' accepting a first argument of type 'Vessel' could be found (are you missing a using directive or an assembly reference?) Seems odd. I tried patchedConicsUnlocked, too, with a lowercase p. Still no luck. -
How to disable patched conics for a vessel
pydude replied to pydude's topic in KSP1 C# Plugin Development Help and Support
@Benjamin Kerman Did you find anything? Also, what Tracking class are you talking about? -
How to disable patched conics for a vessel
pydude replied to pydude's topic in KSP1 C# Plugin Development Help and Support
@Benjamin Kerman That just changes the control amount. Even if you have no control, the vessel is still tracked, and patched conics are rendered. So that won't work. -
How to disable patched conics for a vessel
pydude replied to pydude's topic in KSP1 C# Plugin Development Help and Support
@Tex_NLYes, I know that, but I need to still be able to control the vessel. Switching doesn't work here. -
How can I disable rendering patched conics for a vessel? I want it to look like before you upgrade the tracking station, with just the grey orbit lines. Examples: (I got the images by taking a screenshot without/with the tracking station upgraded.) I need to be able to switch back and forth between the two modes, so nothing permanent. How can I do this via code?
-
@HebaruSan vessel.DiscoveryInfo.SetLevel(DiscoveryLevels.Owned); does not work for my purposes because that method does not allow changing individual properties. vessel.DiscoveryInfo.trackingStatus.ItemLevel = DiscoveryLevels.Owned; just flat out doesn't work, saying Error CS1061 'KnowledgeItem<string>' does not contain a definition for 'ItemLevel' and no extension method 'ItemLevel' accepting a first argument of type 'KnowledgeItem<string>' could be found (are you missing a using directive or an assembly reference?) The whole reason I'm messing around with this is to try to disable patched conics for the vessel. I'm trying to make it like Tracking Station level 1, with just the grey orbit lines. Do you know of any other ways to do this?
-
Thanks @sarbian, at least I can compile now. But it still is not working. I have changed the code to look like this: using System; using System.Collections.Generic; using System.Linq; using System.Text; using UnityEngine; namespace SignalTracking { /// <summary> /// My first part! /// </summary> public class testMod : Part { protected Rect windowPos; bool g = true; private void WindowGUI(int windowID) { GUIStyle mySty = new GUIStyle(GUI.skin.button); mySty.normal.textColor = mySty.focused.textColor = Color.white; mySty.hover.textColor = mySty.active.textColor = Color.yellow; mySty.onNormal.textColor = mySty.onFocused.textColor = mySty.onHover.textColor = mySty.onActive.textColor = Color.green; mySty.padding = new RectOffset(8, 8, 8, 8); GUILayout.BeginVertical(); if (GUILayout.Button("DESTROY", mySty, GUILayout.ExpandWidth(true)))//GUILayout.Button is "true" when clicked { this.explode(); this.onPartDestroy(); this.Die(); } GUILayout.EndVertical(); //DragWindow makes the window draggable. The Rect specifies which part of the window it can by dragged by, and is //clipped to the actual boundary of the window. You can also pass no argument at all and then the window can by //dragged by any part of it. Make sure the DragWindow command is AFTER all your other GUI input stuff, or else //it may "cover up" your controls and make them stop responding to the mouse. GUI.DragWindow(new Rect(0, 0, 10000, 20)); } private void drawGUI() { GUI.skin = HighLogic.Skin; windowPos = GUILayout.Window(1, windowPos, WindowGUI, "Self Destruct", GUILayout.MinWidth(100)); } private void OnGUI() { if (g) { drawGUI(); // Your current on postDrawQueue code } } protected override void onPartStart() { if ((windowPos.x == 0) && (windowPos.y == 0))//windowPos is used to position the GUI window, lets set it in the center of the screen { windowPos = new Rect(Screen.width / 2, Screen.height / 2, 10, 10); } } protected override void onPartDestroy() { g = false; } } } Also, I might be putting it in the cfg wrong. Do I just go MODULE { name = testMod } , or is that the wrong way to do it?
-
Warning: Absolute n00b here. So, I'm having the following error: Error CS0103 The name 'RenderingManager' does not exist in the current context I can't figure out why this error is happening, I've added UnityEngine and Assembly-CSharp as references. How do I fix this? complete code, if needed: (This is taken from a sample plugin project) using System; using System.Collections.Generic; using System.Linq; using System.Text; using UnityEngine; namespace SignalTracking { /// <summary> /// My first part! /// </summary> public class SelfDestruct : Part { protected Rect windowPos; private void WindowGUI(int windowID) { GUIStyle mySty = new GUIStyle(GUI.skin.button); mySty.normal.textColor = mySty.focused.textColor = Color.white; mySty.hover.textColor = mySty.active.textColor = Color.yellow; mySty.onNormal.textColor = mySty.onFocused.textColor = mySty.onHover.textColor = mySty.onActive.textColor = Color.green; mySty.padding = new RectOffset(8, 8, 8, 8); GUILayout.BeginVertical(); if (GUILayout.Button("DESTROY", mySty, GUILayout.ExpandWidth(true)))//GUILayout.Button is "true" when clicked { this.explode(); this.onPartDestroy(); this.Die(); } GUILayout.EndVertical(); //DragWindow makes the window draggable. The Rect specifies which part of the window it can by dragged by, and is //clipped to the actual boundary of the window. You can also pass no argument at all and then the window can by //dragged by any part of it. Make sure the DragWindow command is AFTER all your other GUI input stuff, or else //it may "cover up" your controls and make them stop responding to the mouse. GUI.DragWindow(new Rect(0, 0, 10000, 20)); } private void drawGUI() { GUI.skin = HighLogic.Skin; windowPos = GUILayout.Window(1, windowPos, WindowGUI, "Self Destruct", GUILayout.MinWidth(100)); } protected override void onFlightStart() //Called when vessel is placed on the launchpad { RenderingManager.AddToPostDrawQueue(3, new Callback(drawGUI));//start the GUI } protected override void onPartStart() { if ((windowPos.x == 0) && (windowPos.y == 0))//windowPos is used to position the GUI window, lets set it in the center of the screen { windowPos = new Rect(Screen.width / 2, Screen.height / 2, 10, 10); } } protected override void onPartDestroy() { RenderingManager.RemoveFromPostDrawQueue(3, new Callback(drawGUI)); //close the GUI } } }
-
Maneuver Node Changing Delta-V
pydude replied to pydude's topic in KSP1 Technical Support (PC, modded installs)
This is not a "core option". In fact, it says "EXPERIMENTAL" right after the option. The mod functions just fine without the option, physics warp is just more like stock (kraken-prone). -
Maneuver Node Changing Delta-V
pydude replied to pydude's topic in KSP1 Technical Support (PC, modded installs)
@Enorats Well, for me it was fixed just by disabling Advanced>Physics Settings>Lossless Physics in the mod's settings. -
Maneuver Node Changing Delta-V
pydude replied to pydude's topic in KSP1 Technical Support (PC, modded installs)
I posted in the mod's forum. -
I have a problem with this mod. It causes my maneuver nodes to function incorrectly. When I create a maneuver node, the delta-v requirements slowly go up. This topic shows what I am talking about. To reproduce: Start a new save. Turn on Lossless Physics in the settings of this mod. Make a vessel for orbiting. Sometime during ascent through the atmosphere, use physics warp for a while. Finish establishing an orbit. Create a maneuver node. Watch as its delta-v requirements go up.
-
Maneuver Node Changing Delta-V
pydude replied to pydude's topic in KSP1 Technical Support (PC, modded installs)
After more testing, I have confirmed it. BetterTimeWarpContinued is the problem mod. Luckily, I had only ~5 mods, so it wasn't too bad to test. It's very odd, though. Even with BetterWarp installed, sometimes the problem takes a while to show up. -
Maneuver Node Changing Delta-V
pydude replied to pydude's topic in KSP1 Technical Support (PC, modded installs)
Crud... I just looked, and the problem is back. This happened after attempting a rendezvous. The exact same problem as above began happening again. I guess I'll have to try a rendezvous after every mod I reinstall. Okay, it seems to happen if BetterTimeWarp is installed. I'll do some more testing and probably post on their forum. -
Maneuver Node Changing Delta-V
pydude replied to pydude's topic in KSP1 Technical Support (PC, modded installs)
Wow... I just uninstalled all my mods, problem solved. Slowly added them back in, testing every time. Finally reinstalled them all... and discovered that the problem was gone! One my mods must have been messed up. However, another problem that I hoped was related to this one stayed. I'll make a new topic to deal with it.