Project Space Transportation System 2016

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
I may need some code help here.

What I want is if the right MFD is powered on then mfd1pwr should be set to 1 else it is zero.
if (oapiGetMFDMode(MFD_RIGHT) != MFD_NONE) mfd1pwr = 1; else mfd1pwr = 0; if (oapiGetMFDMode(MFD_RIGHT) == MFD_NONE){ mfd1pwr = 0; } //if (oapiGetMFDMode(2) != MFD_NONE){ // mfd1pwr = 1; //} //i//f (oapiGetMFDMode(2) == MFD_NONE){ // mfd1pwr = 0; //} sprintf(oapiDebugString(), "%d ", mfd1pwr);

But mfd1pwr is always zero. What I want this for is if the MFD is on move the switch .


I did this:
mfd1pwr = (oapiGetMFDMode(MFD_RIGHT));

16.32 MFD mode identifiers Macros • #define MFD_REFRESHBUTTONS -1 Refresh MFD buttons. • #define MFD_NONE 0 No mode (turn MFD off) • #define MFD_ORBIT 1 Orbit MFD mode. • #define MFD_SURFACE 2 Surface MFD mode. • #define MFD_MAP 3 Map MFD mode. • #define MFD_HSI 4 HSI (horizontal situation indicator) MFD mode. • #define MFD_LANDING 5 VTOL support MFD mode. • #define MFD_DOCKING 6 Docking support MFD mode. • #define MFD_OPLANEALIGN 7 Orbital plane alignment MFD mode. • #define MFD_OSYNC 8 Orbit synchronisation MFD mode. • #define MFD_TRANSFER 9 Transfer orbit MFD mode. • #define MFD_COMMS 10 Communications MFD mode. • #define MFD_USERTYPE 64 User-defined MFD mode. • #define BUILTIN_MFD_MODES 10 Number of built-in MFD modes
 
Last edited:

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,272
Reaction score
3,244
Points
203
Location
Toulouse
Hello I'm no expert at all but I'd say check the brackets for the conditionnals, I mean the { } . Seems a bit inconsistent because you put them on the "second if" but not on the first "if - else". I'm pretty sure you can't have a ";" at the end of line 1, it breaks the conditionnal.

For me lines 3-5 are correct, lines 1-2 have a brackets issue.

For lines 6-11 everything is commented "//" so it is ignored, but I'm pretty sure you know that.

Line 12 seems correct to me, provided "mfd1pwr" is an integer (int).
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
The lines are syntactically correct, no braces needed,
I would nevertheless recommend using a consistent bracing style (y)

The semicolon in "line 1" is fine, it even has to be there to make it syntactically correct.
C++ doesn't care about newlines. That line(s) can also be written as one line, like:
if (oapiGetMFDMode(MFD_RIGHT) != MFD_NONE) mfd1pwr = 1; else mfd1pwr = 0;
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
THanks

So I have:
int mfd1pwr;
And
if (oapiGetMFDMode(MFD_RIGHT) != MFD_NONE) mfd1pwr = 1; else mfd1pwr = 0;

But it always shows zero. It should be 1 if the MFD is on and 0 if the MFD is off, right
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
From what I see, yes it should...have you tried to debug? Step by step and see what value oapiGetMFDMode(MFD_RIGHT) exactly returns?
As you've described the issue, it seems as if oapiGetMFDMode(MFD_RIGHT) never returned MFD_NONE (value 0 /zero).
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
Yes. I have a line:
mfd1pwr = (oapiGetMFDMode(MFD_RIGHT));

As I understand it depending on the mode, map, docking,... the mode number should change. It is always 0
 

Attachments

  • debugmfdpwr1.jpg
    debugmfdpwr1.jpg
    767.5 KB · Views: 3

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
In what method are you reading the value?
To get the "current" value you should be in either clbkPreStep or. clbkPostStep.

clbkLoadVC will only be called once when the VC is loaded (I assume)
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
Yes. I did and it works. So I get a 0 or an 1.

But now I have this:

//mfdswitches static UINT mfd1pwrGrp[1] = { 310 }; static MGROUP_ROTATE MFDPWR1(vidx, mfd1pwrGrp, 1, _V(-0.110675, 1.80093, 14.44304), _V(1, 0, 0), (float)(90 * RAD)); anim_mfd1 = CreateAnimation(0.5); AddAnimationComponent(anim_mfd1, 0.0, 1, &MFDPWR1);
vidx is for VC animations

This is in the Post Step
mfd1pwr = (oapiGetMFDMode(MFD_RIGHT)); sprintf(oapiDebugString(), "%d ", mfd1pwr); if (mfd1pwr == 1) SetAnimation(anim_mfd1, 1); if (mfd1pwr == 0) SetAnimation(anim_mfd1, 0);

So if on it should move the MFD1 animation
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
Got it to work. Thanks. It would be nice to get a timer to work. But that is way beyond me
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
STS43.
qGyCr83.jpg

UcAhbyk.jpg

Real:
vR8ut8N.jpg


I did notice some odd thing. NO RMS but it has the arm supports. As a mesh it can be added but not rotated. Also only 1 side has the eva slidewire. Really can't do that as it is a part of the shuttle.


Anyone else notice that the TDRS front parts seems to be transparent
 
Last edited:

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
Redid the SHAR II and the TPCE logo.
Jt9tYTl.jpg


On the TDRS
qJQsMhi.jpg


real life:
o4eQEGr.jpg


The orientation of the TDRS is 90 degrees out. It is that way in SF.

I can figure out how to open the the TDRS. Looking at the INI it should be key 1.

[ANIM_SEQ_0]
;UNFOLD SATELLITE & ORIENTATE
KEY=1
DURATION=80

On the dish the ribs should be sticking out. It looks they are scaled out. I have done a dish before where the ribs do rotate out. THat is easy but the dish is tricky. not sure if the dish mesh could scale while the ribs rotate out?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
It appears the IUS is the issue. I adjusted the attachment point from the rebuilt IUS used in sts 44. And it works.
zPY9cdX.jpg


the USA on the IUS is facing up. The only problem is the TDRS is now 180 degree off.

I am reworking the mesh. I can set the animation state in the scn but can't get the sat to open up.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
Something is wrong. If I reorient the IUS so the USA is on top then the TDRS is 180 . The TDRS is a payload. As is the 2nds stage. Is not attachment that can change. Since I am reworking the TDRS I can make the mesh the correct direction.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
I redid the TDRS added ribs but I thing it may need to re done again. Here the ribs are scaled as the dish is.
mU9lhLU.jpg


maZTQq3.jpg


I think the dish should be like this. So magic. the dish would be stowed and then go away and the ribs open up. When open the dish appears.


InCkExB.jpg



ZMCwyjW.jpg


It looks the dish joint is closer to the main body

Have not found detailed drawing of it though
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
We get this:
T87zY29.jpg
and this:
u8YXy9V.jpg


I need to redo the dish. I think the easy way is just to have a folded dish mesh and an unfolded dish mesh. And then have the folded dished go away and the open dish be seen. I think the ribs are really just covered in gold foil.
 

Marg

Active member
Joined
Mar 20, 2008
Messages
482
Reaction score
66
Points
28
Yes, ribs are covered with gold foil, in photos they really have shiny reflections. Only they seem a bit more "curved" from side view (more divisions\polys). At least in the front.
 
Last edited:
Top