Jump to content

OMICRON - Flying Space Car Development Thread


Climberfx

Recommended Posts

2 hours ago, BGYT said:

cockpit as drone core?

 

Not exactly, the cockpit panel function as a remote core, so when you put the panel, your vessel can control itself.

I don't think we need more cores to the game, besides it would be to big to use in place of the cockpit. Until now, you just put a stock core inside the intake nose of Omicron and you have it. But with the panel, will be a implementation to the cockpit, so you can make missions without pilot to rescue then in a place, for example. Will be other stuff, helpful in the panel, like indication of the angle in your vtol rockets, functional navball, speed, altitude, etc...

 

Edited by Climberfx
Link to comment
Share on other sites

So, i think i did the code for NavBall. but i'm still unable to test yet, cause of the lac of .NET 3.5 framework on OSX. (officially that goes only until 3.1 yet).

So i need a time to go Windows and compile it and test it. But there are no erros in the editor/references. (Visual Basic 2019)

using System;
using UnityEngine;
using KSP.UI.Screens.Flight;

namespace Omicron
{
    public class Omicron : PartModule
    {
        private readonly NavBall myNavball;
        public Transform myNavballTrans;

        [KSPField]
        public String NavBallTransform;

        public void Start()
        {
            myNavballTrans = part.transform.FindRecursive(NavBallTransform);
        }

        public void FixedUpdate()
        {
            myNavballTrans.rotation = myNavball.relativeGymbal;
        }
    }

    public static class Utils
    {
        public static Transform FindRecursive(this Transform transform, String name)
        {
            if (transform.name == name) { return transform; }
            Transform tr = transform.Find(name);
            if (tr != null) { return tr; }
            foreach (Transform child in transform)
            {
                tr = child.FindRecursive(name);
                if (tr != null) { return tr; }
            }
            return null;
        }
    }
}

 

Link to comment
Share on other sites

Updates.

So, i migrate all project to Windows now, Unity, Visual Studio, Maya, etc., and manage to have Visual Studio compilation to work with KSP (1.7.3 yet here). 

I pass yesterday and today breaking my head to learn CSharp, and manage to solve the Navball function.

I'm in the finals for that part of the code, after that, will break head some more for altitude, speed, throttle speed jog, RCS, Comm, SAS, etc. For all functions of the cockpit i have.

Then go back to finish shaders and details for navball, like prograde, retrograde, normal, antinormal, etc icons.

Here how the code are at this moment:

using System;
using UnityEngine;
using KSP.UI.Screens.Flight;

// KSP 1.7.3 e Unity 2017.1.3p1

namespace Omicron
{
    public class Omicron : PartModule
    {
        public NavBall stockNavball;
        private Transform myNavballTrans;

        [KSPField]
        public String NavBallName = "navball_node";

        public void Start()
        {
            if (HighLogic.LoadedSceneIsEditor)
            {
                return;
            }
            stockNavball = FindObjectOfType<NavBall>();
            myNavballTrans = part.transform.FindRecursive(NavBallName);
        }

        public void Update()
        {
            if (HighLogic.LoadedSceneIsEditor)
            {
                return;
            }
            myNavballTrans.rotation = stockNavball.target.localRotation;
            print("Navball: " + myNavballTrans.eulerAngles + " " + myNavballTrans.localEulerAngles);
        }
    }

    public static class Utils
    {
        public static Transform FindRecursive(this Transform transform, String name)
        {
            if (transform.name == name) { return transform; }
            Transform tr = transform.Find(name);
            if (tr != null) { return tr; }
            foreach (Transform child in transform)
            {
                tr = child.FindRecursive(name);
                if (tr != null) { return tr; }
            }
            return null;
        }
    }
}

 

Edited by Climberfx
Link to comment
Share on other sites

Updates:

So, for the code above, it had X and Y axis inverted in rotation, besides the fact all the rest, start angle etc., was running accordingly.

Here i have the right code, some more heating in thinking and prospecting info, i got this, and already tested, navball is working now, in flight.

:D

The Code:

using System;
using UnityEngine;
using KSP.UI.Screens.Flight;

// KSP 1.7.3 e Unity 2017.1.3p1

namespace Omicron
{
    public class Omicron : PartModule
    {
        private NavBall stockNavball;
        private Transform myNavballTrans;

        [KSPField]
        public string NavBallName = "navball_node";

        public void Start()
        {
            if (HighLogic.LoadedSceneIsEditor)
            {
                return;
            }
            stockNavball = FindObjectOfType<NavBall>();
            myNavballTrans = part.transform.FindRecursive(NavBallName);
        }

        public void Update()
        {
            if (HighLogic.LoadedSceneIsEditor)
            {
                return;
            }
            Quaternion attitudeGymbal = stockNavball.navBall.rotation;
            var delta = Quaternion.Inverse(attitudeGymbal);
            delta.z = -delta.z;
            myNavballTrans.localRotation = delta;

            print("Navball Rotation = " + myNavballTrans.eulerAngles + ", Local Rotation = " + myNavballTrans.localEulerAngles + "Delta = " + delta);
        }
    }

    public static class Utils
    {
        public static Transform FindRecursive(this Transform transform, String name)
        {
            if (transform.name == name) { return transform; }
            Transform tr = transform.Find(name);
            if (tr != null) { return tr; }
            foreach (Transform child in transform)
            {
                tr = child.FindRecursive(name);
                if (tr != null) { return tr; }
            }
            return null;
        }
    }
}

 

Edited by Climberfx
Link to comment
Share on other sites

Working on Cockpit open version. Then Crew 1, 2, 3. 

And the separator will be another part, with support for life support (TAC), but this new opened parts will not have TAC resources anymore, give the lac of space.

Annotation 2020-04-19 173738 by Rafael Valle, on Flickr

49794363918_a05a23eab8_h.jpgAnnotation 2020-04-19 184227 by Rafael Valle, on Flickr

49794669283_d2027bf793_k.jpgUntitled by Rafael Valle, on Flickr

Edited by Climberfx
Link to comment
Share on other sites

Panel logic will take some time. Still undecided if going to wait to finish it, or release without it first, but even if i decide to let the panel for later, i have o lot to do on modeling, uvw and texturing for these new parts.

Probably 1 month or so.

At the present i have it all working with 1.9.1 already. If you wanna, i can upload a pre build pack to you download, just wait i finish  cockpit details and crew open variants first. The docking port for the back wait for next.

Let me know.

Link to comment
Share on other sites

Update:

So, i finalize the variants for Wall_closed and Wall_hatch (5 for each), including:

  • Wall_xxxxx_strut_clean
  • Wall_xxxxx_clean_clean
  • Wall_xxxxx_strut_LS
  • Wall_xxxxx_clean_LS
  • Wall_xxxxx_LS_LS

Making it 2 parts with 5 variants for each.

 

Now i'm on the new part: Back_Hatch, that will have 3 variants:

  • Back_hatch_clean
  • Back_hatch_strut
  • Back_hatch_LS

49832472911_071fdc0847_b.jpg

49832472896_39520d18c4_b.jpg

49831935853_a50bb2de95_b.jpg

After finishing this part i go back to UVW and textures of cockpit panel.

 

Edited by Climberfx
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...