Jump to content

Search the Community

Showing results for tags 'compass'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements
    • Welcome Aboard
  • Kerbal Space Program 2
    • KSP2 Dev Updates
    • KSP2 Discussion
    • KSP2 Suggestions and Development Discussion
    • Challenges & Mission Ideas
    • The KSP2 Spacecraft Exchange
    • Mission Reports
    • KSP2 Prelaunch Archive
  • Kerbal Space Program 2 Gameplay & Technical Support
    • KSP2 Gameplay Questions and Tutorials
    • KSP2 Technical Support (PC, unmodded installs)
    • KSP2 Technical Support (PC, modded installs)
  • Kerbal Space Program 2 Mods
    • KSP2 Mod Discussions
    • KSP2 Mod Releases
    • KSP2 Mod Development
  • Kerbal Space Program 1
    • KSP1 The Daily Kerbal
    • KSP1 Discussion
    • KSP1 Suggestions & Development Discussion
    • KSP1 Challenges & Mission ideas
    • KSP1 The Spacecraft Exchange
    • KSP1 Mission Reports
    • KSP1 Gameplay and Technical Support
    • KSP1 Mods
    • KSP1 Expansions
  • Community
    • Science & Spaceflight
    • Kerbal Network
    • The Lounge
    • KSP Fan Works
  • International
    • International
  • KerbalEDU
    • KerbalEDU
    • KerbalEDU Website

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Skype


Twitter


About me


Location


Interests

Found 2 results

  1. How do I navigate when on the ground, like when I'm driving a rover? Does it help to put the nav ball on surface? How do I know which way I'm going? I tried putting a node on a previous landing site and then setting that as a target, but when I use the autopilot to set it to target, it tends to pull the rover off it's wheels. It seemed happiest when I was driving away from the target even though I'd selected target. Mind you it wasn't 180 degree to the target that I was traveling. It was some other odd angle. I probably should mention I'm at the bottom of Minimus as best I can tell. The south pole. Not the center, but near it. I left my pilot in the rover after breaking off all the solar and running out of electricity and that thing kept picking up speed. It was going about 24 M/sec just before it had some kind of catastrophic problem. This is just on wheel idling power. How do they explain this in a simulator. You've got some kind magic force that propels you across an entire planet with no fuel being used. I dont think it was going downhill. I don't believe that any vehicle would handle as bad as a KSP vehicle on one of these planets. The main question - I landed near a previous landing site. I thought I'd visit the pilot and maybe switch with her and see her rover. I couldn't figure out how to get there. It was only about 5 km. I thought of some complicated, inaccurate ways involving the sun or my current trajectory, but it seems like there should be some simpler way of finding old space wrecks. The rovers behave oddly on the moons. What is the best way to tame this beast? Did I mention that the other day I landed a 100 meter tall rocket on Minimus and it slowly fell over but stayed intact? I then detached the rover and moved it out of the way and eventually got back in the huge rocket and took off from a horizontal position on the surface and made it back to Kerbin. I was close enough to walk to the space center in daylight. The big rocket scraped along and I ran out of gas and had to start up the next stage which gave me a little bit of angle to the ground. Of course on Minimus with a little speed you're going to be airborne for a long time so I got a little more perpendicular and gave it more thrust and pretty soon I was on my way home. I'm going to build a ball shaped cage rover with me and all the vitals on the inside. I'll put wheels all over the outside so that when it hits it'll be partly absorbed by the shocks and I won't have to concern myself with pitch and yaw anymore. If I put more wheels on a rover does it have more horsepower and go faster? Does it have better traction. So far I've been using 4 wheels.
  2. Hello, I am in the process of creating a new mod and I find myself stuck on correctly creating two separate GUI's. The first is very simple as it has a toggle, a horizontal slider and 2 labels all inside of a window and all automatically positioned by using GUILayout.*. The second GUI is actually a compass that I want to display in the game window. I know how to do the rotations for the needle but I don't have much of a clue as to how to begin. I've read through forums, Unity how-to's etc and while they helped somewhat with the first GUI, they offered no help on the second. Here is all of my GUI code: Main Class: GUI_Code.GUI_Draw gdraw = new GUI_Code.GUI_Draw(); private void OnGUI() { gdraw.OnGUI(1); } My GUI Class using UnityEngine; namespace GUI_Code { public class GUI_Draw : MonoBehaviour { public bool toggle = true; public float hSliderValue = 0.0F; public Texture2D icon; private Rect windowRect = new Rect(10, 30, 100, 90); // Texture2D compass; // compass image // Texture2D needle; // needle image // Rect compass_rect = new Rect(10, 10, 200, 200); // create a new rectangle at position (x = 1, y = 10) with size (x = 200, y == 200) // float angle; // angle to rotate the needle // Quaternion rot; // Vector3 axis; // but an axis variable must be provided as well public void OnGUI(int windowID) { // Make a background box GUI.Box(new Rect(10, 10, 150, 90), "1st GUI Menu"); // GUI.DrawTexture(compass_rect, compass); // Vector2 compass_widget_center = new Vector2(compass_rect.x + compass_rect.width / 2,compass_rect.y + compass_rect.height / 2); // find the compass center coordinates // Matrix4x4 svMat = GUI.matrix; // save gui matrix // GUIUtility.RotateAroundPivot(angle, compass_widget_center); // prepare matrix to rotate // GUI.DrawTexture(compass_rect,needle); // draw the needle rotated by angle // GUI.matrix = svMat; // restore gui matrix // Draw all of the buttons inside of the window windowRect = GUI.Window(windowID, windowRect, WindowFunction, "My Window", HighLogic.Skin.window); } public void WindowFunction(int windowID) { // Begin the singular Horizontal Group GUILayout.BeginHorizontal(); // Toggle setup wind_toggle = GUILayout.Toggle(toggle, "Toggle", HighLogic.Skin.toggle); GUILayout.Label("Toggle", HighLogic.Skin.label); // GUILayout.BeginVertical(); // Slider setup hSliderValue = GUILayout.HorizontalSlider(1f, 0f, 10f); GUILayout.Box("Wind Scaling = " + Mathf.Round(hSliderValue), HighLogic.Skin.box); // Compass setup // GUILayout.Label("Direction"); // End the Groups and Area // GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.EndArea(); // This last thing checks whether the right mouse button or middle mouse button are clicked on the window. If they are, we ignore it, otherwise we GUI.DragWindow() // Calling that allows the window to be moved by clicking it (anywhere empty on the window) with the left mouse button and dragging it to wherever you want. if (!Input.GetMouseButtonDown(1) && !Input.GetMouseButtonDown(2)) GUI.DragWindow(); } } } The first GUI is the uncommented lines in OnGUI(int window ID). It has 2 major problems that I don't know how to correct. First, the window isn't draggable even though I make it draggable in the last line of OnGUI(int window). Second, in the Debug.Log, I am getting "[Exception]: InvalidOperationException: Operation is not valid due to the current state of the object" The second GUI is the commented out lines. I am trying to make a simple 2D compass similar to: How do I even go about setting this up and what's wrong with my first GUI? I'll keep looking through forums and Github code but so far, it's been dead ends. Thank you in advance. Also, if you know how to do it, I'd like both the 1st GUI and the compass to be attached to an icon at the right side of the screen. I am assuming that would be a 3rd GUI with just a toggle that did 1st_GUI.show() and compass.show() or 1st_GUI.hide() and compass.hide() (I know the syntax is wrong but you get the idea). Is this the correct way to do this?
×
×
  • Create New...