Jump to content

[1.9.*, 1.10.*, 1.11.*] DockRotate - lightweight robotics - rotational control on docking ports (plus NodeRotate, make any part rotate)


peteletroll

Recommended Posts

 

I have a brief kOS script that watches the craft throttle and changes the rotation speed of the rotors so that the rotor speed is effectively controlled by throttle.  This works fine for simple craft.

But, now I have a more complex craft that has other engines, I want to be able to action group the on off so I can be throttling engines, or throttling rotors, or both.

I could work around this by toggling the rotors through an action group via kOS.  This is not elegant as it means the generic rotate-by-throttle script now needs to be action group aware for the specific craft.

Link to comment
Share on other sites

I have noticed that when rotating then stopping it at some random point, the angle is an uneven number. (not a complete step increment) Thus when restaring the rotation its no longer able to stop at even, descreet increments. Would it be possible to have either a return to origin button or better yet a way to type in the figures manually to correct for the disparity?

 

Keep in mind that DR is working as advertised, just that minor issue can make re-centering harder.

Link to comment
Share on other sites

The craft is gone but I figured out why I was having the issue. Little back story. I was trying to make a rover with a rotating "head" like curiosity, so that it would be folded away and then deployed when landed. Also had a nech that could turn. I needed small docking ports to make the hinges small enough and Tweakscale didn't work on the base game ones so I used one from Near Future Construction and set it to the smallest it can go. The problem I'm facing is small parts and gravity. Unfortunately if the docking ports are set to the small size that I need, they cant handle much if any weight, and end up visibly disconnecting. The actual ports stay connected but one of them sags down a good amount. If only there was a mod for tiny hinges. This is also an issue because of the neck area, the hinges bounce then merge into the truss and then everything is misaligned. I would post a pic but I cant figure out how to.

Edited by Cosmic920
Link to comment
Share on other sites

This is great, it wasn't exactly what I was expecting but I can see why you've done that and I can make it work.
I need to bind Enable with Rotate Clockwise, and Disable with Stop - and then it turns out just fine.  Thankyou.

In relation to making it better with kOS, kOS can interact with any of the events/fields/actions in the part menu.  This is all the information that we can get, so the better and clearer the information there, the easier it is to manipulate via code.  Although it is possible to read the "angle" field and parse it to guess as to what the port is doing, DockRotate would be a bit easier to manipulate in simple scripts if menu options were disabled when they don't make sense to be enabled, and the angle field was perhaps split into several fields.  For example, Stop Rotation only makes sense when the part is moving.  In continuous rotation mode, being able to see the Rotate Clockwise (+) when already rotating clockwise I think does nothing, so if it wasn't available it would be an easier indication of current state.  Take a look at a retractable solar panel for how the Status field gives useful information, Sun Exposure and Energy Flow are separate fields, and the Extend and Retract options are only available when they make sense.  If "angle" was replaced with for example "Current Angle", "Current Speed", and "Status" (Stopped|Stopping|Started|Starting) it would be simpler.  That said, none of this stops me doing what I want with Dock Rotate presently.

Link to comment
Share on other sites

Has anyone noticed that the rotate + and rotate - buttons seems to be missing?  Was this removed recently or are they gone for some other reason?

ksp_dockrotate_menu.png

 

EDIT: Not all of my docking ports seem to have this missing...  I'm very confused, can it be that ports that were in-flight prior to installing the mod may not get the extra dock rotate stuff?  Yet I do still see the 'Rotation' button to enable/disable rotation features on the above port.

Edited by cjones
new info
Link to comment
Share on other sites

10 hours ago, cjones said:

Has anyone noticed that the rotate + and rotate - buttons seems to be missing?

The + and - buttons appear only when the docking port is properly connected to another. Is this the case?

Currently, the configuration control are always available, while the motion controls appear only when ports are coupled. This changed a few weeks ago: previously rotation configuration was available only when rotation was possible.

Edited by peteletroll
Link to comment
Share on other sites

OK @Redacted, too many mods... I will need your help.

You'll have the questionable honor to be the first to experiment DockRotate remote debugging infrastructure ;).

1) go to the DockRotate directory, delete DockRotate.dll and rename DockRotate.debugdll to DockRotate.dll;

2) start KSP, and go to a vessel that has the bug;

3) go to a couple of ports that has the bug, and activate "Verbose Events" on both ports via right-click;

4) timewarp a few seconds, then exit timewarp, exit KSP, and share the resulting KSP.log.

Thanks for your cooperation!

Link to comment
Share on other sites

2 hours ago, peteletroll said:

OK @Redacted, too many mods... I will need your help.

You'll have the questionable honor to be the first to experiment DockRotate remote debugging infrastructure ;).

1) go to the DockRotate directory, delete DockRotate.dll and rename DockRotate.debugdll to DockRotate.dll;

2) start KSP, and go to a vessel that has the bug;

3) go to a couple of ports that has the bug, and activate "Verbose Events" on both ports via right-click;

4) timewarp a few seconds, then exit timewarp, exit KSP, and share the resulting KSP.log.

Thanks for your cooperation!

I’ll give this a spin tomorrow and post the results for you. (screen shots most likely) If i can find the saved log I’ll post this as well. However that being said, last time i looked for a log, the one i found was HUGE and thus not possible to share without a 3rd party site. I’ll just reuse that save file i sent you earlier as it loads right into the error. Should make it easy, i hope.

Side note: Would it be possible to have the Docking Ports use manually saved set-points? Or to put it another way, have the port remember a saved position (s) and toggle to this using the action groups. (think chained animation)  Something like this would allow multiple docking ports to move in unison and possibly allow for a unit to walk if the toggles are setup correctly. Currently i can use action groups toggles but only rotate to a preset number of degrees per the toggle activation. While this works well, its rather limited and can’t be safely triggered while the craft is under acceleration. Case-in-point, the video i posted, that crafts motors are mounted to allow dual flight configurations. However this can’t be changed while the engines are active due to massive shifts in CG and thrust. Being able to use preset positions could allow a craft to “transform” while accelerating.

Edited by Redacted
Link to comment
Share on other sites

17 minutes ago, Redacted said:

I’ll give this a spin tomorrow and post the results for you. (screen shots most likely)

Screenshots are unfortunately useless in this case: I need the log.

 

19 minutes ago, Redacted said:

Would it be possible to have the Docking Ports use manually saved set-points?

This is something I've been thinking about, but it's quite difficult to design an easy interface for it.

Can you elaborate on how set points could help with your (extremely cool) lander?

Link to comment
Share on other sites

For my case, saving and reloading does not seem to do anything.  From what I have seen so far, it appears that new docking ports work OK, but older ones that used to work do not.

I looked at the save file and compared the ModuleDockRotate between ports I knew worked and ports that did not but could not see any difference.  I have a new ship in orbit that was launched in 2 parts and assembled in orbit; it was assembled in orbit with a sort of 'tug' ship that has been in space since forever.  The ports on the new ship  connecting the 2 new pieces together rotate, but the new ports on this new ship where the tug is docked do NOT rotate.  Not sure if that helps...  Maybe something with existing ports when I upgraded the plugin?

Link to comment
Share on other sites

Output_Log: https://drive.google.com/file/d/1GFPkMmVEY9l7uv62ECyQ620bmnhMzx40/view?usp=sharing

Note: During the test i was unable to force another failure. Now as recommended, I toggled back and forth several times and even used the ports under physics-warp conditions. It's possible that the failure take place during the transition between various units or where multiple units are docked and un-docked. I'll keep the Verbose mode active and dump the log should I see another failure.

Edited by Redacted
Link to comment
Share on other sites

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