if(TCARSTA1_status==DOOR_UP && TCARSTA2_status==DOOR_UP)
{
double da = simdt * (LIFT_SPEED/4);
PlayVesselWave3(LP15PSoundID,doorsound2);
if (TCAR1_status == DOOR_RAISING)
{
if (TCAR1_proc > 0.0)
{
//BUGA = InsertMesh ("LP3RINGDOOR_C",BUGA,0);
//SetMeshVisibilityMode (BUGA, MESHVIS_ALWAYS);
//BUGB = InsertMesh ("LP3DOOR_C",BUGB,0);
//SetMeshVisibilityMode (BUGB, MESHVIS_ALWAYS);
TCAR1_proc = max (0.0, TCAR1_proc-da);
// -23.03538,0,-22.31242
RevertTCARLIGHT();
SetAttachmentParams(TCAR1,_V( 360.4942+(-155.7151*TCAR1_proc),1.8,357.065+(95.7093*TCAR1_proc)), _V(0,1,0), _V(-0.851929436034248,0,0.523656601236314));
}
else
{
TCAR1_status = DOOR_UP;
//BUGA = InsertMesh ("LP3RINGDOOR_A",BUGA,0);
//SetMeshVisibilityMode (BUGA, MESHVIS_ALWAYS);
//BUGB = InsertMesh ("LP3DOOR",BUGB,0);
//SetMeshVisibilityMode (BUGB, MESHVIS_ALWAYS);
DetachChild(TCAR1,0);
RevertTCARSTA1();
oldsimt=simt;
}
}
else
{
if (TCAR1_proc < 1.0)
{
//BUGA = InsertMesh ("LP3RINGDOOR_C",BUGA,0);
//SetMeshVisibilityMode (BUGA, MESHVIS_ALWAYS);
//BUGB = InsertMesh ("LP3DOOR_C",BUGB,0);
//SetMeshVisibilityMode (BUGB, MESHVIS_ALWAYS);
TCAR1_proc = min (1.0, TCAR1_proc+da);
SetAttachmentParams(TCAR1,_V( 360.4942+(-155.7151*TCAR1_proc),1.8,357.065+(95.7093*TCAR1_proc)), _V(0,1,0), _V(-0.851929436034248,0,0.523656601236314));
//if (TCAR1_proc < 1.0){
//RevertTCARLIGHT();
//}
}
//29.86741,0.0,47.13026
else
{
TCAR1_status = DOOR_DOWN;
//BUGA = InsertMesh ("LP3RINGDOOR_A",BUGA,0);
//SetMeshVisibilityMode (BUGA, MESHVIS_ALWAYS);
//BUGB = InsertMesh ("LP3DOOR",BUGB,0);
//SetMeshVisibilityMode (BUGB, MESHVIS_ALWAYS);
DetachChild(TCAR1,0);
RevertTCARSTA2();
oldsimt=simt;
}
}
SetAnimation (anim_TCAR1, TCAR1_proc);
RevertTCARLIGHT();
}
}
if ((TCAR1_proc>0.0)||(TCAR1_proc < 1.0)){
if (TCARLIGHT_status >= DOOR_RAISING)
{
double da = simdt * (LIFT_SPEED*2.8);
if (TCARLIGHT_status == DOOR_RAISING) {
if (TCARLIGHT_proc > 0.0) TCARLIGHT_proc = max (0.0, TCARLIGHT_proc-da);
else TCARLIGHT_status = DOOR_UP;
} else {
if (TCARLIGHT_proc < 1.0) TCARLIGHT_proc = min (1.0, TCARLIGHT_proc+da);
else TCARLIGHT_status = DOOR_DOWN;
}
SetAnimation (anim_TCARLIGHT1, TCARLIGHT_proc);
SetAnimation (anim_TCARLIGHT2, TCARLIGHT_proc);
}
}
static UINT TcarGroup1[17]={GRP_TCARLP1A,GRP_TCARLP1B,GRP_TCARLP1C,GRP_TCARLP1J,GRP_TCARLP1E,GRP_TCARLP1F,GRP_TCARLP1G,GRP_TCARLP1H,GRP_TCARLP1I,GRP_TCARLP1DOOR2D,GRP_TCARLP1DOOR2C,GRP_TCARLP1DOOR1A,GRP_TCARLP1DOOR1B,GRP_TCARLP1DOOR3A,GRP_TCARLP1DOOR3B,GRP_TCARLP1DOOR2A,GRP_TCARLP1DOOR2B,};
static MGROUP_TRANSLATE tcar1(0,TcarGroup1, 17,_V(258.98971,0,217.92158));
anim_TCAR1 = CreateAnimation (0);
AddAnimationComponent (anim_TCAR1, 0, .7, &tcar1);
static UINT TcarGroup1A[17]={GRP_TCARLP1A,GRP_TCARLP1B,GRP_TCARLP1C,GRP_TCARLP1J,GRP_TCARLP1E,GRP_TCARLP1F,GRP_TCARLP1G,GRP_TCARLP1H,GRP_TCARLP1I,GRP_TCARLP1DOOR2D,GRP_TCARLP1DOOR2C,GRP_TCARLP1DOOR1A,GRP_TCARLP1DOOR1B,GRP_TCARLP1DOOR3A,GRP_TCARLP1DOOR3B,GRP_TCARLP1DOOR2A,GRP_TCARLP1DOOR2B,};
static MGROUP_ROTATE tcar1A(0,TcarGroup1A, 17,_V( 284.3332,0,240.8417), _V(0,1,0),(float)(90*RAD));
// static MGROUP_ROTATE light (0,EGrp4, 2, _V(.007,0,-.616), _V(0,1,0), (float)(360*RAD));
// anim_TCAR1A = CreateAnimation (0);
AddAnimationComponent (anim_TCAR1, .7, .75, &tcar1A);
static UINT TcarGroup1B[17]={GRP_TCARLP1A,GRP_TCARLP1B,GRP_TCARLP1C,GRP_TCARLP1J,GRP_TCARLP1E,GRP_TCARLP1F,GRP_TCARLP1G,GRP_TCARLP1H,GRP_TCARLP1I,GRP_TCARLP1DOOR2D,GRP_TCARLP1DOOR2C,GRP_TCARLP1DOOR1A,GRP_TCARLP1DOOR1B,GRP_TCARLP1DOOR3A,GRP_TCARLP1DOOR3B,GRP_TCARLP1DOOR2A,GRP_TCARLP1DOOR2B,};
static MGROUP_TRANSLATE tcar1B(0,TcarGroup1, 17,_V(80.3752,0,-110.4624));
// anim_TCAR1 = CreateAnimation (0);
AddAnimationComponent (anim_TCAR1, .75, 1, &tcar1B);
if (TCAR1_proc < 0.71)
{
SetAttachmentParams(TCAR1,_V( 25.34349+(258.98971*TCAR1_proc),-.4,22.92012+(217.92158*TCAR1_proc)), _V(0,1,0), _V(0.765165905758848,0,0.643833159028207));
}
if ((TCAR1_proc > 0.75)&&(TCAR1_proc < 0.76))//284.3332,0,240.8417
{
SetAttachmentParams(TCAR1,_V( 284.3332+(80.3752*TCAR1_proc),-.4,240.8417+(-110.4624*TCAR1_proc)), _V(0,1,0), _V(0.535384487298246,0,0.844608460033639));
}
RequestLoadVesselWave3(CNGA3SoundID,DESIGNATION,"Sound\\1999\\DESIGNATION.wav",INTERNAL_ONLY);
RequestLoadVesselWave3(CNGA3SoundID,DESIGNATIONACCEPTED,"Sound\\1999\\DESIGNATIONACCEPTED.wav",INTERNAL_ONLY);
if(ActionAreaReturnCode==5)// at COMPUTER
{
OBJHANDLE hV=oapiGetFocusObject();
VESSEL *v=oapiGetFocusInterface();
UMMU1=v->GetAttachmentHandle(true,1);
if(GetAttachmentStatus(UMMU1))
{
if(!_strnicmp(dest,"1",1))
{
PlayVesselWave3(CNGA3SoundID,DESIGNATIONACCEPTED);
RevertTCAR1();
strcpy(dest,"");
}
}
else
{
if(!_strnicmp(dest,"",1))
{
PlayVesselWave3(CNGA3SoundID,DESIGNATION);
oapiOpenInputBox("Your destination (1, or 2)? 1-NGA3 2-Nowhere",ChoiceBox,0,2,(void*)this);
}
RequestLoadVesselWave3(CNGA3SoundID,DESIGNATION,"Sound\\1999\\DESIGNATION.wav",BOTHVIEW_FADED_FAR);
Crew.DeclareActionArea(0,_V( 1.21512,0,55.69981),6,TRUE,"door1c.wav","Open/Close Doors ");
Crew.DeclareActionArea(1,_V( 10.82566,0,82.56007),6,TRUE, "door1c.wav","Open/Close Doors");
#include "orbitersdk.h"
#include "UCGOCargoSDK.h" //UCGO 2.0 copy past this line
#include "UMmuSDK.h"
#define doorsound 1
#define undocksound 2
#define reqdoor 3
#define doorsound2 4
#define DESIGNATION 5
#define DESIGNATIONACCEPTED 6
CNGA3SoundID=ConnectToOrbiterSoundDLL3(GetHandle());
SoundOptionOnOff3(CNGA3SoundID,PLAYMAINTHRUST,FALSE);
SoundOptionOnOff3(CNGA3SoundID,PLAYHOVERTHRUST,FALSE);
SoundOptionOnOff3(CNGA3SoundID,PLAYATTITUDETHRUST,FALSE);
SoundOptionOnOff3(CNGA3SoundID,PLAYCOUNTDOWNWHENTAKEOFF,FALSE);
SoundOptionOnOff3(CNGA3SoundID,PLAYCABINAIRCONDITIONING,FALSE);
SoundOptionOnOff3(CNGA3SoundID,PLAYCABINRANDOMAMBIANCE,FALSE);
SoundOptionOnOff3(CNGA3SoundID,PLAYRADIOATC,FALSE);
SoundOptionOnOff3(CNGA3SoundID,DISPLAYTIMER,FALSE);
RequestLoadVesselWave3(CNGA3SoundID,doorsound,"Sound\\1999\\door1b.wav",INTERNAL_ONLY);
RequestLoadVesselWave3(CNGA3SoundID,doorsound2,"Sound\\1999\\keydoor.wav",BOTHVIEW_FADED_FAR);
RequestLoadVesselWave3(CNGA3SoundID,undocksound,"Sound\\1999\\compsound.wav",INTERNAL_ONLY);
RequestLoadVesselWave3(CNGA3SoundID,reqdoor,"Sound\\1999\\reqdoor.wav",INTERNAL_ONLY);
ReplaceStockSound3(CNGA3SoundID,"Sound\\1999\\aircond.wav",REPLACE_AIR_CONDITIONNING);
RequestLoadVesselWave3(CNGA3SoundID,DESIGNATION,"Sound\\1999\\DESIGNATION2.wav",BOTHVIEW_FADED_FAR);
RequestLoadVesselWave3(CNGA3SoundID,DESIGNATIONACCEPTED,"Sound\\1999\\DESIGNATIONACCEPTED.wav",BOTHVIEW_FADED_FAR);
RequestLoadVesselWave3(CNGA3SoundID,ENG,"Sound\\Vessel\\LASERTANK\\Tank-go.wav",BOTHVIEW_FADED_FAR);
if(ActionAreaReturnCode==6 )//at nga3
{
// do something cool here, doors animation, system activation or repairing etc. Etc.
[B]PlayVesselWave3(CNGA3SoundID,doorsound2);[/B]
if (TCAR1_status==DOOR_DOWN && TCARSTA3_status==DOOR_UP)//TCAR1 UP PRESENT TCAR 2 UP PRESENT DOOR CLOSED
{
RevertTCARSTA3();
oldsimt=simt;
}
else if (TCAR1_status==DOOR_DOWN && TCARSTA3_status==DOOR_DOWN)//TCAR1 UP PRESENT TCAR 2 UP PRESENT DOOR OPEN
{
RevertTCARSTA3();
oldsimt=0;
}
else if(TCAR1_status==DOOR_UP && TCARSTA3_status==DOOR_DOWN )//TCAR1 NOT AT COMPUTER SO MOVE
{
RevertTCAR1();
}
}[CODE]
if(key==OAPI_KEY_G)
{
PlayVesselWave3(LP4TUBEPSoundID,doorsound2);
}
if(ActionAreaReturnCode==0 )//at ring
{
// do something cool here, doors animation, system activation or repairing etc. Etc.
PlayVesselWave3(LP4TUBEPSoundID,doorsound2);
if (TCAR1_status==DOOR_UP && TCARSTA1_status==DOOR_UP)
{
RevertTCARSTA1();
oldsimt=simt;
}
else if(TCAR1_status==DOOR_UP && TCARSTA1_status==DOOR_DOWN )
{
RevertTCARSTA1();
oldsimt=0;
}
else if(TCAR1_status==DOOR_DOWN && TCARSTA1_status==DOOR_UP )
{
RevertTCAR1();
}
}
if(ActionAreaReturnCode==1)// at ring
{
OBJHANDLE hV=oapiGetFocusObject();
VESSEL *v=oapiGetFocusInterface();
UMMU1=v->GetAttachmentHandle(true,1);
if(GetAttachmentStatus(UMMU1))
{
if(!_strnicmp(dest,"1",1))
{
RevertTCAR1();
strcpy(dest,"");
}
}
else
{
if(!_strnicmp(dest,"",1))
{
oapiOpenInputBox("Your destination (1,2)? 1-LP3, 2-Nowhere",ChoiceBox,0,2,(void*)this);
}
else
{
if(!_strnicmp(dest,"1",1))// || !_strnicmp(dest,"2",1))
{
AttachUmmu1();//don't reset dest now!!!
}
if(!_strnicmp(dest,"2",1))
{
//do nothing then we have to reset dest.
strcpy(dest,"");
}
}
}
}
RequestLoadVesselWave3(JohnSoundID,START,"Sound\\1999\\action_doorClose.wav",BOTHVIEW_FADED_FAR);
if(ActionAreaReturnCode==4 )//at COMPUTER
{
// do something cool here, doors animation, system activation or repairing etc. Etc.
//PlayVesselWave3(JohnSoundID,doorsound2);
PlayVesselWave3(JohnSoundID,START);
if (TCAR1_status==DOOR_UP && TCARSTA2_status==DOOR_UP)//TCAR1 PRESENT AND DOOR OPEN
{
RevertTCARSTA2();
oldsimt=simt;
}
else if(TCARSTA2_status==DOOR_DOWN && TCAR1_status==DOOR_DOWN)//TCAR2 PRESENT AND DOOR OPEN AND TCAR1 PRESENT
{
RevertTCARSTA2();
oldsimt=0;
}
if(TCARSTA2_status==DOOR_UP && TCAR1_status==DOOR_DOWN)//TCAR2 PRESENT AND TCAR1 NOT PRESENT SO MOVE TCAR1
{
RevertTCAR1();
}
}
OrbiterSound 3.5 ver. May 13 2007 Log Started
***********************************************
Vessel NGA requested an ID, returned= 0 OK
Vessel NEWWP requested an ID, returned= 1 OK
Vessel ACT1 requested an ID, returned= 2 OK
Vessel DEPOT requested an ID, returned= 3 OK
Vessel tpad requested an ID, returned= 4 OK
Vessel JDome4 requested an ID, returned= 5 OK
Vessel FUELSTORE requested an ID, returned= 6 OK
Vessel CenturiL requested an ID, returned= 7 OK
Vessel CenturiM requested an ID, returned= 8 OK
Vessel EAGLE1 requested an ID, returned= 9 OK
Vessel ALPHABUGGY1 requested an ID, returned= 10 OK
Vessel ALPHABUGGY2 requested an ID, returned= 11 OK
Vessel NOSE2 requested an ID, returned= 12 OK
Vessel EAGLE2 requested an ID, returned= 13 OK
Vessel EAGLE3 requested an ID, returned= 14 OK
Vessel RMODULE2 requested an ID, returned= 15 OK
Vessel EAGLE2_NOSE requested an ID, returned= 16 OK
Vessel EAGLE4 requested an ID, returned= 17 OK
Vessel EAGLE4_NOSE requested an ID, returned= 18 OK
Vessel EAGLE4_MODULE requested an ID, returned= 19 OK
Vessel UMmu_99C-John_Koenig requested an ID, returned= 20 OK
MFD Requested an ID: UMmuRadio Assigned ID=0 OK
Vessel UMmu_99T-Marc_Kingsley requested an ID, returned= 21 OK
Vessel alpharing requested an ID, returned= 22 OK
Vessel UMmu_9DM3-Dr_Mattias requested an ID, returned= 23 OK
Vessel UMmu_99N1-Julianna_Harvey requested an ID, returned= 24 OK
Vessel UMmu_99N2-Kelly_Mac_Reilly requested an ID, returned= 25 OK
Vessel UMmu_99N3-Caroline_Loiseau requested an ID, returned= 26 OK
Vessel UMmu_99SB-Sandra_Benes requested an ID, returned= 27 OK
Vessel UMmu_99N4-Zoe_Prentis requested an ID, returned= 28 OK
Vessel MBATCAR requested an ID, returned= 29 OK
Vessel tcar2comp requested an ID, returned= 30 OK
attempting focus change...
Focus not ready bypassing focus change - Ok
Attempting RenderViewport initialisation...
Attempting GetStartValue initialisation...
Passed GetStartValue - Ok
Initialising directsound...
directsound initialised - OK
Passed RenderViewport - Ok
Attempting Mp3 initialisation...
MP3 found in playlist = 1
Mp3 initialised - Ok
Focus changed attempting to load vessel wave
Focus changed load vessel wave - OK
Attempting to load Mp3...
Mp3 loaded - OK
Attempting to play Mp3...
Mp3 is playing - OK
attempting focus change...
Attempting GetStartValue initialisation...
Passed GetStartValue - Ok
Focus changed attempting to load vessel wave
Focus changed load vessel wave - OK
focus changed - Ok
Attempting to close viewport...
Attempting to kill DirectSound...
DirectSound killed - OK
Passed CloseRenderViewport - Ok
Exited to Orbiter Launchpad - OK
Passed ExitModule - Ok