Jump to content

[1.8.1] Hangar Grid: Zero deviation [v0.4.0.181] (2019 Nov, 18)


Ser

Recommended Posts

Simplifies vessel design by adding a visual "laser" grid and an automatic alignment tool to SPH and VAB

License: GPLv3

Source code: GitHubrj5Tz0X.jpg

Description

Citation: "You should make your drawings with a ruler and a pencil, not with your leg and a marker pen." -- A maths teacher

Have you ever been annoyed by ending up with misaligned engines or clubfooted landing gear after spending half-an-hour trying just to guess where to rotate to get them right? This mod adds a grid to SPH and VAB and "laser" guides for an active part to let you clearly see where the things are wrong and align them in one click.

Download from SpaceDock

Here's a video on why do you need it and how to use it

Installation

Extract contents of the released archive into your KSP/GameData folder.

Usage

While in SPH or VAB press the button to enable the grid. Once there's a root part you'll see the grid with origin bound to the part. If you try to add or edit another one you'll see the red "laser" guides representing all the three axes for it and all of its symmetry counterparts. Now you have all the planes and axes visualized and it's the matter of several clicks to align the things.

The guides have distinct colors for each direction. You can easily remember them in the following way:

  • Red for Rechts (Right)
  • Violet for Vorwarts (Forward)
  • Pink for Up (almost the same as the thrust vector)

Once you have rotated a part to approximately face the desired side, use the following hotkeys for autoalign the desired part's axis to be parallel to the closest grid line (regardless of direction):

  • Period ( [.] ) - toggles the grid on and off
  • L - aligns the part by a guide at the mouse pointer to the closest grid line
  • J - aligns the part's up (pink guide) to the closest grid line
  • N - aligns the part's forward (violet guide) to the closest grid line
  • M - aligns the part's right (red guide) to the closest grid line
  • G - select a part under mouse pointer as the grid's origin
  • K - toggles guides for symmetry (deKlutter). May be useful when working with many radially symmetrical parts creating a bunch of guides which makes them complex to use. This button let's you see the ones for the original part only.

When using the separate keys for alignment (J, N, M), if you are in the part's editing mode (rotation or offset) it is sufficient to just press a key. Otherwise you'll need to move the mouse pointer over the desired part and then press.

You can change the keys by editing HangarGrid.cfg in the mod's folder. Valid values are listed inside the file.

Know issues

Autoalignment of a part desynchronizes it's rotation and position to the current rotation gizmo. So if you press an alignment key while in rotation mode, it is recommended to re-enable the mode by pressing "1" - "3", for example. Otherwise once you touch the gizmo again the part jumps to the gizmo's present position and rotation.

Planned features

* A GUI for grid customization that let's you change the look and declutter the view abit.

Edited by Ser
Recompiled for KSP 1.8.1
Link to comment
Share on other sites

Looks good; I'll be trying it out shortly.  Quick feature request, if you're interested: Orientation guides ('front' and 'up', at least) for any/all command parts - capsules and pods.  I use a few that aren't clear when looking at them, and I'm usually using them so I can have one facing the correct way for a particular phase of a mission.

Link to comment
Share on other sites

17 minutes ago, DStaal said:

Looks good; I'll be trying it out shortly.  Quick feature request, if you're interested: Orientation guides ('front' and 'up', at least) for any/all command parts - capsules and pods.  I use a few that aren't clear when looking at them, and I'm usually using them so I can have one facing the correct way for a particular phase of a mission.

That should be easy, just distinct colors for direction guides. But you'll be surprised by where the forward side of landing gear is :)

Edited by Ser
Link to comment
Share on other sites

43 minutes ago, Ogre420 said:

It needs a SNAP to grid based on HANGER (X,Y,Z OR all 3) and also ROOT PART alignment.

The stock game already has something nearly identical.
Next time you use the translation or rotation tool toggle between 'local' and 'absolute' with [Alt]+[F].
I don't want to diss @Ser's mod, I trust it has its uses and took a good deal of effort to get to this point but I doubt you will need it any more after you see for yourself what [Alt]+[F] does.

Link to comment
Share on other sites

10 hours ago, Ogre420 said:

It needs a SNAP to grid based on HANGER (X,Y,Z OR all 3) and also ROOT PART alignment.

Snap to grid is a nice idea. But why would you need to align anything to hangar? You can align the root part to it by pressing Spacebar and use only WASD keys to rotate it. Additionally, as the grid is bound to the root part, you could watch the angle of grid lines to the floor. After that everything aligned to the root part is aligned to hangar. Or maybe I've understood you wrong?

Edited by Ser
Link to comment
Share on other sites

1 hour ago, Tex_NL said:

The stock game already has something nearly identical.
Next time you use the translation or rotation tool toggle between 'local' and 'absolute' with [Alt]+[F].
I don't want to diss @Ser's mod, I trust it has its uses and took a good deal of effort to get to this point but I doubt you will need it any more after you see for yourself what [Alt]+[F] does.

This. And when you've chosen snap to absolute alignment and click on the axis you wish to align using the rotation gizmo, you're done.

And you don't need [alt] + [f], just [f].

But I'll take a look at it anyway. Could be very useful for aligning blowers in turboshaft engines.

Link to comment
Share on other sites

3 minutes ago, Tex_NL said:

Oh. I was told [Alt]+[F]. Just [F] would makes things even easier. I'll need to give that a try later today. Thanks.

Whenever I'm building, the f key is one of my most used keys. Usage increases building speed by at least 2.

Link to comment
Share on other sites

18 hours ago, DStaal said:

Don't particularly care about which is the forward side of landing gear;)  Only ones I care about are the ones which you can click 'control from here' on.  (Of course, if the easiest is to have it for all parts, I can see that.)

Actually it's pretty important. I'm tired of having to reverse steering direction.

Edited by DeepSpace
Link to comment
Share on other sites

1 hour ago, DeepSpace said:

Actually it's pretty important. I'm tired of having to reverse steering direction.

I already have distinct color coding for different direction guides in my plans, may be that helps you when I implement it. But that's not so obvious. Seems like the part's forward side for landing gear is facing up :huh:. Just my guess that rolling direction would be the part's up. But it seems that its counterpart is rotated, not mirrored, so it rolls in the direction of its "down".

Well, that's just a guesswork. Never got deeply into this. Soon I'll visualize concrete directions and see.

Edited by Ser
Link to comment
Share on other sites

8 hours ago, Tex_NL said:

Oh. I was told [Alt]+[F]. Just [F] would makes things even easier. I'll need to give that a try later today. Thanks.

 

8 hours ago, Azimech said:

This. And when you've chosen snap to absolute alignment and click on the axis you wish to align using the rotation gizmo, you're done.

And you don't need [alt] + [f], just [f].

But I'll take a look at it anyway. Could be very useful for aligning blowers in turboshaft engines.

Thanks for reminding of this feature but I've never used it and forgot about it completely. I've tried it now. I'm not trying to protect my mod by any means here but I find the feature inconvenient.

Azimech, all I get by pressing "F" is changing the rotation gizmo's orientation from part's to hangar's. Nothing self aligns or snaps anywhere, no matter how much I click. Maybe you've meant n-degrees steps?  Yes, the gizmo in absolute mode represents some kind of axis' but they are fixed to the hangar. So to align a part to the root one I must have the root part aligned to the hangar. Alignment error is huge: yes, the gizmo has some ticks inside but they are barely visible infront of lightgrey parts. And the tiny ticks hide behind those thick rings making me guess in at least +/-5 degrees range. So it's hard to fine tune something unless you need to align this strictly to the hangar's axis. Maybe I just don't understand how to use it properly?

Edited by Ser
Link to comment
Share on other sites

You are aware you can switch between angle snap and free, with the button next to the radial vs mirror symmetry, right? It won't work in free mode, and in angle snap mode sometimes you need to press the right circle, at other moments gently pull it.

Link to comment
Share on other sites

I'll have to try the stock f-key thing... However, I find myself surface attaching parts that always seem to default to weird angles, whether I use angle snap, or chnage symmetry modes... So I end up using fine-control WASD... Which is OK, but when trying to line up non-symetrical parts, its a PIA to say the least...

So I will definately be trying out this mod... Also, as far as landing gear goes, same thing... It's VERY easy to have even slightly mis-aligned landing gear, which will cause noticeable issues... I really appreciate the similar alignment function of the Adjustable Landing Gear mod... (or was it one of the KAX mods?... I forget...lol)

Link to comment
Share on other sites

14 hours ago, Tex_NL said:

The stock game already has something nearly identical.
Next time you use the translation or rotation tool toggle between 'local' and 'absolute' with [Alt]+[F].
I don't want to diss @Ser's mod, I trust it has its uses and took a good deal of effort to get to this point but I doubt you will need it any more after you see for yourself what [Alt]+[F] does.

Ok it's obvious that I need to make it clearer, if you watch the video from above, he makes a plane, adds wings at an odd angle and then attaches a sub assembly of intake, fuel tank and engine to the wings.

He then uses the GIZMO's to align the sub assembly to the HANGER grid that the mod displays, at this point he is EYEBALLING the alignment to the hanger grid.

I use Editor Extension Redux, Here's a video on the horizontal/vertical SNAP along with some SNAP functions for struts & fuel lines... 

 

With this mod I can place a part, point at it and hit "V" or "H" to center it horizontally or vertically compared to the parent part.

What I'm suggesting is something similar to that for hanger grid, place a part, point at it and hit the proper key and it will snap to the X, or Y, or ,Z or all 3 of the HANGER or other keys to snap to the X, or Y, or Z of the ROOT part.

 

Lets say that in that video he had not just offset the sweep of the wings but had also tilted the leading edge UP a bit.

With the SNAP function all you would need to do is point at the part and press a key and the sub-assembly would SNAP to HANGER and be aligned straight forward, then press another key and the sub-assembly would SNAP to the angle of the tilt of the wing.

 

As some have said you can use "F" to change the GIZMO's alignment from hanger to part and back, BUT using them you are EYEBALLING the alignment.

You can use <SPACE> to zero out a parts alignment (To the hanger) WHEN HELD, but that can get screwed when PLACED, so that's why I suggested a SNAP to ALL (Basically zeroing out all axis's) after it's PLACED.

Edited by Ogre420
Link to comment
Share on other sites

5 hours ago, Ogre420 said:

What I'm suggesting is something similar to that for hanger grid, place a part, point at it and hit the proper key and it will snap to the X, or Y, or ,Z or all 3 of the HANGER or other keys to snap to the X, or Y, or Z of the ROOT part.

 

Lets say that in that video he had not just offset the sweep of the wings but had also tilted the leading edge UP a bit.

With the SNAP function all you would need to do is point at the part and press a key and the sub-assembly would SNAP to HANGER and be aligned straight forward, then press another key and the sub-assembly would SNAP to the angle of the tilt of the wing.

 

As some have said you can use "F" to change the GIZMO's alignment from hanger to part and back, BUT using them you are EYEBALLING the alignment.

You can use <SPACE> to zero out a parts alignment (To the hanger) WHEN HELD, but that can get screwed when PLACED, so that's why I suggested a SNAP to ALL (Basically zeroing out all axis's) after it's PLACED.

 

Ok, now I see what you mean. Yes, it is certainly a downside that you still have to eyeball in my mod. The snap button idea is useful, it would make aligning the matter of half-a-second. And being able to align any part to any part would be an advantage over the stock system, which,with the absolute and the snap-to-angle modes enabled, is a powerful tool too, as have been shown above, but limited to hangar alignment. I still think that alignment to the part (root) is more important than a hangar alignment and should be engough because the basic thing you want is the things aligned to each other and if you want everything aligned to hangar you may just select the root part and press spacebar. Or maybe you know a case when that doesn't work?

Link to comment
Share on other sites

Optional update 0.1.2c is out

Just added distinct colors for direction guides. If you like when the guides are all red you may stay with previous version.

You can easily remember the colors in the following way:

Red for Rechts (Right)

Violet for Vorwarts (Forward)

Pink for Up (almost the same as the thrust vector)

The direction guides are actually arrows with thin end pointing towards the positive direction.

Edited by Ser
Link to comment
Share on other sites

On 24.02.2016 at 4:08 PM, DeepSpace said:

Actually it's pretty important. I'm tired of having to reverse steering direction.

Speaking of landing gear, with colored directions I found that they are ok in SPH as a "real SPH part" but all other parts are lying on their bellies so their forward points down. And landing gear's symmetry counterpart is indeed rotated and that's correct because if you want to turn them clokwise they both will turn clockwise. So the guides for them are pointing in opposite directions. Well, I'm not sure how but hope that will be useful.

I'll think about flipping axis' when in SPH so you wouldn't have to remember that when in SPH the part's up (the pink line) is actually forward. Up must always be up.

On the other hand that could cause another type of confusion: what was up for a pod's crew in VAB becomes forward in SPH. That would be inconvenient when dealing with control sources. So I think it's the matter of personal preferences whether to have axis' flipped or not and depends on what you are going to do.

Edited by Ser
Link to comment
Share on other sites

13 hours ago, MK3424 said:

Seems like Kottabos is liking the mod aswell:

Thanks. It's the second time Kottabos makes me keep up modding. Seems like I'll have to code all the weekend now :)

Edited by Ser
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...