Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Bit of a problem with generators

Featured Replies

  • Commercial Member

i.e. I can't start them! :smile:

 

The aircraft.cfg file contains an engine_generator_map line with a genny for each engine and I've tried

 

trigger_key_event(KEY_TOGGLE_MASTER_ALTERNATOR, 0);

 

and

trigger_key_event(KEY_TOGGLE_ALTERNATORx, 0);

 

but they don't seem to want to play. Is there something missing from the .air file, for example?

  • Commercial Member

Since it's always worked for me... I'm going to assume you're mistaken on whether they're working.

 

How are you determining if they're working? (I know, sounds really stupid LOL)

 

Also show your map entry.

Ed Wilson

Mindstar Aviation
My Playland - I69

  • Author
  • Commercial Member

Hello Ed

 

[electrical]

max_battery_voltage = 24.0
generator_alternator_voltage = 30.0
max_generator_alternator_amps = 400.0
engine_generator_map= 1,1,1

 

MODULE_VAR default_gen2_active =    {GENERAL_ENGINE2_GENERATOR_ACTIVE};

MODULE_VAR default_gen2_switch =    {GENERAL_ENGINE2_GENERATOR_SWITCH};

-----------------

 

    lookup_var(&default_gen2_active);
//    lookup_var(&default_gen2_switch);
//    if (!default_gen2_active.var_value.b )
//    if (!default_gen2_switch.var_value.b )
//    if (!default_gen2_switch.var_value.n )
    if (!default_gen2_active.var_value.n)
    {
//        trigger_key_event(KEY_TOGGLE_MASTER_ALTERNATOR, 0);
        trigger_key_event(KEY_TOGGLE_ALTERNATOR2, 0);
//        send_key_event(KEY_TOGGLE_ALTERNATOR2, 0);  

   }

 

 

I think that about sums up all of my tries. Running in debug mode shows that neither _switch nor _active ever changes from zero/false.

 

Do you need any other info?

 

-Dai

  • Commercial Member

Engines running? Also, since you're teling the sim that all 3 engines have a generator... why are you using the mask? The sim defaults to putting a generator on an engine, not the other way around.

Ed Wilson

Mindstar Aviation
My Playland - I69

  • Author
  • Commercial Member

Hello Ed

 

That was quick! :)

 

The mask was just something I tried. Yes, the engines are running: the intro line to that section of code (which I should have left in) is:

 

if (e2n2.var_value.n>8700)
{

 

This always equates to true after engine start.

 

-Dai

  • Author
  • Commercial Member

It's FSX and it still fails without the mask. I've checked that I'm not doing something stupid like turning them off elsewhere but no. It's not an absolute that I use the FSX default generators - I just want to know if they're active and producing voltage - so it's just as easy to create my own (almost! :smile: ). If you've no other suggestions then I'll take this route; I appreciate your help, always.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.