So on the action area. Not sure how to fix other than putting all action areas in one vessel?That's because the nearest action area (and airlock) logic gets the nearest vessel first, then it returns the nearest action area in it. This will not always yield the actual nearest action area, because it's possible that an action area in a far vessel is nearer than an action area in the nearest vessel.
What are you trying to do exactly? If I understood correctly, you have a vessel with several airlock, then you have an astronaut in range, and when you're inside the astronaut and press Ctrl + I nothing happens. Is this true? If so, you must be in either nearest or vessel HUD mode to ingress. If you pressed Ctrl + I and the ingress is not successful, an error message must appear. What's the error message?
As for the CTD, you must verify that the output of the GetAttachmentHandle method is not null, otherwise you will have an CTD when you call GetAttachmentStatus. Also, you must call GetAttachmentStatus for the vessel that has the attachment handle, NOT your vessel. A proper code will be like this:
I am not sure about your code design, but I think you should also verify if the focus vessel is actually the vessel you want.C++:VESSEL* v = oapiGetFocusInterface(); vAttachHandle = v->GetAttachmentHandle(true, 1); if (vAttachHandle && GetAttachmentStatus(vAttachHandle))
So the guy is at the action area zone of LPAd4 vessel. But can't do anything as it doesn't recognize the area?
On the attachment
OBJHANDLE hV = oapiGetFocusObject();
VESSEL* v = oapiGetFocusInterface();
UMMU1 = v->GetAttachmentHandle(true, 1);
if (GetAttachmentStatus(UMMU1))
This is for an action area.
I think the focusObject is the UACS guy. It see if attached or not if not then do something.
On the airlock. I have this:
UACS::AirlockInfo airInfo, airInfo1, airInfo2, airInfo3, airInfo4, airInfo5;
airInfo.name = "Front";
airInfo.pos = { 0,-1.948,5 };
airInfo.dir = { 0,0,-1 };
airInfo.rot = { -1,0,0 };
//airInfo.hDock = CreateDock({ 0,-1, -1 }, { 0,-1,0 }, { 0,0,-1 });
airInfo1.name = "Aft";
airInfo1.pos = { 0,-1.948,-5 };
airInfo1.dir = { 0,0,-1 };
airInfo1.rot = { -1,0,0 };
//airInfo1.hDock = CreateDock({ 0,-1, -1 }, { 0,-1,0 }, { 0,0,-1 });
airInfo2.name = "T_Pad_Left";
airInfo2.pos = { -39,-3.85,-1 };
airInfo2.dir = { 0,0,-1 };
airInfo2.rot = { -1,0,0 };
//airInfo2.range = { 5 };
airInfo3.name = "T_Pad_Right";
airInfo3.pos = { 39,-3.85,-1 };
airInfo3.dir = { 0,0,-1 };
airInfo3.rot = { -1,0,0 };
//airInfo3.range = { 5 };
airInfo4.name = "A_Pad_Left";
airInfo4.pos = { 12,-11.234,89 };
airInfo4.dir = { 0,0,-1 };
airInfo4.rot = { -1,0,0 };
//airInfo4.range = { 5 };
airInfo5.name = "A_Pad_Right";
airInfo5.pos = { -12,-11.234,-89 };
airInfo5.dir = { 0,0,-1 };
airInfo5.rot = { -1,0,0 };
//airInfo5.range = { 5 };
//airInfo.gndInfo.pos = { -1.7,-4.05, -2.7 };
vslAstrInfo.airlocks.push_back(airInfo);
vslAstrInfo.airlocks.push_back(airInfo1);
vslAstrInfo.airlocks.push_back(airInfo2);
vslAstrInfo.airlocks.push_back(airInfo3);
vslAstrInfo.airlocks.push_back(airInfo4);
vslAstrInfo.airlocks.push_back(airInfo5);
but it says the airlock is open and I have crew guy and I get no error message. but the guy can't exit.
vslAstrInfo.airlocks.at(0).open = DOOR_proc >= 1;//FRONT
vslAstrInfo.airlocks.at(1).open = DOOR1_proc >= 1;//AFT
vslAstrInfo.airlocks.at(2).open = APAD_proc >= 1;//APAD
vslAstrInfo.airlocks.at(3).open = TPAD_proc >= 1;//TPAD
airlock status is based off animation. I would like to change this so if doors are starting to open then airlock is open.
if (key == OAPI_KEY_D && !KEYMOD_SHIFT(kstate) && !KEYMOD_CONTROL(kstate))
{
if (astrHUD.airlockIdx == 0) RevertDOOR();//right
if (astrHUD.airlockIdx == 1) RevertDOOR1();//left
if (astrHUD.airlockIdx == 2) Revertapadairlock();//right
if (astrHUD.airlockIdx == 3) Reverttpadairlock();//left
// if (astrHUD.airlockIdx == 2)vslAstrInfo.airlocks.at(2).open = 1;//FRONT
// if (astrHUD.airlockIdx == 3)vslAstrInfo.airlocks.at(2).open = 1;//FRONT
return 1;
}
Not sure if it matters but the vessel is attached? But here it shows Apad open and pressing ALT and I gets no response
Attachments
Last edited: