Jump to content

Part Idea: Solar Alpha Rotary Joint...Is it Possible?


Recommended Posts

Hi All,

A complex first post, but I was building a station the other day and it struck me that I haven't seen a mod that adds something like the Solar Alpha Rotary Joint of the ISS (That is, the mechanism that rotates the outermost truss segments while the panels themselves rotate on their own axes for 2 total alignment axes). For the record I am completely new to KSP mod creation (although I have read the kspwiki guide "Making an Asset"), so if you see something I'm suggesting that's completely ridiculous, I apologize in advance.

My main question is, is a part like this even possible for KSP? (Additionally and perhaps more importantly, have I somehow missed a mod that adds this?) I'm imagining something like Near Future Construction's Octo-trusses with stack mount nodes on each end, one of which is the stationary end, the other the rotating end, with one side of the rotating end somehow determining solar exposure and rotating accordingly (rotating joint in the middle somewhere). Can a part be attached to a piece that rotates as such? I feel like there's a reason that I haven't seen parts surface mounted on panel wings (i.e. a rotating part) elsewhere in-game, and I don't know if that's a limitation of the engine or a choice I can make. The modeling seems straightforward enough (although I'm not sure how the rotating collider/mesh would work), and I've got 6 years of using Blender under my belt, but before I even attempt this I'd like to make sure Unity will allow me to do so.

Could some piece of code or a config file that governs stock solar panels help me out here? Any tips on achieving the same effect with less effort? Generic common knowledge I should know but clearly don't? Additionally, if this is in fact impossible for whatever reason, I would appreciate you taking the time to explain why so I can learn any quirks of Unity/KSP I may be dealing with here.

Thanks for reading.

DarthKozilek

 

 

Link to comment
Share on other sites

Yes this is possible and has been done at least two times to my knowledge -

  • WildBlueTools includes WBIDualAxisSolarArray which is used in 
    • DSEV - solar truss
    • MOLE - solar battery module
    • Pathfinder - Sombrero Solar Array
  • SSTU includes SSTUSolarPanelDeployable used in
    • SSTU - ST-GEN - DSP-ISS (and several other single axis panels)

 

Edit: the DSEV solar truss is the most similar to the NFC octo trusses.

Edited by Aelfhe1m
Link to comment
Share on other sites

I have a basic part modeled and textured and brought into Unity without issues. I've got two truss objects (a base and a rotating segment) and a basic mesh collider for each. The issues I see going forward are making the rotating collider match the rotation of the rotating truss, and actually incorporating some of the code mentioned above. I'll ask the authors of the above mods for some advice when I get to that point.

Generally speaking, would those pieces of code go in the config file where the kspwiki tutorial says "PART MODULES AND RESOURCE DEFINITIONS GO HERE"? or do those get directly incorporated into the unity file somehow and exported as part of the part?

Is Notepad going to be sufficient for stitching code chunks together? Or would anyone recommend something else?

Finally, how do I post screenshots? I realize I'm leaving people in the dark here without specifics on the unity hierarchy, etc.

Link to comment
Share on other sites

2 hours ago, DarthKozilek said:

Generally speaking, would those pieces of code go in the config file where the kspwiki tutorial says "PART MODULES AND RESOURCE DEFINITIONS GO HERE"? or do those get directly incorporated into the unity file somehow and exported as part of the part?

The pieces of code I linked in my earlier message are part of compiled DLLs. You would use them by including the mod containing the DLL as a dependency for your mod and then referencing the part module in the config file in the section noted.

For example the config file for DSEV solar truss is here and uses two part modules to define the two axes of rotation - a stock ModuleDeployableSolarPanel in lines 37-50 and the custom WBIDualAxisSolarArray module in lines 52-67. The pivotName and raycastTransformName refer to specific elements defined on the model file in Unity (see this post for basics).

There is a mod - DebugStuff (it still works fine in KSP 1.3.1) - that can be used to examine parts inside KSP to see how the various coliders, meshes, transforms etc. are defined. Then look at the parts' config files to see how those names are used inside modules.

 

2 hours ago, DarthKozilek said:

Is Notepad going to be sufficient for stitching code chunks together? Or would anyone recommend something else?

To use stock modules or modules from other mods that you define as being dependencies then a simple text editor is fine.

If you want to write your own custom module or modify the behaviour of an existing module (beyond just setting different values for fields) then you need to set up a code compiling environment in Visual Studio, MonoDevelop or similar.

Edited by Aelfhe1m
Added software links
Link to comment
Share on other sites

Progress update: I have an attempt at a config file and a screenshot. The config is spoilered below. Below that is the current unity setup. Does the hierarchy look right? BaseSegment is the bottom half of the part with its collider as a chld, with sunpivot being the upper half of the mesh (called by the WBI module) and its collider and the suncatcher empty as children. root is the empty everything is a child of (for PartTools to work).

To clarify further, I've intended this as a purely structural part (probably with an on-board battery), so it will not generate EC on its own, simply rotate anything on the end of it to face the sun. (Ergo I shouldn't need the stock deployable panel module?) On the note of the config, do the node-stack entries define the unity coordinates where I want the stack nodes to be? I haven't updated those numbers. Other numbers (cost, etc.) are just random placeholders, no thought given to balance.

I'm still working out how to correctly call the dualAxis module.
 

Spoiler

 

PART
{
    name = Truss Alpha Rotary Joint
    module = Part
    author = DarthKozilek
    mesh = TrussJoint.mu
    rescaleFactor = 1.0
    node_stack_top = 0.0, 0.3125, 0.0, 0.0, 1.0, 0.0, 1
    node_stack_bottom = 0.0, -0.3125, 0.0, 0.0, -1.0, 0.0, 1
    node_attach = 0.5, 0.0, 0.0, 1.0, 0.0, 0.0
    TechRequired = specializedConstruction
    entryCost = 3000
    cost = 1500
    category = Structural
    subcategory = 0
    title = Truss Alpha Rotary Joint (TARJ)
    manufacturer = Eldritch Engineering Enterprises
    description = The TARJ allows entire structures to track the sun, allowing both dual-axis solar panel tracking and on-orbit nasuea testing. Motion sickness bags on backorder.
    attachRules = 1,0,1,1,0 // attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
    mass = 1.500
    dragModelType = default
    maximum_drag = 0.2
    minimum_drag = 0.15
    angularDrag = 1.5
    crashTolerance = 10
    maxTemp = 1200
    breakingForce = 1000 //how much force before the joint breaks
    breakingTorque = 1000 //how much twisting before the joint breaks
    bulkheadProfiles = size2
    

    MODULE
    {
        name = WBIDualAxisSolarArray
        rotationModuleIndex = 0
        retractable = false
        isBreakable = true
        pivotName = sunpivot
        raycastTransformName = suncatcher
        windResistance = 5
        trackingSpeed = 0.25        
    }

    RESOURCE
    {
        name = ElectricCharge
        amount = 1000
        maxAmount = 1000
    }
}

 

vMwFkQV.jpg

Link to comment
Share on other sites

The WBIDualAxisSolarArray module works in conjunction with the stock ModuleDeployableSolarPanel  - the stock module is defined first in the config to control one axis of rotation and then the WBI module is defined after it to control the second axis of rotation. The  rotationModuleIndex = X line inside the WBI module is used to tell it where to find the stock module in the config. (e.g. in the solar truss config the stock module comes first at the index 0. If there had been any other modules defined before the stock module then a higher index would be specified).

Looking at your part you only have one axis of rotation (on the part itself - the other axis would be controlled by whatever you attached to the end of it) so you could just use the stock module without needing the WBI module.

 

Edit: upon further thought I'm not sure whether this would work. Most parts in KSP don't move other attached parts with their animations. That requires more complicated specialist code (and rigging) along the lines of Infernal Robotics or USI Konstruction.

Edited by Aelfhe1m
Link to comment
Share on other sites

On 12/30/2017 at 7:59 PM, DarthKozilek said:

To clarify further, I've intended this as a purely structural part (probably with an on-board battery), so it will not generate EC on its own, simply rotate anything on the end of it to face the sun.

This cannot be done in KSP in normal parts/mods.  You cannot animate other attached parts -- only animate meshes within a single part.

You would have to resort to using Infernal Robotics or a similar plugin in order to animate/move other attached parts.

Link to comment
Share on other sites

I went and asked Angel-125 to triple check,  and you're right, apparently this isn't possible. That incompatibility was what I was initially worried about, although maybe I can bootleg a solution in-game with IR (never used it before, can't say for sure). Thanks for the help though, definitely learned a bit about how parts go together.

Link to comment
Share on other sites

  • 4 weeks later...
On ‎02‎.‎01‎.‎2018 at 4:44 AM, DarthKozilek said:

I went and asked Angel-125 to triple check,  and you're right, apparently this isn't possible. That incompatibility was what I was initially worried about, although maybe I can bootleg a solution in-game with IR (never used it before, can't say for sure). Thanks for the help though, definitely learned a bit about how parts go together.

Please give us an update when you get this to work with infernal robotics. I was searching for such a part to work with the NFC octo-trusses for quite some while and am very excited to see someone work on this idea. Maybe you can get a hand from Nertea or someone working with IR to get this thing rolling.

Link to comment
Share on other sites

  • 1 month later...
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...