Support Multiple airlocks in UMmu

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,704
Reaction score
2,681
Points
203
Location
Dallas, TX
I have run into this on several vessels that I have been working on. If the vessel has more than 1 door. Like a car.
I know you can set multiple airlocks.
Code:
void carvessel::SetUMMUAirlockPos(void)
{
    int AirlockStatus=Crew.GetAirlockDoorState();
    Crew.SetActiveDockForTransfer(iActiveDockNumber);
    switch(iActiveDockNumber)
    {

    case 0:    door0
        Crew.DefineAirLockShape(TRUE,-10,10,-10,10,-10,10);// Start X, End X, Start Y,End Y,Start Z,End Z. Center is 0 // MinX, MaxX, MinY,MaxY,MinZ,MaxZ.//    
        Crew.SetMembersPosRotOnEVA(_V(-5.0, 1.17, -0.4),_V(0,270,0));    
        
        doorselected=0;
        break;



    case 1:    // door2
        Crew.DefineAirLockShape(TRUE,-10,10,-10,10,-10,10);// Start X, End X, Start Y,End Y,Start Z,End Z.    Center is 0            
        Crew.SetMembersPosRotOnEVA(_V(5.5, 1.17, -0.4),_V(0,90,0));    

        doorselected=1;
        break;
Then selected them and then press D and set the animation to the airlock condition. So if one selects door 1 and press D then door 1 opens and the airlock is open.
Code:
if(key==OAPI_KEY_D&&!KEYMOD_SHIFT(kstate)&&!KEYMOD_CONTROL (kstate))
    {        
    //
        Crew.SetAirlockDoorState(!Crew.GetAirlockDoorState());
        // display state
        if (doorselected==0)
            {RevertDOOR2 ();
        if(Crew.GetAirlockDoorState()==TRUE)
            strcpy(SendHudMessage(),"Left Airlock is now open");    
        else
            strcpy(SendHudMessage(),"Left Airlock is now closed");
        }

    
if (doorselected==1)
{RevertDOOR1();
if(Crew.GetAirlockDoorState()==TRUE)
            strcpy(SendHudMessage(),"Right Airlock is now open");    
        else
            strcpy(SendHudMessage(),"Right Airlock is now closed");

    }



    }





Then you save the state of the door and match the airlock. So if door1 is open then the airlock is open.

Code:
if (DOOR1_proc<.1)Crew.SetAirlockDoorState(TRUE);
if (DOOR2_proc<.1)Crew.SetAirlockDoorState(TRUE);



No problems with 1 door/airlock. The problem I have is with more than 1.

So if door 1 is open on exiting. When you restart Door 1 is open and so is the airlock. So if you switch to door 2 and open it. It closes the airlock. From all the code it looks like one 1 airlock can be open. Am I wrong?
 

n122vu

Addon Developer
Addon Developer
Donator
Joined
Nov 1, 2007
Messages
3,196
Reaction score
51
Points
73
Location
KDCY
I believe this is correct, based on my experience with UMMU airlocks on the Cortez.

if you switch to door 2...
At this point, as far as UMMU is concerned, you've now made 'Door 2' the active airlock.
Only the active airlock can be open.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,704
Reaction score
2,681
Points
203
Location
Dallas, TX
Thought as much. Thanks. That is why I don't like the save the airlock state. Or not have them sync with the animation which seems illogical.

So I need to add if door 1 is open." must shut door before opening another". Then the door and airlock would be in sync.
 
Top