Jump to content

peteletroll

Members
  • Posts

    643
  • Joined

  • Last visited

Everything posted by peteletroll

  1. Maybe you can try to set the callbacks in OnAwake(). Works for me (TM). EDIT: but I'm working on a PartModule. Your situation could be different. EDIT AGAIN: or maybe OnStart() instead of Start().
  2. I don't know about onVesselsUndocking, but onPartUndock and onPartUndockComplete work for me.
  3. I'm adding a feature to DockRotate to save action group keys: if you press Alt (modifier key, right shift on Linux) all the rotation actions are reversed; for example, if "1" rotates a port clockwise, "Alt-1" will rotate it counterclockwise. Does any of you suggest a different key for action rotation reverse?
  4. @Trufiadok, you're changing directly a part transform, its position, so the part jumps. You have to move it slowly step by step. It should happen if you disable autostruts too. I think it's better to move parts by acting on the joints that connect them. Be patient, Unity Configurable joints are a complex beast.
  5. The way you made Canadarm work is amazing. Can't wait to see it in action.
  6. So, you're going to use the Canadarm to assemble the station in space? Is the Canadarm moving via DockRotate?
  7. We should start writing a tutorial about KSP - wife interaction managing techniques.
  8. ModuleManager generates a ModuleManager.ConfigCache file that contains all the info you need.
  9. Here's what I learned on the way while developing DockRotate. It took me a while to figure it out, so I'm collecting it all in one place, hoping it will be useful to other modders. Autostruts prevent part relative motion. This can be annoying if you WANT parts to move. Autostruts can be placed by the user. We could say that if a user places autostruts that cross moving joints it's their fault, and they should be more careful in the future. Landing legs are always autostrutted to heaviest part. The user has no way to disable it. So, if there's a moving joint between a landing leg and the heaviest part of a craft, the joint won't be able to move. The user should design the ship in a way that prevents such autostrut. This can be practically impossible. The quick-and-dirty solution: remove all autostruts The Part class has a ReleaseAutoStruts() method. If you call it on every part of a vessel, all autostruts will be gone, and every moving part will behave as expected. When the movement is done, a call to Vessel.CycleAllAutostrut() will restore them all. See releaseAllAutoStruts() and secureAllAutoStruts() here for an example. This works pretty well. But the autostrut free craft can break easier. The official solution: IJointLockState There actually is a moving part in stock KSP: the Advanced Grabbing Unit (AKA the Klaw) pivot joint can be unlocked to fix center of mass alignment. So, @SQUAD added a way to prevent autostruts from locking the joint. If a PartModule implements the IJointLockState interface, it will have a IsJointUnlocked() method. This must return true if the part has a moving joint: Vessel.CycleAllAutostrut() method will call it to know where NOT to put autostruts. (Many thanks to @sarbian and @Rudolf Meier for giving me pointers at this). If you want a part to move, you have to add a PartModule that implements IJointLockState. When it starts moving, you have to make IsJointUnlocked() return true and call Vessel.CycleAllAutoStrut(). When the movement is finished, make IsJointUnlocked() return false and call Vessel.CycleAllAutoStrut() again. Unfortunately, Vessel.CycleAllAutostrut() appears to have a bug: in a few cases IsJointUnlocked() is not called, and autostruts can lock moving joints anyway. I filed a bug report here: please upvote it if you like writing (and using) mods with moving parts! (and please @SQUAD fix it! We'll love you even more! ) The workaround: Smart Autostruts There's a way I found to make things work anyway: this! It's a hack, really. It iterates on all PartJoint objects in the physics bubble, and destroys joints across moving parts. It's not very efficient, but it works. It has a problem currently: it disables crossing regular struts too. But the user has full control over them, so it's not a big problem. That's the solution that DockRotate implements by default, until the IJointLockState bug is fixed. Please feel free to use my Smart Autostruts hack for your moving parts mods. If needed, I can refactor it in a separate file, to make using it easier. Happy hacking!
  10. This is something I'll have to experiment with. Yes! And the fact that they never went on with this scared me a lot when I began to work on DockRotate...
  11. That's what I used. I was unsure of the exact semantics of CycleAllAutoStrut(), so I used the Part.ReleaseAutoStruts() / Vessel.CycleAutoStruts() pair, that gave me the opportunity to experiment quite successfully with the "Smart Autostruts" feature. Feel free to "be inspired" by DockRotate code. I tried to understand Infernal Robotics code to solve problems I had with DockRotate, and I know your task as new mantainer is not easy at all, so, if my experience can be of any help...
  12. KSP actually has an API to remove and reenable autostruts: you can check out releaseAllAutoStruts() and secureAllAutoStruts() in DockRotate source. Smart autostruts are a hack I'm not entirely proud of, but it seems to work... I refactored it to make it easier to port to other mods.
  13. @jrbudda, sorry for being late at posting an appropriate GitHub issue, I've been away from home a few days. I'll try to reproduce the bug as soon as I can. Thanks for taking care anyway.
  14. I can probably help with autostruts. See DockRotate code, releaseCrossAutoStruts() method.
  15. New release! Still compiled on 1.4.1, but it should work with 1.4.2 and 1.4.3. Added @Psycho_zs parts, French and Spanish localization.
  16. Free return trajectories are more about maneuver precision than delta v. 1000 m/s should be more than enough from LKO.
  17. @Psycho_zs, I added MotorPoint to my github repository. the LICENSE.md file is updated to include a MIT license for MotorPoint; the texture paths in MotorPoint.cfg are updated to work with the DockRotate directory structure; I halved the resolution of model000.dds to limit the size of the download and the memory consumption. Let me know if you're OK with that, then I'll release!
  18. Thanks to the people who are contributing localizations: github users Cyphall for French and @fitiales for Spanish. More localizations are of course always welcome. Currently we have English, French, Italian, Spanish.
  19. @jrbudda, I found a KER bug some time ago - when and if you have time... EDIT: and many, many thanks for taking care of KER!
×
×
  • Create New...