Question Multiple Dock crew Transfer UMMU

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
5,740
Reaction score
58
Points
123
Location
Dallas, TX
So is there a way to transfer crew to other vessels docked?

I know you can change the airlocks. But the crew always transfer to dock1.

Code:
void TESTVC::SetUMMUAirlockPos(void)
{
	int AirlockStatus = Crew.GetAirlockDoorState();
	Crew.SetActiveDockForTransfer(iActiveDockNumber);
	switch (iActiveDockNumber)
	{
	case 0:	//LEFT
		Crew.DefineAirLockShape(AirlockStatus, -6, -2, -4, 3, 6, 9);
		Crew.SetMembersPosRotOnEVA(_V(-4.5, 1.179, 7.6), _V(0, -1.5, 0));

		
		break;
	case 1:	//RIGHT
		Crew.DefineAirLockShape(AirlockStatus, 6, 2, -4, 3, 6, 9);
		Crew.SetMembersPosRotOnEVA(_V(4.5, 1.179, 7.6), _V(0, 1.5, 0));
		
		break;
	case 2:	//top
		Crew.DefineAirLockShape(AirlockStatus, 1, -1, -4, 3, -1, 1);
		Crew.SetMembersPosRotOnEVA(_V(0, 5.5, 0), _V(0, 1.5, 0));
		
		break;
	case 3:	//top
		Crew.DefineAirLockShape(AirlockStatus, 1, -1, -4, 3, -1, 1);
		Crew.SetMembersPosRotOnEVA(_V(0, 1.179, 0), _V(0, 1.5, 0));
		
		break;
	}
}
Sets the airlock
Code:
else if (key == OAPI_KEY_N)// SELECT
	{
		DOCKSELECTED = DOCKSELECTED + 1;

		if (DOCKSELECTED == 1)(iActiveDockNumber == 0); 
		if (DOCKSELECTED == 2)(iActiveDockNumber == 1);
		if (DOCKSELECTED == 3)(iActiveDockNumber == 2);
		if (DOCKSELECTED == 4)(iActiveDockNumber == 3);
		SetUMMUAirlockPos();
Code:
else if (key == OAPI_KEY_BACKSLASH)
	{
		//
		Crew.SetAirlockDoorState(!Crew.GetAirlockDoorState());
		// display state
		SetUMMUAirlockPos();
		if (DOCKSELECTED == 1)
		{
			//RevertDOOR();
			//doorselected = 1;
			//iActiveDockNumber = 1;
			//	SetUMMUAirlockPos();
			if (Crew.GetAirlockDoorState() == TRUE)
				strcpy(SendHudMessage(), "Dock1 Airlock is now open");
			else
				strcpy(SendHudMessage(), "Dock1 Airlock is now closed");
			RevertDOCK1();
		}


---------- Post added at 05:11 PM ---------- Previous post was at 06:04 AM ----------

Ok. Iactive Dock was not changing.
Code:
		if (DOCKSELECTED == 1)(iActiveDockNumber = 0); 
		if (DOCKSELECTED == 2)(iActiveDockNumber = 1);
		if (DOCKSELECTED == 3)(iActiveDockNumber = 2);
		if (DOCKSELECTED == 4)(iActiveDockNumber = 3);
Fixed
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
9,366
Reaction score
83
Points
138
Location
between the planets
Code:
if (DOCKSELECTED == 1)(iActiveDockNumber = 0); 
		if (DOCKSELECTED == 2)(iActiveDockNumber = 1);
		if (DOCKSELECTED == 3)(iActiveDockNumber = 2);
		if (DOCKSELECTED == 4)(iActiveDockNumber = 3);
You know, you should really do this as a switch or if - else if block. It's much more readable, as multiple if-statements do not imply an either/or choice.

Or just do this:
Code:
iActiveDockNumber = DOCKSELECTED - 1;
 
Top