Jump to content

Is it possible to create docking node dynamically


Recommended Posts

What do you mean by create a docking node? 

Are you talking about making a Module Docking Node dynamically? That would be tricky.

Or are you talking about moving the position of the actual docking node transform for an existing ModuleDockingNode (or something that inherits from it)? That is simple, just move and rotate the transform to wherever you want it, there is a reference to the docking transform in ModuleDockingNode.

The node code simply checks for the position and rotation of the transform relative to other docking nodes. You can probably disable the node by setting its state to disabled, or turning off the module, or something along those lines.

Link to comment
Share on other sites

  • 3 months later...
On 2/21/2018 at 6:52 PM, sirkut said:

Is it possible to create a docking node dynamically via code,specify the position as well orientation?

Yes, it is possible.  Can be buggy/problematic though, and is certainly complex.  I would very much recommend against doing it though; both for your sanity, and that of the users of your mod.

However if you choose to proceed, there is still some example source in the SSTU git history:

https://github.com/shadowmage45/SSTULabs/blob/2b970a060f01da425bbbd78ceada9d141acd5a79/Plugin/SSTUTools/SSTUTools/Module/SSTUModularStationCore.cs#L155-L171

Looks like I was already in the process of removing the feature in that commit/point in time, but you can likely still examine the code (or go further back in the history to see it when it was working).

 

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