March 3, 201610 yr 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?
March 3, 201610 yr 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 AviationMy Playland - I69
March 4, 201610 yr Author Commercial Member Hello Ed [electrical] max_battery_voltage = 24.0generator_alternator_voltage = 30.0max_generator_alternator_amps = 400.0engine_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
March 4, 201610 yr 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 AviationMy Playland - I69
March 4, 201610 yr 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
March 4, 201610 yr Commercial Member Remove the mask... see if you have generators working. This is FSX? Ed Wilson Mindstar AviationMy Playland - I69
March 4, 201610 yr 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.
March 4, 201610 yr Commercial Member The concern is that the sim works, I know... I have several aircraft I've coded. So you have something wrong somewhere... I'd hate to just ignore it. Ed Wilson Mindstar AviationMy Playland - I69
March 4, 201610 yr Author Commercial Member I'm definately head-scratching. As a test I set up a read/write in XML instead using execute_calculator_code but got the same result. Oh well, I'll keep poking at it. You're right - I'm not over-happy in just ignoring it either!
Create an account or sign in to comment