Archived

This topic is now archived and is closed to further replies.

n4gix

Attaching fuel tanks to engines

Recommended Posts

I'm working on a three-engine bird and what I'd like to do is have the left engine draw fuel from left main, the right engine draw fuel from right main and the centre engine draw fuel from left & right aux tanks. Currently FS shows all three engines sucking from left & right aux tanks. Has anyone else run into this problem and if so, what was the solution? Changes to the .air or .cfg file?Many thanks.-Dai

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

It's up to you to initialize the fuel selector switches to the correct tanks.The key events would be:KEY_FUEL_SELECTOR_LEFTKEY_FUEL_SELECTOR_RIGHTKEY_FUEL_SELECTOR_CENTERKEY_FUEL_SELECTOR_LEFT_AUXKEY_FUEL_SELECTOR_RIGHT_AUXKEY_FUEL_SELECTOR_2_LEFTKEY_FUEL_SELECTOR_2_RIGHTKEY_FUEL_SELECTOR_2_CENTERKEY_FUEL_SELECTOR_2_LEFT_AUXKEY_FUEL_SELECTOR_2_RIGHT_AUXKEY_FUEL_SELECTOR_3_LEFTKEY_FUEL_SELECTOR_3_RIGHTKEY_FUEL_SELECTOR_3_CENTERKEY_FUEL_SELECTOR_3_LEFT_AUXKEY_FUEL_SELECTOR_3_RIGHT_AUXThere's no setting to draw from both Aux tanks simultaneously that I know of.

Share this post


Link to post
Share on other sites

Dai, This may do it as a workaround.- Assign 3 tank selectors in the aircraft.cfg ( may have to do .air file mods too )EXAMPLE !!![fuel]Center1=0, 0, 0, 2313, 0 //Longitudinal (feet), Lateral (feet), Vertical (feet), Usable(gallons), Unusable (gallons)LeftMain=-3, -19, 0, 1500, 0 //Longitudinal (feet), Lateral (feet), Vertical (feet), Usable(gallons), Unusable (gallons)RightMain=-3, 19, 0, 1500, 0 //Longitudinal (feet), Lateral (feet), Vertical (feet), Usable(gallons), Unusable (gallons)fuel_type=2 //Fuel type: 1 = Avgas, 2 = JetAnumber_of_tank_selectors=1 RIGHT HERE <--------------- electric_pump=0- On selectors 1 and 3 select left, right main accordingly.- On selector 2 have a backround code to switch between L & R aux tanks evenly. Either fuel used before switch or a timed switch.I know it can be done in XML, for C++ just donot know. Below is a list of tank selectors/functions in XML.(>K:CROSS_FEED_LEFT_TO_RIGHT) (>K:CROSS_FEED_OFF) (>K:CROSS_FEED_OPEN) (>K:CROSS_FEED_RIGHT_TO_LEFT) (>K:CROSS_FEED_TOGGLE)(>K:FUEL_PUMP) (>K:FUEL_SELECTOR_2_ALL) (>K:FUEL_SELECTOR_2_CENTER) (>K:FUEL_SELECTOR_2_LEFT) (>K:FUEL_SELECTOR_2_LEFT_AUX) (>K:FUEL_SELECTOR_2_OFF) (>K:FUEL_SELECTOR_2_RIGHT) (>K:FUEL_SELECTOR_2_RIGHT_AUX) (>K:FUEL_SELECTOR_2_SET) (>K:FUEL_SELECTOR_3_ALL) (>K:FUEL_SELECTOR_3_CENTER) (>K:FUEL_SELECTOR_3_LEFT) (>K:FUEL_SELECTOR_3_LEFT_AUX) (>K:FUEL_SELECTOR_3_OFF) (>K:FUEL_SELECTOR_3_RIGHT) (>K:FUEL_SELECTOR_3_RIGHT_AUX) (>K:FUEL_SELECTOR_3_SET) (>K:FUEL_SELECTOR_4_ALL) (>K:FUEL_SELECTOR_4_CENTER) (>K:FUEL_SELECTOR_4_LEFT) (>K:FUEL_SELECTOR_4_LEFT_AUX) (>K:FUEL_SELECTOR_4_OFF) (>K:FUEL_SELECTOR_4_RIGHT) (>K:FUEL_SELECTOR_4_RIGHT_AUX) (>K:FUEL_SELECTOR_4_SET) (>K:FUEL_SELECTOR_ALL) (>K:FUEL_SELECTOR_CENTER) (>K:FUEL_SELECTOR_LEFT) (>K:FUEL_SELECTOR_LEFT_AUX) (>K:FUEL_SELECTOR_OFF) (>K:FUEL_SELECTOR_RIGHT) (>K:FUEL_SELECTOR_RIGHT_AUX) (>K:FUEL_SELECTOR_SET) (>K:MANUAL_FUEL_TRANSFER)(>K:RELEASE_DROP_TANK_1) (>K:RELEASE_DROP_TANK_2) (>K:RELEASE_DROP_TANK_ALL) (>K:SET_FUEL_TRANSFER_AFT) (>K:SET_FUEL_TRANSFER_AUTO) (>K:SET_FUEL_TRANSFER_FORWARD) (>K:SET_FUEL_TRANSFER_OFF)(>K:TOGGLE_ELECT_FUEL_PUMP) (>K:TOGGLE_ELECT_FUEL_PUMP1) (>K:TOGGLE_ELECT_FUEL_PUMP2) (>K:TOGGLE_ELECT_FUEL_PUMP3) (>K:TOGGLE_ELECT_FUEL_PUMP4) RomanProud "TEAM AVSIM" RTW race member.XP Pro, FS9, FR Locked @ 23, AMD 1800+ OCd to 1900+, APIC MProc Mod (24 IRQs), Latency Mods, ECS K7S5a V1.1, 7 fans, 1 gig, 100 & 60 Gig 7200rpm HD, ASUS/NVidia GeForce 64mb AGP on 21", NVidia FX5500 vivo 256mb (CRAP) on 18", Nvidia 93.71s ( The highest can go for the GeForce3 & 5500 combined ), Savage4 32mb on 15", BV services mods.

Share this post


Link to post
Share on other sites

Thanks guys. I think I've said before, this is an inherited project and sometimes I simply cannot figure what the original programmer was up to.-Dai

Share this post


Link to post
Share on other sites

So I'm more than just a bit thick.... I tried this:trigger_key_event(KEY_FUEL_SELECTOR_LEFT,1) //Engine 1trigger_key_event(KEY_FUEL_SELECTOR_CENTER,2) //Engine 2trigger_key_event(KEY_FUEL_SELECTOR_RIGHT,3) //Engine 3but all three engines are sucking from all three tanks i.e. shut down any two engines and you can still see the contents of all three fuel tanks decreasing at an equal rate. I had an interesting moment when I found all three engines pulling from the right tank only but I traced that to a Number Of Selectors=1 in the aircraft.cfg file. How on earth do I make a given engine take fuel from the specified fuel tank?-Dai

Share this post


Link to post
Share on other sites

>So I'm more than just a bit thick.... I tried this:>>trigger_key_event(KEY_FUEL_SELECTOR_LEFT,1) //Engine 1>trigger_key_event(KEY_FUEL_SELECTOR_CENTER,2) //Engine 2>trigger_key_event(KEY_FUEL_SELECTOR_RIGHT,3) //Engine 3>>but all three engines are sucking from all three tanks i.e.>shut down any two engines and you can still see the contents>of all three fuel tanks decreasing at an equal rate. I had an>interesting moment when I found all three engines pulling from>the right tank only but I traced that to a Number Of>Selectors=1 in the aircraft.cfg file. How on earth do I make a>given engine take fuel from the specified fuel tank?>>-Dai Hello Dai,I went throug this 'exercise' a couple of years ago when Iwas creating a panel for the L-188 Electra in FS2004.You might have a look at my code for fuel tank to enginelinking in the CAB file of my panel.Here's the link to just get the CAB file that was in a update I did. It's smaller than the full panel file:http://library.avsim.net/download.php?DLID=60475And here's the link to grab the entire panel:http://library.avsim.net/download.php?DLID=60046You want to look at my XML code for:Fuel_Selector_1.XMLFuel_Selector_2.XMLetc.Here's the code for the #3 engine selector switch which may give youa clue as to what you may be missing ( syntax )...- - - (L:Fuel Selector 3,number) - - - - - - - - - Left Aux5 (>L:Fuel Selector 3,number) 12 (>K:FUEL_SELECTOR_3_SET)- Left Main3 (>L:Fuel Selector 3,number) 4 (>K:FUEL_SELECTOR_3_SET)- ALL2 (>L:Fuel Selector 3,number) 1 (>K:FUEL_SELECTOR_3_SET)- Right Main4 (>L:Fuel Selector 3,number) 5 (>K:FUEL_SELECTOR_3_SET)- Right Aux6 (>L:Fuel Selector 3,number) 11 (>K:FUEL_SELECTOR_3_SET)- Fuel OFF1 (>L:Fuel Selector 3,number) 0 (>K:FUEL_SELECTOR_3_SET)- Engine 3 Fuel Tank Select- Engine 3 Fuel Tank Select- - - - - - - - - - In this application I used a seperate selector switch for eachengine. Hope this helps. Paul

Share this post


Link to post
Share on other sites

Hi PaulI appreciate the time you took to reply. My problem is that I don't do XML code... yet... I'm still a complete C-code reactionary :)-Dai

Share this post


Link to post
Share on other sites

Daitrigger_key_event(KEY_FUEL_SELECTOR_LEFT,1) //Engine 1trigger_key_event(KEY_FUEL_SELECTOR_CENTER,2) //Engine 2trigger_key_event(KEY_FUEL_SELECTOR_RIGHT,3) //Engine 3These are all for engine 1, you need to use KEY_FUEL_SELECTOR_2 for engine 2, KEY_FUEL_SELECTOR_3 for engine 3, KEY_FUEL_SELECTOR_4 for engine 4. I have done this in XML but not in C yet, in xml:(L:Eng2 Fuel Select,enum) 0 == if{ (>K:FUEL_SELECTOR_2_LEFT_AUX) } when fuel selector switch is position 0 engine 2 will only draw fuel from Left Aux Tank.Not tested, but in C. I would try this if (eng2_fuel_selector == 0){trigger_key_event (KEY_FUEL_SELECTOR_2_LEFT_AUX,0)}If I get time tomorrow (I should say later today 01:50 in the morning here) I will give this a try in C.Hope this helps

Share this post


Link to post
Share on other sites

Did this quick, and it works, engine 1 only draws fuel from left Aux when switch is positon 0 and only draws fuel from external 1 when switch position 1, position 2 stops the engine not sure why :-lol (I use external 1 as left main due, to FS9 always taking fuel from left main if it has fuel in it, even if the fuel selector is selecting a different tank) Code for engine two works just the same but uses the right aux and external 2 tanks.Code for engine 1case PANEL_SERVICE_PRE_UPDATE: if (eng1_selector_position == 0) { trigger_key_event (KEY_FUEL_SELECTOR_LEFT_AUX,0); } else if (eng1_selector_position == 1) { trigger_key_event (KEY_FUEL_SELECTOR_SET,9); } else if (eng1_selector_position == 2) { trigger_key_event (KEY_FUEL_SELECTOR_OFF,0); } break;code for engine 2case PANEL_SERVICE_PRE_UPDATE: if (eng2_selector_position == 0) { trigger_key_event (KEY_FUEL_SELECTOR_2_RIGHT_AUX,0); } else if (eng2_selector_position == 1) { trigger_key_event (KEY_FUEL_SELECTOR_2_SET,10); } else if (eng2_selector_position == 2) { trigger_key_event (KEY_FUEL_SELECTOR_2_OFF,0); } break;

Share this post


Link to post
Share on other sites

Russell is correct (funny, that's my 'real first name' too!)...Both "Main" tanks will always feed any old engine you happen to have... I don't know why ACES hard-wired it that way, but... For my Navion with two wing and two tip tanks, I used:center1 //left wingaux1 //left tipcenter2 //right wingaux2 //right tip

Share this post


Link to post
Share on other sites

Hi Russell (not Fr.Bill!! :()Would you happen to have a big flat surface that I can beat my head against? Talk about stupidity; what makes it worse is that I had this big mental flag about the numbered selector tanks and I completely ignored it! Gah.Bill: Thanks for the info about the main tanks. I was beginning to suspect that was the case but I hadn't gathered enough data yet to make a definate assessment.I now have to find out why, after all the corrections, all three engines are drawing from the right aux tank. Can anyone tell me if the aircraft.cfg file overrides the .air file? Currently the .air file shows two main and one centre tank; I've changed the .cfg file to show two aux and two centre tanks (engine #2 has two fuel tanks).-Dai

Share this post


Link to post
Share on other sites

The aircraft.cfg trumps the .air file, always. ;)

Share this post


Link to post
Share on other sites

DaiSorry I do not have a big flat surface you can bang your head against, but I do have a couple of big books on C programming that I regularly wack myself on the head with :-lolRussell is correct... sorry I mean Bill :-)As to your question about all engines using the right aux tank, I would take a look at the number of fuel selectors in the aircraft.cfg, for yours you should have number_of_tank_selectors=3 one selector for each engine.

Share this post


Link to post
Share on other sites

>Russell is correct... sorry I mean Bill :-)I began using the diminutive of my middle name "William" nearly fifty years ago, after discovering to my horror that "Russell" (as pronounced in the middle-east 'razule') means "shovel" in Farsi......more specifically the one used to clean stables and privys. No self-respecting ten year old could possibly expose himself so openly! I mean, I saw kids get beat up for less, such as wearing a cableknit sweater their mom had knitted or something... :-erks

Share this post


Link to post
Share on other sites