Jump to content

[PLUGIN, PART 0.16] AutoStrut


Tosh

Recommended Posts

attachment.php?attachmentid=31725

"...Lemme strut it for ya", said little green VAB Kerbal...

Okay, autoStruts. Automatically link symmetrical parts together (and un-link when symmetry goes off). Links are quite strong, I gotta say; way stronger than a stock strut.

Usage is quite tricky, and the part must be modelled in a special way.

Here's how it works. This partModule:

  • Finds a gameObject named "strut{id}" ("{id}" being any string, e.g. "strut1"),
  • Locates the nearest part with the same module installed,
  • Rotates the strut towards receiving part with strut's local Z axis ("Y" in 3D modelling program),
  • Scales the strut along Z,
  • And establishes a physical link (FixedJoint Unity object).

Those links are automatically rebuilt during the game when symmetry changes (other parts are added, or some part breaks off).

Optionally, a strut may have

  • An "anchor{id}" ("{id}" being the same as for strut itself): a small object, located in the same point as corresponding strut, which becomes visible when establishing a link,
  • An "anchor" may be rotated along with its strut if "rotateAnchor" parameter is true,
  • Strut's texture may be automatically tiled along its horizontal axis to accommodate strut's length ("tileStrutTexture" parameter),
  • And a tricky one: if "detectManInTheMiddle" is true, autoStrut will detect other autoStrut parts placed in between of symmetry counterparts, and try to connect to them.
attachment.php?attachmentid=31724
Well, [thread=18321]floats[/thread] on the wings were placed with symmetry. The one on the hull was not, and now it's, errr, "in the middle".
Warning! This may glitch.

See autoStrut.dae and autoStrut.png for an example on how to model and texture an auto-strutted part.

Download 32 Kb from Google

Here are the .CFG parameters:

      MODULE 
{
name = autoStrut
rotateAnchor = true | false (default: true)
tileStrutTexture = true | false (default: true)
detectManInTheMiddle = true | false (default: true)
}

Known Issues:

  • It's highly recommended to have only 2 "strut" objects in your model. The code's currently not very good in supporting any other strut count,
  • "detectManInTheMiddle" may glitch badly,
  • Strut orientation may be a bit off when assembling a craft in the VAB. Not a big deal as it generally works O.K. during the subsequent flight...

[table][tr][td]64px-Cc-by_new.svg.png[/td][td]CC-BY license:

Do whatever you wish with the code (view, distribute, modify in any possible way...),

as long as its original author is referenced.[/td][/tr][/table]

attachment.php?attachmentid=31723

w00t it's going fast :cool:

Edited by Tosh
Link to comment
Share on other sites

  • 2 weeks later...
These work well on the new pontoons. One issue is they get in the way of Kerbals and rovers trying to exit from underneath the craft having been decoupled/disembarked.
Those struts don't have collision mesh, so they don't interfere with parts attached at the bottom.
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...