- Joined
- Feb 6, 2008
- Messages
- 38,938
- Reaction score
- 3,937
- Points
- 203
- Location
- Wolfsburg
- Preferred Pronouns
- Sire
So red should be {255,0,0} and yellow {255,255,0}
Yes.
RGB - Red, Green, Blue
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.
So red should be {255,0,0} and yellow {255,255,0}
bool redrawpanel = false;
fuel_percent1 = int(100 * (GetFuelMass()) / (FUELMASS1));
if (fuel_percent1 != fuel_percent1_last_redraw){
fuel_percent1_last_redraw = fuel_percent1;
redrawpanel = true;
...
current_trim_level = GetControlSurfaceLevel(AIRCTRL_ELEVATORTRIM);
if (current_trim_level != trim_last_drawn){
trim_last_drawn = current_trim_level;
redrawpanel = true;
}
}
if (redrawpanel) oapiVCTriggerRedrawArea(-1, AID_FUELSTATUS);
ok. So on the code part:
Code:bool redrawpanel = false;
Code:fuel_percent1 = int(100 * (GetFuelMass()) / (FUELMASS1)); if (fuel_percent1 != fuel_percent1_last_redraw){ fuel_percent1_last_redraw = fuel_percent1; redrawpanel = true; ... current_trim_level = GetControlSurfaceLevel(AIRCTRL_ELEVATORTRIM); if (current_trim_level != trim_last_drawn){ trim_last_drawn = current_trim_level; redrawpanel = true; } }
do this for all of the others. and then add
Code:if (redrawpanel) oapiVCTriggerRedrawArea(-1, AID_FUELSTATUS);
{ 255, 0, 0 },
{ 255, 255, 0 }
#define CR_RED RGB( 255, 0, 0 )
#define CR_YELLOW RGB( 255, 255, 0 )
etc....
#define CR_RED RGB( 255, 0, 0 )
#define CR_YELLOW RGB( 255, 255, 0 )
static VECTOR3 Cbeaconcol[16] = { { CR_RED RGB },//bay1
fuel_percent1 = int(100 * (GetFuelMass()) / (FUELMASS1));
if (fuel_percent1 != fuel_percent1_last_redraw){
fuel_percent1_last_redraw = fuel_percent1;
redrawpanel = true;
}
fuel_percent2 = int(100 * (GetFuelMass()) / (FUELMASS2));
if (fuel_percent2 != fuel_percent2_last_redraw){
fuel_percent2_last_redraw = fuel_percent2;
redrawpanel = true;
}
fuel_percent3 = int(100 * (GetFuelMass()) / (FUELMASS3));
if (fuel_percent3 != fuel_percent3_last_redraw){
fuel_percent3_last_redraw = fuel_percent3;
redrawpanel = true;
}
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;
redrawpanel = true;
}
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;
redrawpanel = true;
}
current_trim_level = GetControlSurfaceLevel(AIRCTRL_ELEVATORTRIM);
if (current_trim_level != trim_last_drawn){
trim_last_drawn = current_trim_level;
redrawpanel = true;
}
if (redrawpanel) oapiVCTriggerRedrawArea(-1, AID_FUELSTATUS);
oapiVCRegisterArea(AID_FUELSTATUS, _R(0, 0, 1024, 1024), PANEL_REDRAW_USER, PANEL_MOUSE_IGNORE, PANEL_MAP_BACKGROUND, tex3);
Thanks. So in the h file I have:Code:#define CR_RED RGB( 255, 0, 0 ) #define CR_YELLOW RGB( 255, 255, 0 )
but when I try to change it i get an issue?
says expected a comma?Code:static VECTOR3 Cbeaconcol[16] = { { CR_RED RGB },//bay1
also:
Code:fuel_percent1 = int(100 * (GetFuelMass()) / (FUELMASS1)); if (fuel_percent1 != fuel_percent1_last_redraw){ fuel_percent1_last_redraw = fuel_percent1; redrawpanel = true; } fuel_percent2 = int(100 * (GetFuelMass()) / (FUELMASS2)); if (fuel_percent2 != fuel_percent2_last_redraw){ fuel_percent2_last_redraw = fuel_percent2; redrawpanel = true; } fuel_percent3 = int(100 * (GetFuelMass()) / (FUELMASS3)); if (fuel_percent3 != fuel_percent3_last_redraw){ fuel_percent3_last_redraw = fuel_percent3; redrawpanel = true; } 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; redrawpanel = true; } 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; redrawpanel = true; } current_trim_level = GetControlSurfaceLevel(AIRCTRL_ELEVATORTRIM); if (current_trim_level != trim_last_drawn){ trim_last_drawn = current_trim_level; redrawpanel = true; } if (redrawpanel) oapiVCTriggerRedrawArea(-1, AID_FUELSTATUS);
Code:oapiVCRegisterArea(AID_FUELSTATUS, _R(0, 0, 1024, 1024), PANEL_REDRAW_USER, PANEL_MOUSE_IGNORE, PANEL_MAP_BACKGROUND, tex3);
actually framerate went down it was 30 now 6
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);
}
Well I went back and now the hover gauge doesn't work. But when I commented
Code: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); }
It works but isn't updated. Framerate 34
on the beacons
there are 17 beacons so It sets the color for each one.
8.8.1 DetailedDescription
vessel beacon light parameters
PublicAttributes
• DWORD shape beacon shape identifier (see Light beacon shape parameters) • VECTOR3∗pos pointer to position in vessel coordinates • VECTOR3∗col pointer to beacon RGB colour
• double size beacon radius
• double falloff distance falloff parameter
• double period strobe period (0 for continuous)
• double duration strobe duration
• double tofs strobe time offset
• bool active beacon lit?
Ok. Where did you see 0 to 1?
Ok. Where did you see 0 to 1?
else if (key == OAPI_KEY_7)//JETTISON
{
SetControlSurfaceLevel(AIRCTRL_ELEVATORTRIM, 0);
return 1;
}
It runs ok in the debug.
double pitchlevel;
pitchlevel =0;
PITCHTRIMLEVEL = 0;
PITCHTRIMLEVELABS = 0;
if (PITCHTRIMLEVEL < 0){
PITCHTRIMLEVELABS = abs(PITCHTRIMLEVELABS);
SetThrusterLevel(th_rcs[20], PITCHTRIMLEVELABS);
SetThrusterLevel(th_rcs[25], PITCHTRIMLEVELABS);
SetThrusterLevel(th_rcs[27], PITCHTRIMLEVELABS);
SetThrusterLevel(th_rcs[26], PITCHTRIMLEVELABS);
}
if (PITCHTRIMLEVEL > 0){
SetThrusterLevel(th_rcs[21], PITCHTRIMLEVEL);
SetThrusterLevel(th_rcs[22], PITCHTRIMLEVEL);
SetThrusterLevel(th_rcs[23], PITCHTRIMLEVEL);
SetThrusterLevel(th_rcs[24], PITCHTRIMLEVEL);
}
else if (key == OAPI_KEY_DELETE)//JETTISON
{
PITCHTRIMLEVEL = PITCHTRIMLEVEL + .01;
if (PITCHTRIMLEVEL > 1)PITCHTRIMLEVEL = 1;
return 1;
}
else if (key == OAPI_KEY_INSERT)//JETTISON
{
PITCHTRIMLEVEL = PITCHTRIMLEVEL - .01;
if (PITCHTRIMLEVEL <-1)PITCHTRIMLEVEL = -1;
return 1;
}