I just noticed that only the big pods have problems... any difference to the smaller ones?
ORBITER-FORUM will be temporarily closed at 2026-07-23 18:00 UTC while we complete some OF maintenance tasks. The amount of downtime is expected to take up to one hour, but probably less.
CARGO1 = CreateAttachment(false, _V(0, -20.2, 1.12), _V(0, -1, 0), _V(0, 0, -1), "CARGO1",true);
CARGO2 = CreateAttachment(false, _V(0, -21.75, 1.12), _V(0, -1, 0), _V(0, 0, -1), "CARGO2", true);
CARGO3 = CreateAttachment(false, _V(-17.7, -10.15, 1.12), _V(-.866, -.5, 0), _V(0, -1, 0), "CARGO3", true);//-17.7 -10.15 1.12 -.866 -.5 0
CARGO4 = CreateAttachment(false, _V(-19.2, -11.0, 1.12), _V(-.866, -.5, 0), _V(0, -1, 0), "CARGO4", true);//-19.2 -11.0 1.12
CARGO5 = CreateAttachment(false, _V(-20.3, 0, 1.12), _V(-1, 0, 0), _V(0, 0, -1), "CARGO5", true);
CARGO6 = CreateAttachment(false, _V(-21.8, 0, 1.12), _V(-1, 0, 0), _V(0, 0, -1), "CARGO6", true);
CARGO7 = CreateAttachment(false, _V(-17.7, 10.15, 1.12), _V(-0.866, 0.5, 0), _V(0, 0, -1), "CARGO7", true);
CARGO8 = CreateAttachment(false, _V(-19.2, 11.0, 1.12), _V(-0.866, 0.5, 0), _V(0, 0, -1), "CARGO8", true);
CARGO9 = CreateAttachment(false, _V(0, 20.2, 1.12), _V(0, 1, 0), _V(0, 0, -1), "CARGO9", true);
CARGO10 = CreateAttachment(false, _V(0, 21.75, 1.12), _V(0, 1, 0), _V(0, 0, -1), "CARGO10", true);
CARGO11 = CreateAttachment(false, _V(17.7, 10.15, 1.12), _V(0.866, 0.5, 0), _V(0, 0, -1), "CARGO11", true);
CARGO12 = CreateAttachment(false, _V(19.2, 11.0, 1.12), _V(0.866, 0.5, 0), _V(0, 0, -1), "CARGO12", true);
CARGO13 = CreateAttachment(false, _V(20.3, 0, 1.12), _V(1, 0, 0), _V(0, 0, -1), "CARGO13", true);
CARGO14 = CreateAttachment(false, _V(21.8, 0, 1.12), _V(1, 0, 0), _V(0, 0, -1), "CARGO14", true);
CARGO15 = CreateAttachment(false, _V(17.7, -10.15, 1.12), _V(0.866, -0.5, 0), _V(0, 0, -1), "CARGO15", true);
CARGO16 = CreateAttachment(false, _V(19.2, -11.0, 1.12), _V(0.866, -0.5, 0), _V(0, 0, -1), "CARGO16", true);
if (PODSel == 1){
if (CARGO1_status >= RACK_RAISING) {
double da = simdt * .1;
if (CARGO1_status == RACK_RAISING) {
if (CARGO1_proc > 0.0) CARGO1_proc = max(0.0, CARGO1_proc - da);
else CARGO1_status = RACK_UP;
}
else {
if (CARGO1_proc < 1.0) CARGO1_proc = min(1.0, CARGO1_proc + da);
else CARGO1_status = RACK_DOWN;
}
if (CARGO1_status == RACK_UP)SendHudMessage("Rack 1 Retracted");
if (CARGO1_status == RACK_DOWN)SendHudMessage("Rack 1 Extended");
}
}
CARGO1_pos.z = CARGO1_INT_POS - (CARGO1_proc * 5);
SetAttachmentParams(CARGO1, CARGO1_pos, _V(0, -1, 0), _V(0, 0, -1));
Cbeaconpos[1].x = CARGO1_pos.x;
Cbeaconpos[1].y = CARGO1_pos.y;
Cbeaconpos[1].z = CARGO1_pos.z;
So the meshes are really being shown with a different shape? Because on the last image you posted it looks like there are "big pods" and "small pods".
Try to just have one attachment for now (one of the problematic ones), without the raise/lower code, and find out if that works and then slowly add more stuff.
Or you override the SetAttachmentParams function in your vessel, check the inputs there and log the results before delegating it back to the super class.
else if (key == OAPI_KEY_GRAVE)// SELECT
{
PODSel = PODSel + 1;
if (PODSel == 1)SendHudMessage("Rack 1 Selected");
if (PODSel == 2)SendHudMessage("Rack 2 Selected");
if (PODSel == 3)SendHudMessage("Rack 3 Selected");
if (PODSel == 4)SendHudMessage("Rack 4 Selected");
if (PODSel == 5)SendHudMessage("Rack 5 Selected");
if (PODSel == 6)SendHudMessage("Rack 6 Selected");
if (PODSel == 7)SendHudMessage("Rack 7 Selected");
if (PODSel == 8)SendHudMessage("Rack 8 Selected");
if (PODSel == 9)SendHudMessage("Rack 9 Selected");
if (PODSel == 10)SendHudMessage("Rack 10 Selected");
if (PODSel == 11)SendHudMessage("Rack 11 Selected");
if (PODSel == 12)SendHudMessage("Rack 12 Selected");
if (PODSel == 13)SendHudMessage("Rack 13 Selected");
if (PODSel == 14)SendHudMessage("Rack 14 Selected");
if (PODSel == 15)SendHudMessage("Rack 15 Selected");
if (PODSel == 16)SendHudMessage("Rack 16 Selected");
if (PODSel > 16) PODSel = 1;
//turn them all off first
return 1;
}
else if (key == OAPI_KEY_3)
{
if (PODSel == 1){
RevertCARGO1();
return 1;
}
if (PODSel == 2){
RevertCARGO2();
return 1;
}
if (PODSel == 3){
RevertCARGO3();
return 1;
}
if (PODSel == 4){
RevertCARGO4();
return 1;
}
if (PODSel == 5){
RevertCARGO5();
return 1;
}
if (PODSel == 6){
RevertCARGO6();
return 1;
}
if (PODSel == 7){
RevertCARGO7();
return 1;
}
if (PODSel == 8){
RevertCARGO8();
return 1;
}
if (PODSel == 9){
RevertCARGO9();
return 1;
}
if (PODSel == 10){
RevertCARGO10();
return 1;
}
if (PODSel == 11){
RevertCARGO11();
return 1;
}
if (PODSel == 12){
RevertCARGO12();
return 1;
}
if (PODSel == 13){
RevertCARGO13();
return 1;
}
if (PODSel == 14){
RevertCARGO14();
return 1;
}
if (PODSel == 15){
RevertCARGO15();
return 1;
}
if (PODSel == 16){
RevertCARGO16();
return 1;
}
return 1;
}
if (PODSel == 1){
if (CARGO1_status >= RACK_RAISING) {
double da = simdt * .1;
if (CARGO1_status == RACK_RAISING) {
if (CARGO1_proc > 0.0) CARGO1_proc = max(0.0, CARGO1_proc - da);
else CARGO1_status = RACK_UP;
}
else {
if (CARGO1_proc < 1.0) CARGO1_proc = min(1.0, CARGO1_proc + da);
else CARGO1_status = RACK_DOWN;
}
if (CARGO1_status == RACK_UP)SendHudMessage("Rack 1 Retracted");
if (CARGO1_status == RACK_DOWN)SendHudMessage("Rack 1 Extended");
}
}
if (PODSel == 16){
// SendHudMessage("Rack 16 Selected");
if (CARGO16_status >= RACK_RAISING) {
double da = simdt * .1;
if (CARGO16_status == RACK_RAISING) {
if (CARGO16_proc > 0.0) CARGO16_proc = max(0.0, CARGO16_proc - da);
else CARGO16_status = RACK_UP;
}
else {
if (CARGO16_proc < 1.0) CARGO16_proc = min(1.0, CARGO16_proc + da);
else CARGO16_status = RACK_DOWN;
}
if (CARGO16_status == RACK_DOWN)SendHudMessage("Rack 16 Extended");
if (CARGO16_status == RACK_UP)SendHudMessage("Rack 16 Retracted");
}
}
CARGO1_pos.z = CARGO1_INT_POS - (CARGO1_proc * 5);
SetAttachmentParams(CARGO1, CARGO1_pos, _V(0, -1, 0), _V(0, 0, -1));
Cbeaconpos[1].x = CARGO1_pos.x;
Cbeaconpos[1].y = CARGO1_pos.y;
Cbeaconpos[1].z = CARGO1_pos.z;
CARGO2_pos.z = CARGO2_INT_POS - (CARGO2_proc * 5);
SetAttachmentParams(CARGO2, CARGO2_pos, _V(0, -1, 0), _V(0, 0, -1));
Cbeaconpos[2].x = CARGO2_pos.x;
Cbeaconpos[2].y = CARGO2_pos.y;
Cbeaconpos[2].z = CARGO2_pos.z;
CARGO3_pos.z = CARGO3_INT_POS - (CARGO3_proc * 5);
SetAttachmentParams(CARGO3, CARGO3_pos, _V(-0.866, -0.5, 0), _V(0, 0, -1));
Cbeaconpos[3].x = CARGO3_pos.x;
Cbeaconpos[3].y = CARGO3_pos.y;
Cbeaconpos[3].z = CARGO3_pos.z;
CARGO4_pos.z = CARGO4_INT_POS - (CARGO4_proc * 5);
SetAttachmentParams(CARGO4, CARGO4_pos, _V(-0.866, -0.5, 0), _V(0, 0, -1));
Cbeaconpos[4].x = CARGO4_pos.x;
Cbeaconpos[4].y = CARGO4_pos.y;
Cbeaconpos[4].z = CARGO4_pos.z;
For some reason Cargo 16 seems to cause the distortion. If I comment the SetAttachments for CArgo 16 no distortionCode:CARGO1_pos.z = CARGO1_INT_POS - (CARGO1_proc * 5); SetAttachmentParams(CARGO[COLOR="Red"]1[/COLOR], CARGO1_pos, _V(0, -1, 0), _V(0, 0, -1)); Cbeaconpos[[COLOR="Red"]1[/COLOR]].x = CARGO1_pos.x; Cbeaconpos[[COLOR="Red"]1[/COLOR]].y = CARGO1_pos.y; Cbeaconpos[[COLOR="Red"]1[/COLOR]].z = CARGO1_pos.z;
CARGO1_pos.z = CARGO1_INT_POS - (CARGO1_proc * 5);
SetAttachmentParams(CARGO1, CARGO1_pos, _V(0, -1, 0), _V(0, 0, -1));
Cbeaconpos[0].x = CARGO1_pos.x;
Cbeaconpos[0].y = CARGO1_pos.y;
Cbeaconpos[0].z = CARGO1_pos.z;
CARGO2_pos.z = CARGO2_INT_POS - (CARGO2_proc * 5);
SetAttachmentParams(CARGO2, CARGO2_pos, _V(0, -1, 0), _V(0, 0, -1));
Cbeaconpos[1].x = CARGO2_pos.x;
Cbeaconpos[1].y = CARGO2_pos.y;
Cbeaconpos[1].z = CARGO2_pos.z;
CARGO3_pos.z = CARGO3_INT_POS - (CARGO3_proc * 5);
SetAttachmentParams(CARGO3, CARGO3_pos, _V(-0.866, -0.5, 0), _V(0, 0, -1));
Cbeaconpos[2].x = CARGO3_pos.x;
Cbeaconpos[2].y = CARGO3_pos.y;
Cbeaconpos[2].z = CARGO3_pos.z;
so it should be this:
Code:CARGO1_pos.z = CARGO1_INT_POS - (CARGO1_proc * 5); SetAttachmentParams(CARGO1, CARGO1_pos, _V(0, -1, 0), _V(0, 0, -1)); Cbeaconpos[0].x = CARGO1_pos.x; Cbeaconpos[0].y = CARGO1_pos.y; Cbeaconpos[0].z = CARGO1_pos.z; CARGO2_pos.z = CARGO2_INT_POS - (CARGO2_proc * 5); SetAttachmentParams(CARGO2, CARGO2_pos, _V(0, -1, 0), _V(0, 0, -1)); Cbeaconpos[1].x = CARGO2_pos.x; Cbeaconpos[1].y = CARGO2_pos.y; Cbeaconpos[1].z = CARGO2_pos.z; CARGO3_pos.z = CARGO3_INT_POS - (CARGO3_proc * 5); SetAttachmentParams(CARGO3, CARGO3_pos, _V(-0.866, -0.5, 0), _V(0, 0, -1)); Cbeaconpos[2].x = CARGO3_pos.x; Cbeaconpos[2].y = CARGO3_pos.y; Cbeaconpos[2].z = CARGO3_pos.z;
meshi_CREW[VC_STATION_PILOT] = AddMesh(meshhg_CREW[VC_STATION_PILOT] = oapiLoadMeshGlobal(FILENAME_LANDERCREW1NEW));// mesh0
meshi_CREW[VC_STATION_COPILOT] = AddMesh(meshhg_CREW[VC_STATION_COPILOT] = oapiLoadMeshGlobal(FILENAME_LANDERCREW2NEW));//mesh1
meshi_CREW[VC_STATION_PAX_LEFT] = AddMesh(meshhg_CREW[2] = oapiLoadMeshGlobal(FILENAME_LANDERCREW3NEW));//mesh2
meshi_CREW[VC_STATION_PAX_RIGHT] = AddMesh(meshhg_CREW[VC_STATION_PAX_RIGHT] = oapiLoadMeshGlobal(FILENAME_LANDERCREW4NEW));//mesh3
meshi_CREW[VC_STATION_CASE] = AddMesh(meshhg_CREW[VC_STATION_CASE] = oapiLoadMeshGlobal(FILENAME_CREW_CASE_ANIMATED_B));//mesh4
meshi_CREW[VC_STATION_TARS] = AddMesh(meshhg_CREW[VC_STATION_TARS] = oapiLoadMeshGlobal(FILENAME_CREW_TARSLANDER_ANIMATEDNEW));//mesh5
for (int i = 0; i < VC_STATION_SIZE; i++)
SetMeshVisibilityMode(meshi_CREW[i], MESHVIS_NEVER);
// visual specs
SetMeshVisibilityMode(meshi_Vessel = AddMesh(meshhg_Vessel = oapiLoadMeshGlobal(FILENAME_LANDER15)), MESHVIS_ALWAYS); //Main ship mesh6
SetMeshVisibilityMode(meshi_VC = AddMesh(meshhg_VC = oapiLoadMeshGlobal(FILENAME_LANDER15VC)), MESHVIS_VC);//MESH 7
void LANDER6::UpdateCrew() {
int const crewn = Crew.GetCrewTotalNumber();
for (int i = 0; i < 5; i++) SetMeshVisibilityMode(meshi_CREW[i], MESHVIS_NEVER);// clears MESHES
{
int chair = 0;
for (int i = 0; i < crewn; i++) {
const char *pMiscID = Crew.GetCrewMiscIdBySlotNumber(i);
if (!_strnicmp(pMiscID, "TARS", 4))
SetMeshVisibilityMode(meshi_CREW[VC_STATION_TARS], MESHVIS_ALWAYS);
else if (!_strnicmp(pMiscID, "CASE", 4))
SetMeshVisibilityMode(meshi_CREW[VC_STATION_CASE], MESHVIS_ALWAYS);
else {
SetMeshVisibilityMode(meshi_CREW[chair++], MESHVIS_ALWAYS);
}
}
}
}
#define VC_STATION_FIRST_ID 0
#define VC_STATION_PILOT (0+VC_STATION_FIRST_ID)
#define VC_STATION_COPILOT (1+VC_STATION_PILOT)
#define VC_STATION_PAX_LEFT (1+VC_STATION_COPILOT)
#define VC_STATION_PAX_RIGHT (1+VC_STATION_PAX_LEFT)
#define VC_STATION_CASE (1+VC_STATION_PAX_RIGHT)
#define VC_STATION_TARS (1+VC_STATION_CASE)
#define VC_STATION_SIZE (1+VC_STATION_TARS)
LANDER:LANDER
STATUS Landed Earth
POS -80.6798960 28.5997140
HEADING 77.55
AFCMODE 7
PRPLEVEL 0:1.000000 1:1.000000 2:1.000000
IDS 0:588 100 1:589 100
NAVFREQ 0 0
XPDR 0
DOOR 1 1.0000
DOOR1 1 1.0000
BLAST 0 0.0000
UPDOOR 0 0.0000
LODOOR 0 0.0000
UMMUCREW TARS-TARS-22-64-120
END
So we set up the meshes 6 crew (0-5) and main mesh 6 and vc mesh 7
for (int i = 0; i < 5; i++) SetMeshVisibilityMode(meshi_CREW[i], MESHVIS_NEVER);// clears MESHES
for (int i = 0; i < 6; i++) SetMeshVisibilityMode(meshi_CREW[i], MESHVIS_NEVER);// clears MESHES
meshi_CREW[0] = AddMesh(meshhg_CREW[VC_STATION_PILOT] = oapiLoadMeshGlobal(FILENAME_LANDERCREW1NEW));// mesh0
meshi_CREW[1] = AddMesh(meshhg_CREW[VC_STATION_COPILOT] = oapiLoadMeshGlobal(FILENAME_LANDERCREW2NEW));//mesh1
meshi_CREW[2] = AddMesh(meshhg_CREW[2] = oapiLoadMeshGlobal(FILENAME_LANDERCREW3NEW));//mesh2
meshi_CREW[3] = AddMesh(meshhg_CREW[VC_STATION_PAX_RIGHT] = oapiLoadMeshGlobal(FILENAME_LANDERCREW4NEW));//mesh3
meshi_CREW[4] = AddMesh(meshhg_CREW[VC_STATION_CASE] = oapiLoadMeshGlobal(FILENAME_CREW_CASE_ANIMATED_B));//mesh4
meshi_CREW[5] = AddMesh(meshhg_CREW[VC_STATION_TARS] = oapiLoadMeshGlobal(FILENAME_CREW_TARSLANDER_ANIMATEDNEW));//mesh5
for (int i = 0; i < 6; i++)
SetMeshVisibilityMode(meshi_CREW[i], MESHVIS_NEVER);
// visual specs
SetMeshVisibilityMode(meshi_Vessel = AddMesh(meshhg_Vessel = oapiLoadMeshGlobal(FILENAME_LANDER15)), MESHVIS_ALWAYS); //Main ship mesh6
SetMeshVisibilityMode(meshi_VC = AddMesh(meshhg_VC = oapiLoadMeshGlobal(FILENAME_LANDER15VC)), MESHVIS_VC);//MESH 7
MESHHANDLE meshhg_Vessel, meshhg_VC, meshhg_CREW[6];
UINT meshi_Vessel, meshi_VC, meshi_CREW[6];
void RANGER::RedrawPanel_CENTERINFOstatus(SURFHANDLE surf, int part)
{
char cbuf[20];
HDC hDC = oapiGetDC(surf);
SetBkMode(hDC, TRANSPARENT);
SetTextColor(hDC, RGB(0, 153, 0));
SelectObject(hDC, g_Param.hFont[3]);
if (GEAR_status == GEAR_DOWN) {
sprintf(cbuf, "GEAR", 4);
SetTextColor(hDC, RGB(0, 153, 0));
TextOut(hDC, 25, 40, cbuf, strlen(cbuf));
}
if (GEAR_status == GEAR_UP) {
sprintf(cbuf, "GEAR", 4);
SetTextColor(hDC, RGB(255, 0, 0));
TextOut(hDC, 25, 40, cbuf, strlen(cbuf));
}
if ((GEAR_status == GEAR_RAISING) || (GEAR_status == GEAR_LOWERING)){
sprintf(cbuf, "GEAR", 4);
SetTextColor(hDC, RGB(255, 255, 0));
TextOut(hDC, 25, 40, cbuf, strlen(cbuf));
}
if ((DOOR_proc>0) && (DOOR_proc<1)) {
sprintf(cbuf, "MAIN HATCH", 10);
SetTextColor(hDC, RGB(255, 255, 0));
TextOut(hDC, 25, 70, cbuf, strlen(cbuf));
}
if (DOOR_proc==1) {
sprintf(cbuf, "MAIN HATCH", 10);
SetTextColor(hDC, RGB(255, 0, 0));
TextOut(hDC, 25, 70, cbuf, strlen(cbuf));
}
if (DOOR_proc == 0) {
sprintf(cbuf, "MAIN HATCH", 10);
SetTextColor(hDC, RGB(0, 153, 0));
TextOut(hDC, 25, 70, cbuf, strlen(cbuf));
}
if ((DOOR1_proc>0) && (DOOR1_proc<1)) {
sprintf(cbuf, "DOCK HATCH", 10);
SetTextColor(hDC, RGB(255, 255, 0));
TextOut(hDC, 25, 100, cbuf, strlen(cbuf));
}
if (DOOR1_proc == 1) {
sprintf(cbuf, "DOCK HATCH", 10);
SetTextColor(hDC, RGB(255, 0, 0));
TextOut(hDC, 25, 100, cbuf, strlen(cbuf));
}
if (DOOR1_proc == 0) {
sprintf(cbuf, "DOCK HATCH", 10);
SetTextColor(hDC, RGB(0, 153, 0));
TextOut(hDC, 25, 100, cbuf, strlen(cbuf));
}
SelectObject(hDC, g_Param.hFont[2]);
SetTextColor(hDC, RGB(0, 153, 0));
sprintf(cbuf, "%0.1f", RANGERPITCH1);
TextOut(hDC, 170, 200, cbuf, strlen(cbuf));
sprintf(cbuf, "%0.1f", RANGERYAW1);
TextOut(hDC, 170, 250, cbuf, strlen(cbuf));
sprintf(cbuf, "%0.1f", RANGERROLL1);
TextOut(hDC, 170, 300, cbuf, strlen(cbuf));
sprintf(cbuf, "%0.1f", RANGERNOSE);
TextOut(hDC, 170, 350, cbuf, strlen(cbuf));
sprintf(cbuf, "PITCH", 5);
TextOut(hDC, 100, 200, cbuf, strlen(cbuf));
sprintf(cbuf, "HDG", 3);
TextOut(hDC, 100, 250, cbuf, strlen(cbuf));
sprintf(cbuf, "ROLL", 4);
TextOut(hDC, 100, 300, cbuf, strlen(cbuf));
sprintf(cbuf, "NOSE", 4);
TextOut(hDC, 100, 350, cbuf, strlen(cbuf));
oapiReleaseDC(surf, hDC);
}
void RANGER::UpdateCrew() {
int const crewn = Crew.GetCrewTotalNumber();
for (int i = 0; i < 6; i++) SetMeshVisibilityMode(meshi_CREW[i], MESHVIS_NEVER);// clears MESHES
{
int chair = 0;
for (int i = 0; i < crewn; i++) {
const char *pMiscID = Crew.GetCrewMiscIdBySlotNumber(i);
if (!_strnicmp(pMiscID, "TARS", 4))
SetMeshVisibilityMode(meshi_CREW[4], MESHVIS_ALWAYS);
else if (!_strnicmp(pMiscID, "CASE", 4))
SetMeshVisibilityMode(meshi_CREW[5], MESHVIS_ALWAYS);
else {
SetMeshVisibilityMode(meshi_CREW[chair++], MESHVIS_ALWAYS);
}
}
}
}
int const crewn = Crew.GetCrewTotalNumber();
switch (viewController->station()->id) {
case VC_STATION_PILOT:
// Yes, we are on the Pilot station right now
huds.hudcnt = _V(-.954, 1.19, .55);
for (int i = 0; i < crewn; i++) {
const char *pMiscID = Crew.GetCrewMiscIdBySlotNumber(0);
if ((crewn==1) && (_strnicmp(pMiscID, "TARS", 4)) || (_strnicmp(pMiscID, "CASE", 4)))
{
SetMeshVisibilityMode(0, MESHVIS_NEVER);//DO NOT SHOW PILOT MESH
//SetMeshVisibilityMode(0, MESHVIS_VC);//BUT SHOW THE COPILOTS
}
}
break;
case VC_STATION_COPILOT:
// Yes, we are on the COPilot station right now
huds.hudcnt = _V(.954, 1.19, .55);
//SetAnimation(anim_DOOR,1);
for (int i = 0; i < crewn; i++) {
const char *pMiscID = Crew.GetCrewMiscIdBySlotNumber(1);
if ((crewn==2) && (_strnicmp(pMiscID, "TARS", 4)) || (_strnicmp(pMiscID, "CASE", 4)))
{
SetMeshVisibilityMode(0, MESHVIS_VC);//SHOW PILOT MESH
SetMeshVisibilityMode(1, MESHVIS_NEVER);//BUT DO NOT SHOW THE COPILOTS
}
}
break;
default:
// Never show any of them
if (crewn > 1){
const char *pMiscID = Crew.GetCrewMiscIdBySlotNumber(0);
if ((_strnicmp(pMiscID, "TARS", 4)) || (_strnicmp(pMiscID, "CASE", 4)))
SetMeshVisibilityMode(0, MESHVIS_ALWAYS);
}
if (crewn > 2) {
const char *pMiscID = Crew.GetCrewMiscIdBySlotNumber(1);
if ((_strnicmp(pMiscID, "TARS", 4)) || (_strnicmp(pMiscID, "CASE", 4)))
SetMeshVisibilityMode(1, MESHVIS_ALWAYS);
}
break;
}
APbeaconcol[17] = {{ 0, 255, 0 },//POD1
static VECTOR3 Cbeaconcol[16] = { { 0, 128, 0 },
fuel_percent1 = int(100 * (GetFuelMass()) / (FUELMASS1));
if (fuel_percent1 != fuel_percent1_last_redraw){
fuel_percent1_last_redraw = fuel_percent1;
oapiVCTriggerRedrawArea(-1, AID_FUELSTATUS);
}
fuel_percent2 = int(100 * (GetFuelMass()) / (FUELMASS2));
if (fuel_percent2 != fuel_percent2_last_redraw){
fuel_percent2_last_redraw = fuel_percent2;
oapiVCTriggerRedrawArea(-1, AID_FUELSTATUS);
}
fuel_percent3 = int(100 * (GetFuelMass()) / (FUELMASS3));
if (fuel_percent3 != fuel_percent3_last_redraw){
fuel_percent3_last_redraw = fuel_percent3;
oapiVCTriggerRedrawArea(-1, AID_FUELSTATUS);
}
current_thrust_main_level = GetThrusterLevel(th_main[0]);
if (current_thrust_main_level != thrust_main_last_drawn){
thrust_main_last_drawn = current_thrust_main_level;
oapiVCTriggerRedrawArea(-1, AID_FUELSTATUS);
}
current_thrust_hover_level = GetThrusterLevel(th_hover[0]);
if (current_thrust_hover_level != thrust_hover_last_drawn){
thrust_hover_last_drawn = current_thrust_hover_level;
oapiVCTriggerRedrawArea(-1, AID_FUELSTATUS);
}
current_trim_level = GetControlSurfaceLevel(AIRCTRL_ELEVATORTRIM);
if (current_trim_level != trim_last_drawn){
trim_last_drawn = current_trim_level;
oapiVCTriggerRedrawArea(-1, AID_FUELSTATUS);
}
void LANDER6::RedrawPanel_Fuelstatus(SURFHANDLE surf, int part)
{
char cbuf[20];
HDC hDC = oapiGetDC(surf);
SelectObject(hDC, g_Param.hBrush[4]);//green box
double level = GetThrusterLevel(th_main[0]);
double level2 = GetPropellantMass(tank1);//main fuel
double level3 = GetThrusterLevel(th_hover[0]);//hover
double level4 = GetPropellantMass(tank2);//hover fuel
double level5 = GetPropellantMass(tank3);//rcs fuel
Rectangle(hDC, 62, 256, (int)(62 + level * (280)), 280);//thrust
Rectangle(hDC, 62, 509, (int)(62 + level3 * (280)), 534);//HOVERthrust
//178,145
Rectangle(hDC, 154, 224, 180, (int)(224 - (level2 / 50))); //fuel
Rectangle(hDC, 226, 224, 249, (int)(224 - (level2 / 50))); //fuel
Rectangle(hDC, 81, 468, 106, (int)(468 - (level4 / 50))); //fuel
Rectangle(hDC, 152, 468, 176, (int)(468 - (level4 / 50))); //fuel
Rectangle(hDC, 225, 468, 250, (int)(468 - (level4 / 50))); //fuel
Rectangle(hDC, 296, 468, 322, (int)(468 - (level4 / 50))); //fuel
Rectangle(hDC, 499, 486, 525, (int)(486 - (level5 / 23.8))); //rscfuel
Rectangle(hDC, 572, 486, 598, (int)(486 - (level5 / 23.8))); //rscfuel
Rectangle(hDC, 499, 223, 525, (int)(223 - (level5 / 23.8))); //rscfuel
Rectangle(hDC, 572, 223, 599, (int)(223 - (level5 / 23.8))); //rscfuel
SelectObject(hDC, g_Param.hFont[3]);
SetTextColor(hDC, RGB(0, 153, 0));
SetTextAlign(hDC, TA_LEFT);
SetBkMode(hDC, TRANSPARENT);
SelectObject(hDC, g_Param.hFont[4]);
sprintf(cbuf, "%0.1f", level2 / 2);
TextOut(hDC, 142, 107, cbuf, strlen(cbuf));
TextOut(hDC, 212, 107, cbuf, strlen(cbuf));
sprintf(cbuf, "%0.1f", level4 / 4);
TextOut(hDC, 67, 350, cbuf, strlen(cbuf));
TextOut(hDC, 139, 350, cbuf, strlen(cbuf));
TextOut(hDC, 212, 350, cbuf, strlen(cbuf));
TextOut(hDC, 283, 350, cbuf, strlen(cbuf));
sprintf(cbuf, "%0.1f", level5 / 4);
TextOut(hDC, 500, 353, cbuf, strlen(cbuf));
TextOut(hDC, 571, 353, cbuf, strlen(cbuf));
TextOut(hDC, 500, 103, cbuf, strlen(cbuf));
TextOut(hDC, 571, 103, cbuf, strlen(cbuf));
double trim = (GetControlSurfaceLevel(AIRCTRL_ELEVATORTRIM) - .5);
double trim1 = GetControlSurfaceLevel(AIRCTRL_ELEVATORTRIM);
double trim2 = (trim - .5);
Rectangle(hDC, 482, (int)(249 - (30* trim2)), 502, (int)(255 - (30* trim2))); //TRIM
SelectObject(hDC, g_Param.hFont[3]);
SetTextColor(hDC, RGB(0, 153, 0));
SetTextAlign(hDC, TA_LEFT);
SetBkMode(hDC, TRANSPARENT);
sprintf(cbuf, "%0.1f", trim1);
TextOut(hDC, 545, 273, cbuf, strlen(cbuf));
SelectObject(hDC, g_Param.hFont[2]);
if (trim<-.5) {
sprintf(cbuf, "DN", 2);
TextOut(hDC, 581, 269, cbuf, strlen(cbuf));
}
if (trim>-.5) {
sprintf(cbuf, "UP", 2);
TextOut(hDC, 581,269, cbuf, strlen(cbuf));
}
if (!GetAttachmentStatus(CARGO1)) {
SetTextColor(hDC, RGB(196, 196, 196));
sprintf(cbuf, "CARGO1", 6);
TextOut(hDC, 77, 567, cbuf, strlen(cbuf));
}
if (GetAttachmentStatus(CARGO1)) {
SetTextColor(hDC, RGB(0, 153, 0));
sprintf(cbuf, "CARGO1", 6);
TextOut(hDC, 77, 567, cbuf, strlen(cbuf));
}
if (!GetAttachmentStatus(CARGO2)) {
SetTextColor(hDC, RGB(196, 196, 196));
sprintf(cbuf, "CARGO2", 6);
TextOut(hDC, 222, 567, cbuf, strlen(cbuf));
}
if (GetAttachmentStatus(CARGO2)) {
SetTextColor(hDC, RGB(0, 153, 0));
sprintf(cbuf, "CARGO2", 6);
TextOut(hDC, 222, 567, cbuf, strlen(cbuf));
}
oapiReleaseDC(surf, hDC);
}
bool LANDER6::clbkLoadVC(int id) { // ID is the Preset Camera Position
SURFHANDLE const tex3 = oapiGetTextureHandle(meshhg_VC, TEX_LANDER16VC_LANDERCENTERVC4);
huds.size = 0.496;
huds.nmesh = 7;
huds.ngroup = GRP_LANDER16VC_HUD;
//static VCHUDSPEC huds = { 7, GRP_LANDER16VC_HUD, { -.842, 3.664734, 8.022912 }, 0.496 };
oapiVCRegisterHUD(&huds);
viewController->HandleLoadVC(id);
mfdController->HandleLoadVC(id);
oapiVCRegisterArea(AID_FUELSTATUS, _R(0, 0, 1024, 1024), PANEL_REDRAW_USER, PANEL_MOUSE_IGNORE, PANEL_MAP_BACKGROUND, tex3);
//oapiVCRegisterArea(AID_THRUSTSTATUS, _R(0, 0, 512, 512), PANEL_REDRAW_USER, PANEL_MOUSE_IGNORE, PANEL_MAP_BACKGROUND, tex3);
//oapiVCRegisterArea(AID_PODSTATUS, _R(0, 0, 512, 512), PANEL_REDRAW_USER, PANEL_MOUSE_IGNORE, PANEL_MAP_BACKGROUND, tex3);
//caseTerminalScreen->HandleLoadVC(id);
//TARSTerminalScreen->HandleLoadVC(id);
return HandleLoadVC(id);
}
Here is a weird issue. The beacon on the Endurance are red and yellow. But id d3d9 they are both green.
redCode:APbeaconcol[17] = {{ 0, 255, 0 },//POD1
yellowCode:static VECTOR3 Cbeaconcol[16] = { { 0, 128, 0 },