Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Addons > Addon Support & Bugs
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Addon Support & Bugs Support & bug reports for Orbiter addons.

Reply
 
Thread Tools
Old 02-28-2017, 11:11 PM   #1
gattispilot
Addon Developer
 
gattispilot's Avatar
Default Multiple Dock crew Transfer UMMU

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
gattispilot is offline   Reply With Quote
Old 02-28-2017, 11:23 PM   #2
jedidia
shoemaker without legs
 
jedidia's Avatar
Default

Quote:
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;
jedidia is offline   Reply With Quote
Thanked by:
Reply

  Orbiter-Forum > Orbiter Addons > Addon Support & Bugs


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 08:03 AM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.