Jump to content

[1.7] FullAutoStrut - Automatically sets AutoStrut modes and other part options as you build your vessel


Xyphos

Recommended Posts

This is a Quality-Of-Life mod, Automatically sets AutoStrut modes and other part options as you build your vessel.
This mod has a GUI for better control how it behaves, or can be left to "Automatic" operation if you want to set & forget

"Automatic" mode will:
Set the root part to the Heaviest part, left alone as a bug prevention; "Heaviest Part" may cause problems.
All parts connected to the root part will have AutoStrut set to the root part,
All other parts will be set to Grandparent part and form an AutoStrut mesh.
 

Sept 30, 2019 - UPDATED to v3.0.0.0 for KSP 1.7+
Added "Same Vessel Interaction" support.
Re-worked the Robotics Compatibility; Both Breaking Ground and Infernal Robotics will be compatible with this mod;
Robotic parts and parts attached to Robotic parts will have their AutoStrut modes turned off to allow movement and Same Vessel Interaction turned on to allow for collision.

Download from SpaceDock

Source Code on GitHub

CKAN release available, but I don't control CKAN so it might not be updated often.

Edited by Xyphos
Updated to v3.0.0.0 for KSP 1.7
Link to comment
Share on other sites

36 minutes ago, monstah said:

Judging from the source, it sets parameters when the parts are added, so what you override them should stick?

correct. you can override once the part is placed, but if you remove it and place it again, it's likely to persist because there's a check to see if the autostrut mode was already set.
honestly, I don't fully understand why you would want to override, tho? a grandparent mesh is structurally secure.

48 minutes ago, linuxgurugamer said:

Can it be disabled?

remove the dll?
I haven't made a UI toggle, and I might not at all, unless more people request it; it wan't intended to be disabled.

Edited by Xyphos
Link to comment
Share on other sites

Because sometimes autostrutting can cause problems, especially with very large parts.

also, if the heaviest part is a fuel tank, then whatever is autostrutted to it will change when the tank gets empty.  It can cause URDS (Unintended Rapid Disassembly Syndrome).  You may want to have an option where it ignores the fuel mass when deciding what is the heaviest part.

Link to comment
Share on other sites

1 minute ago, linuxgurugamer said:

Because sometimes autostrutting can cause problems, especially with very large parts.

also, if the heaviest part is a fuel tank, then whatever is autostrutted to it will change when the tank gets empty.  It can cause URDS (Unintended Rapid Disassembly Syndrome).  You may want to have an option where it ignores the fuel mass when deciding what is the heaviest part.

with this mod, only the root part would be set to heaviest. the parts connected to the root part will be set to root part, all other parts are set to grandparent to form a "wire mesh" and hold it together.

Edited by Xyphos
Link to comment
Share on other sites

1 minute ago, linuxgurugamer said:

Ignore fuel tanks when looking for the heaviest part

yeah, that's too complex for something so simple. how about we just ignore the root part, since that's the only one set to heavy

Link to comment
Share on other sites

2 minutes ago, linuxgurugamer said:

Why is it complex?  Loop through all the parts, finding the heaviest one which isn't a tank.  

there's no native or easy way to determine what is a "tank" and what isn't, considering the number of resource containers that exist, including batteries, cockpits, etc... that's a lot of work, both on my end, and the end-user's computer. in other words, it's extra unnecessary code. omitting the the root part would actually make every smaller and simpler.

Link to comment
Share on other sites

Not really, I'm just making some suggestions.

So, this is what you could do:

At game load, scan all parts and store the part name in a dictionary if it isn't a tank.

When building a craft, simply look up the part in the dictionary, if it's there, you can use it as a root.

Link to comment
Share on other sites

Just now, linuxgurugamer said:

Ok, try this:  A tank is something that weighs very little empty, compared to when it's full.

You should be able to set up a static list in memory of all parts which aren't tanks, and just reference that.

The thing is, auto strut doesn't give you the option to pick which part you strut to. All you get is heaviest, grandparent, or root (https://kerbalspaceprogram.com/api/class_part.html#a68ff7310759e0db6663e159d13c91881). I agree with @Xyphos, it's too complicated to try and make sure it's not strutting to a tank.

Link to comment
Share on other sites

While the actual heaviest part can change in flight, the strut itself won't change until the craft itself changes. Or, possibly, when the game is loaded. It won't snap all "heaviest part" autostruts to a new part until then.

At least, it used to work that way. I tested it during the public beta in which they were introduced.

Don't autostruts impinge on performance, though? I've never tested that, but always thought they were about as processor-intensive as regular struts. I'd be leery to use this mod if that was the case. Even more so than I am now, after having my fair share of "too many struts" problems in the past.

Link to comment
Share on other sites

2 hours ago, 5thHorseman said:

Don't autostruts impinge on performance, though?

I'm not sure. I haven't noticed any changes in performance, but then again I usually don't exceed 250 parts and I have a moderate gaming rig.

PS. I updated it to version 1.0.0.1 - I removed the code for the root part to avoid the "Heavy Part" conflict and cleaned up the code to be more readable. please download again using the link in the OP. unless there's a major bug fix or changes to KSP's API, I believe this will be the stable release.

Edited by Xyphos
Link to comment
Share on other sites

4 minutes ago, OldLost said:

It doesn't appear to be available via CKAN, at least not yet anyway. Is that something you're planning on adding later, perhaps?

all of my mods on spacedock have CKAN support requested, but the maintainers of CKAN are slacking or just out-right refuse. apparently I'm not a member of the club.

Edited by Xyphos
Link to comment
Share on other sites

4 minutes ago, Xyphos said:

all of my mods on spacedock have CKAN support requested, but the maintainers of CKAN are slacking or just out-right refuse. apparently I'm not a member of the club.

Your pull request has been in the queue 13 hours (https://github.com/KSP-CKAN/NetKAN/pull/5750). My last one waited 3 weeks before I asked about it on the CKAN thread (and was helped by linuxgurugamer). It's not a club, it's a tedious, unrewarding manual review queue that currently has 33 pending requests.

Link to comment
Share on other sites

6 minutes ago, HebaruSan said:

currently has 33 pending requests.

and only 2 of those requests are mine, out of all the mods I've published, only a handful made it on CKAN. a lot of them were refused, apparently for licence reasons, but PUBLIC DOMAIN is a valid permissible licence; I don't see the problem here.

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