Jump to content
Sign in to follow this  
n4gix

Jet Engine Starter(s) in FSX - C Gauges

Recommended Posts

Well, this just sucks... I figured out how to "make it work," but it means I have to have two different versions of the gauge, because the FSX start routine won't work in FS9, and vice-versa! :(Here is an example of what "works" in FS9:////////////////////////////////////////////if ( TURB_ENGINE_1_CORRECTED_N2var.var_value.n < 23 && starter_left == 1 && MASTER_BATTERYvar.var_value.n == 1 ) { trigger_key_event (KEY_TOGGLE_STARTER1,0) ; } else { starter_left = 0 ; }//////////////////////////////////////////// Here is what "works" in FSX: if ( TURB_ENGINE_1_CORRECTED_N2var.var_value.n < 23 && starter_left == 1 // 'lights' the starter button&& startlatch1 == 0 // make sure the toggle_starter only gets done once&& MASTER_BATTERYvar.var_value.n == 1 // make sure we have power!) { trigger_key_event (KEY_TOGGLE_STARTER1,0) ; startlatch1 = 1 ; } else if ( TURB_ENGINE_1_CORRECTED_N2var.var_value.n > 23 && startlatch1 == 1 ) { trigger_key_event (KEY_TOGGLE_STARTER1,0) ; starter_left = 0 ; startlatch1 = 0 ; }


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Well, not knowing how much trouble this will be...You could always attempt a SimConnect "connection"If it succeeds, you are in FSX, and will use the FSX block. If it fails, you are in FS9...At least you can keep all that in one gauge.DougEdit: There should be some way to query the version number of the executable as well. Probably easier this way.dsd

Share this post


Link to post
Share on other sites
Guest Patrick_Waugh

If you are in FS9, no harm in setting an additional var.Patrick

Share this post


Link to post
Share on other sites

>If you are in FS9, no harm in setting an additional var.>>PatrickAh, Patrick... the "FSX version" of the code won't work at all except with FSX......because, the key_event KEY_TOGGLE_STARTERx has been "broken" since it was first introduced! The "toggle" part didn't, "toggle" that is.Now that ACES has "fixed it," all code written to use it now has to be modified. :)Pre-FSX the command worked like a single-shot event and required 'repeated triggering' to keep it active. Hence the need for the conditions to keep the "button pushed" until engine start. Parenthetically, that's also why one had to constantly 'click' on the switch in the some of the default FS2k2/FS9 aircraft to keep the starter active.Now that it is "fixed," the event works like a physical, latched switch. The "pre-FSX trick" is now effectively self-cancelling, meaning that the engine(s) will NEVER even spool up.


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

>Well, not knowing how much trouble this will be...>You could always attempt a SimConnect "connection">If it succeeds, you are in FSX, and will use the FSX block. >If it fails, you are in FS9...>At least you can keep all that in one gauge.>>Doug>>Edit: There should be some way to query the version number of>the executable as well. Probably easier this way.Oh, there's any number of ways this can be addressed, true enough... My main point is that this is one of the few cases where ACES probably shouldn't have "fixed" something... ;)One could also check for a 5th parameter in the gauge entry in the panel.cfg file, or query a custom .ini file, or maybe even query the aircraft.cfg file.


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest timewaster

I wonder how many other things the have modified in fs-x for c programming gauges. Maybe they have updated the show and hide features.

Share this post


Link to post
Share on other sites

>I wonder how many other things the have modified in fs-x for>c programming gauges. Maybe they have updated the show and>hide features.I haven't seen the new gauges.h file yet, but there ARE a lot of "new variables" and "key_events" that have to be explored... ;)


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest timewaster

> I haven't seen the new gauges.h file yet, but there ARE a lot of "new variables" and "key_events" that have to be explored... ;)New variables and keyevents....that is a major improvement,some would say there are way to much but "the more the better" is my opinion.Hey bill is the Jet Engine Starter the only gauge structured like thisor is it now all of them.:-hmmm

Share this post


Link to post
Share on other sites

>Hey bill is the Jet Engine Starter the only gauge structured>like this or is it now all of them.:-hmmmLet's simply say it's the only one I've found... so far... ;)


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest timewaster

You do have a good point. ;).

Share this post


Link to post
Share on other sites
Guest Mathias

>I haven't seen the new gauges.h file yet,I have :)Look inFlight Simulator XSDKSimObject Creation KitPanels and Gauges SDKincand you will find (Beta 3 that is) it.

Share this post


Link to post
Share on other sites

>>I haven't seen the new gauges.h file yet,>>I have :)>Look in>Flight Simulator XSDKSimObject Creation KitPanels and>Gauges SDKinc>and you will find (Beta 3 that is) it.Sorry... that is the FS2004 gauges.h file...Look closely and you'll see that there are 20+ new variables missing, along with the new key_events.The following for example are listed in the Token Variables.html but are still missing from the gauges.h file.ALTERNATE_STATIC_AIR_OPEN Float Alternate static air sourceAILERON_TRIM_PCT Float percent -1 to 1RUDDER_TRIM_PCT Float percent -1 to 1CIRCUIT_LIGHT_NAV_ON Bool True = onCIRCUIT_LIGHT_BEACON_ON Bool True = onCIRCUIT_LIGHT_LANDING_ON Bool True = onCIRCUIT_LIGHT_TAXI_ON Bool True = onCIRCUIT_LIGHT_STROBE_ON Bool True = onCIRCUIT_LIGHT_PANEL_ON Bool True = onCIRCUIT_LIGHT_RECOGNITION_ON Bool True = onCIRCUIT_LIGHT_WING_ON Bool True = onCIRCUIT_LIGHT_LOGO_ON Bool True = onCIRCUIT_LIGHT_CABIN_ONOTOH, I have this sick, sinking feeling that a LOT of the "new stuff" will only be accessible to XML or SimConnect, and will be left out of the gauges.h completely.It's as though ACES really wish us "C guys" would just hurry up and die... :-hang


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

>It's as though ACES really wish us "C guys" would just hurry>up and die...I would certainly hope that isn't true, but #### it, if it is, it would be nice if they would just come out and say so... I'm sure we could all be convinced to find something else to do with our time!Doug Dawson

Share this post


Link to post
Share on other sites

>>It's as though ACES really wish us "C guys" would just>hurry>>up and die...>>I would certainly hope that isn't true, but #### it, if it is,>it would be nice if they would just come out and say so... >I'm sure we could all be convinced to find something else to>do with our time!Well, I did say that somewhat "tongue-in-cheek," but I have been getting a bit frustrated with the seeming lack of concern being shown...OK, let's say that they don't update the gauges.h with the new stuff... It's fairly trivial - and in many ways easier! - to fetch the XML vars with execute_calculator_code......but, what's the trick for using the XML key_events? :-hmmm ...perhaps (not tested yet):execute_calculator_code("(K:KEY_REPAIR_AND_REFUEL)",NULL,NULL,NULL);


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Bill, Are you sure the engine starter routines in Beta3 are final? I'm sure Mike.Z said that the work they had done to resolve these differences between the two versions missed B3 and that it would be included in the final build...


Andrew Wilson

sig_fslDeveloper.jpg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...