Jump to content

pydude

Members
  • Posts

    27
  • Joined

  • Last visited

Everything posted by pydude

  1. 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?
  2. @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.
  3. 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.
  4. @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.
  5. @Benjamin Kerman Did you find anything? Also, what Tracking class are you talking about?
  6. @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.
  7. @Tex_NLYes, I know that, but I need to still be able to control the vessel. Switching doesn't work here.
  8. 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?
  9. @HebaruSanThat did not work either. It changed the ship's icon to the question mark, but patched conics were still rendered. And, obviously, the icon should not change. Any other ideas?
  10. @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?
  11. @TheRagingIrishmanActually, I already tried this. It just says the same thing except "cannot convert type 'string'" instead of 'int'. vessel.DiscoveryInfo.trackingStatus is a type "KnowledgeItem<string>", but I have no idea how to use one.
  12. How can I change discoveryInfo.trackingStatus? I assume that this the relevant property. If I do vessel.DiscoveryInfo.trackingStatus=1; for example, it says Error CS0029 Cannot implicitly convert type 'int' to 'KnowledgeItem<string>' How do I actually change this?
  13. @sarbianI want to do this for a vessel. discoveryInfo seems to be for asteroids, not ships. Are there ways to disable patched conics for vessels?
  14. @sarbian Thanks! Finally my mod actually does something! Another question, however: How can I disable patched conics altogether? To make it look like before you upgrade the Tracking Station, just the grey lines?
  15. @Sarbian Thanks for that tutorial. The one I was using was 5 years old! Now, I have a few questions. 1. What is the scene for the map view? The one that comes up when you press "m" during flight. 2. How can I get the current CommNet signal strength of the active vessel? Thanks.
  16. 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?
  17. 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 } } }
  18. 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).
  19. @Enorats Well, for me it was fixed just by disabling Advanced>Physics Settings>Lossless Physics in the mod's settings.
  20. @Raphaello Oh. I guess I should probably check farther back before posting. Thanks, though, now I know how to fix the problem.
  21. 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.
  22. 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.
  23. 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.
  24. 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.
×
×
  • Create New...