- Joined
- Feb 2, 2012
- Messages
- 1,667
- Reaction score
- 104
- Points
- 78
pseudocode:
Code:int MyVessel::GetDockingPort(DOCKHANDLE hDock){ for(UINT i=0;i<DockCount();i++){ if(GetDockHandle(i)==hDock) return i; } return -1; } int MyVessel::OtherVesselGetDockingPort(OBJHANDLE h_OtherVessel, DOCKHANDLE hDock){ VESSEL *otherVessel; otherVessel=oapiGetVesselInterface(h_OtherVessel); for(UINT i=0; i<otherVessel->DockCount();i++){ if(otherVessel->GetDockHandle(i)==hDock) return i; } return -1; } int VESSEL::MyOapiDock(OBJHANDLE target, DOCKHANDLE myDock, DOCKHANDLE tgtDock, UINT mode){ return Dock(target,GetDockingPort(myDock),otherVesselGetDockingPort(target,tgtDock,mode); }
plus all the safety checks to be included.
The other difference is that moving an attachment point is easy and works, while moving docking port is difficult. So if I want to "move" stages or payloads to fine tune the setup of my rocket I can't do it.
This code above properly written actually works... but still I see other advantages in the attachments apis: the attachment is not automatic while docking is (if I understand it right), so it is much more controllable by the developer, it has also the id string that can be checked, it's really "stable" when deleting attachments (while I experience some CTDs when deleting docking ports), and as said point movement is easy and smooth with attachments so if I want to build a vehicle with various stages I can connect them and then slightly move the points at runtime to make the match perfect.
I think that is all. :tiphat:
---------- Post added 3rd Nov 2018 at 15:03 ---------- Previous post was 2nd Nov 2018 at 22:09 ----------
And I am experiencing this issue (deletion of multiple docking ports brings to CTD)
https://www.orbiter-forum.com/project.php?issueid=921
which is a show stopper for me. If I have 12 boosters to jettison at the same time I have to delete 12 docking ports at the same time and it must work to make this thing worth the effort
---------- Post added at 20:22 ---------- Previous post was at 15:03 ----------
Maybe a "stage attachment" type of connection is needed, which behaves exactly like a docking port, but has its own port numbers and deletes automatically if not attached to something (either at scenario start, as with a core with optional boosters that aren't attached, or if detached in flight, as with a staging sequence)?
I have to say that at first I thought this was crazy... but...
I made a test using a custom type of connection. Basically the system keeps all the vessels at the right place by updating the vesselstatus of each one and in the meantime it transfers to the main vessel the forces applied to the single vessels... what if I tell you that it works quite good? it could be a custom attachment/docking system which works as fine as I would like it to do....