• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSXA Engines run without fuel !

Messages
61
Country
france
I'm trying to build a fuel selector and I wrote this code

Code:
<PartInfo>
<Name>00-NORD_Fuel_Groupe_A_D</Name>
	  <AnimLength>100</AnimLength>
	  <Animation>
		<Parameter>
		    <Code>
			  (L:Fuel_Groupe_A_D,number) 100 *
		    </Code>
		    <Lag>400</Lag>
		</Parameter>
	  </Animation>
	  <MouseRect>
		<Cursor>Hand</Cursor>
		<TooltipText>Groupe A Droit</TooltipText>
		<CallbackCode>

		(L:Fuel_Groupe_A_D,number) ! (&gt;L:Fuel_Groupe_A_D,number)
		(L:Fuel_Groupe_A_D,number) 1 == 
		if{ 1 (&gt;K:FUEL_SELECTOR_SET) } 
		els{ 0 (&gt;K:FUEL_SELECTOR_SET) } 

		</CallbackCode>
	  </MouseRect>
</PartInfo>

When FUEL_SELECTOR_SET = 0, engines are still running.

it's a bit annoying.

Thank for your help.
 
Make sure you have your realism set in FS so that planes shut down when out of fuel. I am sure you did this, but just in case. ;)
 
The problem is actually a bit more complicated.
The Noratlas has three groups of tanks in each wing.
Each group is commanded by a tap. In all, there are 6 taps.
  • Tap 1 = tip tank left
  • Tap 2 = tip tank right
  • Tap 3 = Aux left
  • Tap 4 = Aux right
  • Tap 5 = Centre left
  • Tap 6 = Centre right
.

Therefore, I cannot use the valve that shuts the engine's fuel feed.

Each tap is commanded by the following code:

Tap 1

Code:
<PartInfo>
<Name>00-NORD_Fuel_Groupe_A_G</Name>
	  <AnimLength>100</AnimLength>
	  <Animation>
		<Parameter>
		    <Code>
			  (L:Fuel_Groupe_A_G,number) 100 *
		    </Code>
		    <Lag>400</Lag>
		</Parameter>
	  </Animation>
	  <MouseRect>
		<Cursor>Hand</Cursor>
		<TooltipText>Groupe A Gauche</TooltipText>
		<CallbackCode>
		(L:Fuel_Groupe_A_G,number) ! (&gt;L:Fuel_Groupe_A_G,number)
		</CallbackCode>
	  </MouseRect>
    </PartInfo>

Tap 2 :

Code:
<Name>00-NORD_Fuel_Groupe_A_D</Name>
	  <AnimLength>100</AnimLength>
	  <Animation>
		<Parameter>
		    <Code>
			  (L:Fuel_Groupe_A_D,number) 100 *
		    </Code>
		    <Lag>400</Lag>
		</Parameter>
	  </Animation>
	  <MouseRect>
		<Cursor>Hand</Cursor>
		<TooltipText>Groupe A Droit</TooltipText>
		<CallbackCode>
		(L:Fuel_Groupe_A_D,number) ! (&gt;L:Fuel_Groupe_A_D,number)
		</CallbackCode>
	  </MouseRect>
</PartInfo>

and so on.

The whole system is controlled by a poly placed in the virtual cockpit and by the following code.

Code:
<PartInfo>
    <Name>00-NORD_Reset_Fuel_</Name>
    <Visibility>
      <Parameter>
        <Code>
<!-- Si un levier est sélectionné, le réservoir correspondant est sélectionné -->
	<!-- côté gauche-->

		(L:Fuel_Groupe_A_G,number) 0 ==
		(L:Fuel_Groupe_B_G,number) 0 == and
		(L:Fuel_Groupe_C_G,number) 0 == and
		if{ 0 (&gt;K:FUEL_SELECTOR_SET) }

		(L:Fuel_Groupe_A_G,number) 1 ==
		(L:Fuel_Groupe_B_G,number) 0 == and
		(L:Fuel_Groupe_C_G,number) 0 == and
		if{ 12 (&gt;K:FUEL_SELECTOR_SET) }
	

		(L:Fuel_Groupe_B_G,number) 1 ==
		(L:Fuel_Groupe_A_G,number) 0 == and
		(L:Fuel_Groupe_C_G,number) 0 == and
		if{ 4 (&gt;K:FUEL_SELECTOR_SET) }


		(L:Fuel_Groupe_C_G,number) 1 ==
		(L:Fuel_Groupe_A_G,number) 0 == and
		(L:Fuel_Groupe_B_G,number) 0 == and
		if{ 2 (&gt;K:FUEL_SELECTOR_SET) }


	<!-- côté droit-->
		(L:Fuel_Groupe_A_D,number) 0 ==
		(L:Fuel_Groupe_B_D,number) 0 == and
		(L:Fuel_Groupe_C_D,number) 0 == and
		if{ 0 (&gt;K:FUEL_SELECTOR_2_SET) }


         	[INDENT](L:Fuel_Groupe_A_D,number) 1 ==[/INDENT]		(L:Fuel_Groupe_B_D,number) 0 == and
		(L:Fuel_Groupe_C_D,number) 0 == and
		if{ 11 (&gt;K:FUEL_SELECTOR_2_SET) }


		(L:Fuel_Groupe_B_D,number) 1 ==
		(L:Fuel_Groupe_A_D,number) 0 == and
		(L:Fuel_Groupe_C_D,number) 0 == and
		if{ 5 (&gt;K:FUEL_SELECTOR_2_SET) }


		(L:Fuel_Groupe_C_D,number) 1 ==
		(L:Fuel_Groupe_A_D,number) 0 == and
		(L:Fuel_Groupe_B_D,number) 0 == and
		if{ 3 (&gt;K:FUEL_SELECTOR_2_SET) }


<!-- Si 2 leviers sont sélectionnés, le 3° est sélectionné automatiquement et tous les réservoir sont sélectionné -->
	<!-- côté gauche-->
		<!-- A + B -->
		(L:Fuel_Groupe_A_G,number) 1 ==
		(L:Fuel_Groupe_B_G,number) 1 == and
		(L:Fuel_Groupe_C_G,number) 0 == and
		if{ (&gt;K:FUEL_SELECTOR_LEFT) }

		<!-- A + C -->
		(L:Fuel_Groupe_A_G,number) 1 ==
		(L:Fuel_Groupe_B_G,number) 0 == and
		(L:Fuel_Groupe_C_G,number) 1 == and
		if{ 1 (&gt;K:FUEL_SELECTOR_SET)}

		<!-- B + C -->
		(L:Fuel_Groupe_A_G,number) 0 ==
		(L:Fuel_Groupe_B_G,number) 1 == and
		(L:Fuel_Groupe_C_G,number) 1 == and
		if{ 1 (&gt;K:FUEL_SELECTOR_SET)}
		

[INDENT]<!-- côté droit-->[/INDENT]
		<!-- A + B -->
		(L:Fuel_Groupe_A_D,number) 1 ==
		(L:Fuel_Groupe_B_D,number) 1 == and
		(L:Fuel_Groupe_C_D,number) 0 == and
		if{ 1 (&gt;A:FUEL TANK SELECTOR:2,enum)}


		<!-- A + C -->
		(L:Fuel_Groupe_A_G,number) 1 ==
		(L:Fuel_Groupe_B_G,number) 0 == and
		(L:Fuel_Groupe_C_G,number) 1 == and
		if{ 1 (&gt;A:FUEL TANK SELECTOR:2,enum)}


		<!-- B + C -->
		(L:Fuel_Groupe_A_G,number) 0 ==
		(L:Fuel_Groupe_B_G,number) 1 == and
		(L:Fuel_Groupe_C_G,number) 1 == and
		if{ 1 (&gt;A:FUEL TANK SELECTOR:2,enum)}

	       </Code>
      </Parameter>
    </Visibility>
 
</PartInfo>

It does not work.

In addition, when I use a control gauge with the A:RECIP ENG FUEL TANK SELECTOR:1 or A: FUEL TANK SELECTOR:1 variables, it always returns the 1.0 value and not the one K:FUEL_SELECTOR_SET asks for.
 
Last edited:
This last section is never going to do anything. It is not possible to set A:vars at all:

Code:
if{ 1 (&gt;A:FUEL TANK SELECTOR:2,enum)}
 
I'm so stupid! :banghead:

But even by replacing (A:FUEL TANK SELECTOR:2,enum) by (&gt;K:FUEL_SELECTOR_SET) it doesnt work.
 
Um, still wrong K:event for "côté droit" and you need to add a space between the last ) and }

Code:
	<!-- côté droit-->
		<!-- A + B -->
		(L:Fuel_Groupe_A_D,number) 1 ==
		(L:Fuel_Groupe_B_D,number) 1 == and
		(L:Fuel_Groupe_C_D,number) 0 == and
		if{ 1 (&gt;K:FUEL_SELECTOR_2_SET) }


		<!-- A + C -->
		(L:Fuel_Groupe_A_G,number) 1 ==
		(L:Fuel_Groupe_B_G,number) 0 == and
		(L:Fuel_Groupe_C_G,number) 1 == and
		if{ 1 (&gt;K:FUEL_SELECTOR_2_SET) }


		<!-- B + C -->
		(L:Fuel_Groupe_A_G,number) 0 ==
		(L:Fuel_Groupe_B_G,number) 1 == and
		(L:Fuel_Groupe_C_G,number) 1 == and
		if{ 1 (&gt;K:FUEL_SELECTOR_2_SET) }
 
Back
Top