Jump to content

CargoBay and Fairing payload sleep-mode part/plugin


fatcargo

Recommended Posts

Is it possible to make a plugin that can add custom action group to disable and turn off all components of payload ?

What i mean, is that player would add a "payload sleep mode" part to main craft, add all payload components, select it's "disable" action and in separate popup window further select actions from all parts attached to it, like turn off reaction wheels, disable RCS ports, stop RTGs etc ...

After craft reaches it's destination, user can than activate "enable" action to toggle all payload components state back to active, prior to deployment.

Link to comment
Share on other sites

I assume you mean instead of just adding all of those items toggles to one action group as you can at the moment?

If the payload is connected via a docking port as many seem to do, how would it know which ones to turn off?

Link to comment
Share on other sites

I think what OP meant is, a separator part that you can place in your cargobay/payload fairing, where anything attach to it will be recognized as payload/cargo and will have its parts automatically shut down on launch and be controlled separately in a popup window. This would save the micro managing to shut down/reactivate stuff in cargo bay/payload.

Link to comment
Share on other sites

I assume you mean instead of just adding all of those items toggles to one action group as you can at the moment?

If the payload is connected via a docking port as many seem to do, how would it know which ones to turn off?

I think he just want to add the parts with 1 click to the category "payload" and then use a button to toggle everything on/off

as of now you need to select the part and add every module you want to toggle to the action group, and if you want the ability to switch off also you need to use 2 different action groups because not every item has a "toggle" option

my problem with cargobays is that I can only secure the payload on one side (using a docking port) but not on the other because I would need something to change lenght in order to put the second docking port at the right distance (already tried infernal robotics, I don't really like the pylon...)

Link to comment
Share on other sites

my problem with cargobays is that I can only secure the payload on one side (using a docking port) but not on the other because I would need something to change lenght in order to put the second docking port at the right distance (already tried infernal robotics, I don't really like the pylon...)

MOAR struts!!

Link to comment
Share on other sites

Thank you all for the replies and posts pretty much reflect my own idea how to implement this. I have further elaborated on this idea at Action Groups Extended thread. Maybe AGExt author will have exact answers on this since he has expirience in this matter.

PS: I know about cross-posting issues, i'm just trying to keep this from cluttering the AGExt thread.

As for stabilizing payloads, i use Active Struts. I was hoping they would behave similar to static struts, but they do have one snag : when enabling setting "Straight Up FreeAttach" on "CIT Targeter" part in editor, i was hoping it would hold payload on flight scene from start, but it does not. Active Struts engage AFTER physics kicks in and causes my sideways mounted payload to drop inside cargobay then it gets attached. When i redesigned payload with docking port lined up with it's CoM and fitting another port on cargobay floor, it went ok.

EDIT: The whole idea of having payload sleep mode is to keep various components on launch inactive so it does not use electricity, cause extra torque, have its fuel used or (most annoyingly) have it's lights turn on along with main craft, turning it into disco ball light show.

Edited by fatcargo
elaborating
Link to comment
Share on other sites

MOAR struts!!

I don't like to use struts, first of all because I want to be able to do an automated recovery mission (no possibility of going EVA and using KAS to attach struts)

and second of all I'm kinda OCD about my satellites and I don't like strut end points to stay attached to them after release

Link to comment
Share on other sites

Alright, as this would have to be it's own mod rather then part of AGX, I'll reply here.

This is actually quite possible, with a couple largish hurdles to be aware of.

The easy part is actually disabling actions, simply find the BaseAction and set it's .active property to false. That will prevent that action from doing anything. Note however that this also hides the action from the "available actions list" in the default KSP editor and in AGX's actions list as well.

Then renable the action by changing that .active field back to true when you want to turn everything back on. This will even work for things such as lights that default assign to a group. If that light's "Turn On" BaseAction.active =false, it will not turn on when the L key is pressed.

The first hurdle is that in code you can't grab "this part of the vessel", you have to walk the parts based on their connections to each other. Most of the time simply saying "from this sleep mode part, find all child parts" will work, but that assumes that a) you want to turn off all parts on that side of the sleep-mode part (so no in-line cargo as part of the mothership) and B) the root part of the vessel is on the other side of the part.

The second hurdle is that not everything you want to turn off can be turned off this way. Notably, I don't think this method would turn off RCS blocks as while the RCS system turns on/off based on the RCS action group, everything else is contained in the RCS system code. So some custom code would have to be written for that. Easy enough to do, just a matter of tracking down everything that needs custom code to work this way.

Then to integrate, on the sleep-mode part, simply make a standard action using the [KSPAction] property and it will be picked up by KSP as any other action.

If someone wants to try I'm certainly will to answer questions, but I've got too many mods on the go already to take on another.

D.

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