Jump to content

Moding the navball


_Rade

Recommended Posts

Yesterday I tried to modify the texture for the navball, and after some digging trough the SQUAD files I've found two texture files which are used for the navball:

\Kerbal Space Program\GameData\Squad\Props\NavBall\model002.mbm ---> I think this one is used for the default navball when you're viewing the ship from the outside

\Kerbal Space Program\GameData\Squad\Props\IVANavBall\IVANavBall.mbm

Anyway after converting and modifying these two files I've started the game to see if the changes I've made will work, and the IVA navball worked just fine while the other one stayed the same. I've even tried to make a new folder in the GameData and place the moded files there, while I also deleted the original file, and the navball still stayed the same while the IVA moded texture worked just fine.

IxiNRKwl.png

nyqnPNLl.png

I'm guessing that there is either some other file I have to edit, or there is something else I need to do in order to get the modified file to work. I would like some help in figurin this out.

Also while I'm at it one other thing I would like to change is to add those two black crosshair lines you have on the navball while in the IVA view to the other navball. But so far I've been unable to locate the texture file used for that part of the UI.

Link to comment
Share on other sites

Thanks allot, it seems to be working just fine with the 0.90. I should have guessed that there would already be a mod for this.

fmQOmqBl.png

Now I just have to figure out is there any way to add those two crosshair lines to the navball when you're not using the IVA view.

Link to comment
Share on other sites

If you're not opposed to digging into that addon's code and adding a bit, it's fairly straightforward. The tint on the NavBall is actually a plane positioned in front of an unlit textured sphere. If you clone that plane, you can swap its texture with something else. Reposition slightly on z axis so they're in the right draw order and voila, you've got your crosshair:

eykUj.png

_navball = GameObject.FindObjectOfType<NavBall>();

var shading = _navball.transform.Find("shading");

var overlay = Instantiate(shading.gameObject) as GameObject;

var crosshairTexture = ResourceUtil.LocateTexture("crosshair", true);
if (crosshairTexture == null) Log.Error("couldn't find crosshair");

overlay.transform.position = shading.position;
overlay.transform.Translate(new Vector3(0f, 0f, -.005f), Space.World);
overlay.renderer.material.mainTexture = crosshairTexture;
overlay.transform.parent = shading.transform.parent;

overlay.transform.localScale = shading.localScale;

Link to comment
Share on other sites

Well I was kinda hoping that I would just have to edit a few textures and that would be it. It's been years since I did any coding, so I'm not really sure how much time it would take me figure out how to do anything useful with the C#, alto from what I've seen it seems to be relatively easy to learn. I'm much better at 3d modeling and texturing.

Anyway if you would be willing to make a new version of that plugin I would gladly make some new textures for the navball and the crosshair to go along with it.

Link to comment
Share on other sites

I've nearly finished a version for 0.90 but decided it'd probably make more sense to submit it as a pull request for EnhancedNavball. I'm still getting around to that though.

It's only a handful of lines to add in your case so I went ahead and compiled a version for you. I haven't made any compatibility alterations or other changes.

The stock shading texture is 185x185. Different size versions should work but it's likely to end up aliased a bit. You can reload the texture by going to the space center and using the Alt+F12 debug menu.

Like the NavBall textures, the plugin will look in its own directory for an image called "crosshair" This should work for all texture types that KSP supports but I only tested it with PNG ("crosshair.png").

And as per plugin posting requirements, Source (RadeCrosshair branch). Public domain license

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...