Jump to content

[DEV HALTED][0.90] CIT NodeHelper [v1.1.4, 2015-01-01]


marce

Recommended Posts

Dev halted like stated here

I’m terrible at figuring out node positions for my parts.

So I did what I’m at least a little more talented at and wrote a plugin that lets you create, delete and move nodes for a part in the editor. You can attach other parts to those nodes and check how it looks. The attached parts even move with the nodes.

There are several options to move a node:

  • Use the 6 buttons to move the node in the respective direction a distance of <stepwidth> [you can set stepwidth to any pos. float value]
  • Enter a position (relative to the center of the part the node belongs to) and set the node directly to this position
  • The plugin saves the first position of a node it encounters. You can reset to this position any time. However, if you “update†the reset position the current position will be used from now on (cannot be undone)

It works only with stack nodes at the moment. So if you want to place a srf attach I'd suggest moving a stack node to the desired position, writing the config and renaming the node. Sorry for the inconvenience, somehow the srf node(s) gave me a lot of trouble.

You can also do the following:

  • change part attach rules
  • change node size
  • change node orientation

On request of RoverDude you can show/hide planes normal to all three axes and centered on either the center of the part or the center of the node. This can help to align nodes.

Once you are happy with the node positions hit the “Write†button and you’ll get a text file in the directory of the part.cfg which contains the node definitions ready to copy & paste. I tried to write the full part config, but the version kept in the GameDatabase seems to lack all “non-essential†entries like descriptions, author, etc. so I decided it’s better to just print the node positions.

Please be careful when launching a vessel you manipulated! Moved and deleted nodes are usually fine, but if you created a new one (which is not yet present in the part.cfg) and attached another part to it the universe will implode the moment you launch! There is nothing I can do about it, if you want to use the new nodes properly, write the definitions, update the part.cfg and reload the database, then you should be good to go.

Thanks to sarbian & sirkut for helping me out!

Blizzy's toolbar is supported.


node_stack_bottom = 0.0, -0.55927, 0.0, 0.0, 1.0, 0.0, 1
node_stack_top = 0.0, 0.55927, 0.0, 0.0, 1.0, 0.0, 1
node_stack_newNode = 0.0, 0.75001, 0.0, 0.0, 1.0, 0.0, 1
node_attach = 0.0, -0.55927, 0.0, 0.0, -1.0, 0.0, 1

I hope that someone else will find this useful as well :)

Mod Download, License and Source

[released in Add-on Development since mostly targeting modders]

Pictures:

PWEA6mp.pngHr7dM5G.png

Edited by marce
v1.1.4 release
Link to comment
Share on other sites

So for creating a new node, this tool should be used to find the coordinates. Write them down, delete the new node, exit the game, and add the new node in the part config file, is that right?

Any way this could be used to add a docking port to a simple structural part?

Link to comment
Share on other sites

So for creating a new node, this tool should be used to find the coordinates. Write them down, delete the new node, exit the game, and add the new node in the part config file, is that right?

Any way this could be used to add a docking port to a simple structural part?

The plugin writes them down for you, just copy them into your part.cfg (less work & less chance of errors this way).

wrt docking: haven't dealt with that but it' most probably out of the scope, this deals only with attachnodes. So besides of part-welding... I think toadicus wrote a plugin which does cool stuff with docking ports (Kipard's nice docking parts use it afaik), maybe ask him? Sorry, can't really help you more.

Link to comment
Share on other sites

So for creating a new node, this tool should be used to find the coordinates. Write them down, delete the new node, exit the game, and add the new node in the part config file, is that right?

Any way this could be used to add a docking port to a simple structural part?

Exit the game? Holy heck, just save the changes and refresh the game database using the debug menu. No need to exit the game. You must do this at the space center.

Great job marce. Glad it's now out. This is an essential modding tool.

Link to comment
Share on other sites

Thanks for this tool; as a hopeless tweaker and MM junkie, this should make customizing things a breeze. :)

However, I did find a problem in the release: After leaving the editor, opening an action UI/menu in flight causes a series of NREs. The map view also goes berserk once this happens. I took a look at the code and noticed the problem. Pull request sent - hope you don't mind!

For good bug reporting, details and complete logs attached behind the cut along with the important snippet:

ozraven_NRE_logs_NodeHelper.7z (Dropbox)

  • KSP 0.25 (Windows/x86)
  • Mod Listing
  • No, I wouldn't ask for support with this setup, just including it all for reference in case there are further issues.


<...snip...>
Contract (Set altitude record of 22000m.): Altitude record reached! Well Done!
<b><#8BED8B>Completion Rewards:</></>
<#B4D455>£11,070 <#feb200>(-583)</> </>
<#6DCFF6>©<#caff00>(+16)</> </>
<#E0D503>¡65 </>
NullReferenceException
at (wrapper managed-to-native) UnityEngine.GameObject:SetActive (bool)
at NodeHelper.NodeHelperAddon._clearMapping (Boolean deselect) [0x00000] in <filename unknown>:0
at NodeHelper.NodeHelperAddon.HandleActionMenuClosed (.Part data) [0x00000] in <filename unknown>:0
at EventData`1[Part].Fire (.Part data) [0x00000] in <filename unknown>:0
at UIPartActionController.Deselect (Boolean resourcesToo) [0x00000] in <filename unknown>:0
at UIPartActionController.HandleMouseClick (UnityEngine.Camera cam, Boolean allowMultiple) [0x00000] in <filename unknown>:0
at UIPartActionController+
.MoveNext () [0x00000] in <filename unknown>:0
(Filename: Line: -1)
[Experiments]: FX Modules set: 1
NullReferenceException
at (wrapper managed-to-native) UnityEngine.GameObject:SetActive (bool)
at NodeHelper.NodeHelperAddon._clearMapping (Boolean deselect) [0x00000] in <filename unknown>:0
at NodeHelper.NodeHelperAddon.HandleActionMenuClosed (.Part data) [0x00000] in <filename unknown>:0
at EventData`1[Part].Fire (.Part data) [0x00000] in <filename unknown>:0
at UIPartActionController.Deselect (Boolean resourcesToo) [0x00000] in <filename unknown>:0
at UIPartActionController.Deactivate () [0x00000] in <filename unknown>:0
at CameraManager.SetCameraMap () [0x00000] in <filename unknown>:0
at MapView.enterMapView () [0x00000] in <filename unknown>:0
at MapView.EnterMapView () [0x00000] in <filename unknown>:0
at MapView.Update () [0x00000] in <filename unknown>:0
(Filename: Line: -1)
[CurrencyConverter for Outsourced R&D]: 0 Funds taken, yields 0 Science
NullReferenceException
at (wrapper managed-to-native) UnityEngine.GameObject:SetActive (bool)
at NodeHelper.NodeHelperAddon._clearMapping (Boolean deselect) [0x00000] in <filename unknown>:0
at NodeHelper.NodeHelperAddon.HandleActionMenuClosed (.Part data) [0x00000] in <filename unknown>:0
at EventData`1[Part].Fire (.Part data) [0x00000] in <filename unknown>:0
at UIPartActionController.Deselect (Boolean resourcesToo) [0x00000] in <filename unknown>:0
at UIPartActionController.Deactivate () [0x00000] in <filename unknown>:0
at CameraManager.SetCameraMap () [0x00000] in <filename unknown>:0
at MapView.enterMapView () [0x00000] in <filename unknown>:0
at MapView.EnterMapView () [0x00000] in <filename unknown>:0
at MapView.Update () [0x00000] in <filename unknown>:0
(Filename: Line: -1)
...
<...snip...>

Link to comment
Share on other sites

Exit the game? Holy heck, just save the changes and refresh the game database using the debug menu. No need to exit the game. You must do this at the space center.

Great job marce. Glad it's now out. This is an essential modding tool.

Thanks sirkut!

You absolute genius. Thanks, this will be useful.

Glad to hear! Oh and be ready to be bugged a bit about wheels in the near future :P

Thanks for this tool; as a hopeless tweaker and MM junkie, this should make customizing things a breeze.

However, I did find a problem in the release: After leaving the editor, opening an action UI/menu in flight causes a series of NREs. The map view also goes berserk once this happens. I took a look at the code and noticed the problem. Pull request sent - hope you don't mind!

Dammit! Completley forgot, that's the bad side of Alt+F4ing out of KSP immediatley after testing something - thanks for the PR!

Nice difference of having modders as "userbase" :cool:

yeah, a part menu gets stuck open and stuff too with this mod turned on.

Sorry, most probably fixed by ozraven's pr, I idiot forgot to unregister the events :blush:

Looks good, but 7 digits is a total waste of space, especially when all are just 0.

I suggest numbers to be truncated: integer if they are not floating point, all non significant 0 removed. It is also more readable.

Agreed, should be doable, however I'll stick to F1 even if the number is zero, floats should look like floats imho.

Link to comment
Share on other sites

v1.0.1 released

Changelog:

  • events unregistered OnDestroy (should stop NullRefs outside the editor) - thanks ozraven for finding and patching my brainfart :blush:
  • Output now formatted to max 5 and min 1 decimal place(s)

Link to comment
Share on other sites

v1.0.2 released

ozraven found yet another bug (a smallish one though so updating is not absolutely required if you´don't want to).

Since I’m now maintaining 8 mods already it gets a bit tedious to update several links spread over the forum (most updates change at least two mods due to them requiring each other).

Therefore I decided to bundle them on a common download page. You’ll find links to the forum post, source, license and of course the download there.

I also took the liberty to add a donate button since I can really use any cent you might have lying around – but that is, of course, fully optional! I talked with one of our cheerful mods so I shouldn’t be violating any forum rules.

I know it’s a bit less convenient than direct download links in the posts, but on the plus side should hopefully reduce the occurrence of dead links since I only update in one place. If you find any problems there is a direct contact option on the side so that I can react asap.

Thanks for bearing with me and I hope you’ll continue to enjoy my mods in the future!

Link to comment
Share on other sites

I seem to be having a bit of trouble with this. The node placement in the mod is offset from the node information in the config files.

For example:

Ag2c6SI.png

Mod shows node as: 0.0,-0.175, 0.0. The information in the part.cfg is 0.0, -1.40, 0.0. It seems to be this way for every part I've looked at, including stock parts.

Other examples:

MK1 Inline cockpit

Top Node: Mod shows 0.0, 0.9375, 0.0. part.cfg is 0.0, 7.5, 0.0

Bottom Node: 0.0, -0.96875, 0.0. part.cfg is 0.0, -7.75, 0.0

Lander Can

Top Node: Mod shows 0.0, 0.75193, 0.0. part.cfg is 0.0, 0.625, 0.0

Bottom Node: Mod shows 0.0, -0.40367, 0.0. part.cfg is 0.0, -0.625, 0.0

I've tried deleting and installing the latest version, but that didn't appear to fix anything.

I'm running KSP 0.25 (32 bit). As this is my development install, I only have AVC, RasterProp, your mod, and Toolbar installed.

Any ideas on how to fix?

Link to comment
Share on other sites

I know you said there is now new feature for some time but if it's possible it would be nice to save the changes directly to the part.cfg (or create a new part.cfg) and override the old nodes or just add the new node. It would be even more awesome if after saveing the new node possitions the part is reloaded in the editor with the new node placements and your are able to use it without reload the database.

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