• 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 Fuel cock issues

Messages
468
Country
ca-ontario
I have a working fuel cock in my wingtip model that was covered towards the end of this thread:

http://www.fsdeveloper.com/forum/showthread.php?t=20116&page=2

I am now trying to adapt that code so that I can use the same switch in my tip tank version but something is wrong with the XML code and I can't seem to fix it. If anyone can point me in the right direction I would really appreciate it.

This is the working code that operates as OFF-MAINS-AUX:

Code:
<PartInfo>
  <Name>XYZ_fuel_selector</Name>
  <!-- OFF - MAIN - AUX -->
  <AnimLength>100</AnimLength>
  <Animation>
    <Parameter>
      <Code>
	  50 (L:fuelKnob, enum) 50 * +
	  </Code>
      <Lag>300</Lag>
    </Parameter>
  </Animation>
  <MouseRect>
    <Cursor>Hand</Cursor>
    <TooltipID>TOOLTIPTEXT_FUEL_SELECTOR</TooltipID>
    <MouseFlags>LeftSingle+RightSingle+Wheel</MouseFlags>
     <CallbackCode>
      (M:Event) 'RightSingle' scmp 0 ==
      if{ (L:fuelKnob, enum) ++ 1 min (>L:fuelKnob, enum) }
      (M:Event) 'LeftSingle' scmp 0 ==
      if{ (L:fuelKnob, enum) -- -1 max (>L:fuelKnob, enum) }
     
      (L:fuelKnob,enum) -1 == if{ 0 (>K:FUEL_SELECTOR_SET) } (* off *)
      (L:fuelKnob,enum) 0 == if{ 16 (>K:FUEL_SELECTOR_SET) } (* both *)
      (L:fuelKnob,enum) 1 == if{ 6 (>K:FUEL_SELECTOR_SET) } (* aux *)
    </CallbackCode>
  </MouseRect>
</PartInfo>

I now need it to operate as OFF-MAINS-TIPS. I have tried this:

<CallbackCode>
(M:Event) 'RightSingle' scmp 0 ==
if{ (L:fuelKnob, enum) ++ 1 min (>L:fuelKnob, enum) }
(M:Event) 'LeftSingle' scmp 0 ==
if{ (L:fuelKnob, enum) -- -1 max (>L:fuelKnob, enum) }

(L:fuelKnob,enum) -1 == if{ 0 (>K:FUEL_SELECTOR_SET) } (* off *)
(L:fuelKnob,enum) 0 == if{ 16 (>K:FUEL_SELECTOR_SET) } (* both *)
(L:fuelKnob,enum) 1 == if{ 11 and 12 (>K:FUEL_SELECTOR_SET) } (* both tips *)
</CallbackCode>

and I have tried this:

Code:
<CallbackCode>
      (M:Event) 'RightSingle' scmp 0 ==
      if{ (L:fuelKnob, enum) ++ 1 min (>L:fuelKnob, enum) }
      (M:Event) 'LeftSingle' scmp 0 ==
      if{ (L:fuelKnob, enum) -- -1 max (>L:fuelKnob, enum) }
     
      (L:fuelKnob,enum) -1 == if{ 0 (>K:FUEL_SELECTOR_SET) } (* off *)
      (L:fuelKnob,enum) 0 == if{ 16 (>K:FUEL_SELECTOR_SET) } (* both *)
      (L:fuelKnob,enum) 1 == if{ 11 (>K:FUEL_SELECTOR_SET) } and (* right tip *)
      (L:fuelKnob,enum) 1 == if{ 12 (>K:FUEL_SELECTOR_SET) } (* left tip *)
    </CallbackCode>

In both the above cases the engine dies whenever the TIPS position is selected on the fuel cock. I have the tip tanks set up correctly in the aircraft.cfg file and the correct volume shows on the tip tank fuel gauges so I can only think it's an XML code issue for the fuel cock but I can't see what.

Can anyone see where I goofed up?
 
You cannot use "both tips" at the same time.

You could however change the aircraft.cfg file to rename the tips as EXTERNAL1 and EXTERNAL2, then use the command:

Code:
(L:fuelKnob,enum) 1 == if{ 17 (>K:FUEL_SELECTOR_SET) } (* both tips *)
This is defined as:
FUEL_TANK_SELECTOR_EXTERNAL_ALL = 17

The FUEL_SELECTOR_SET can only ever be ONE VALUE... ;)
 
DOH!!!! Thanks for that info Bill.

However, I just changed my cfg file to external tanks and checked the gauges against the fuel and payload screen and they work but the fuel cock still kills the engine when 'Tips' are selected even though I have changed the XML to match your suggestion. I even deleted the animation (and entry in the animation manager) and remade it in case something was hanging on in GMAX.

One thing I did notice that seems very odd is that the mouse-over tag in the sim still reads 'Center' when the 'Tips' position is selected. I bet that is why the engine is dying as I don't have a 'Center' tank anymore but I can't see why it should say that given the code I am using now.

Any idea why the mouse-over should read 'Center' when nothing is referencing that tank anymore?
 
Just wanted to say I fixed the issue. Turns out I had forgotten to change the mouse rectangle so it was still calling the old script. :o

Once I changed it to call the new script the fuel cock worked as it should. :)
 
I've done similiar things myself, Larry...
I'm happy to hear you've got it sorted now.:cool:
 
Back
Top