• 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.

FSX External fuel tanks release switches

Messages
92
Country
poland
Hi.
I have a problem:

On my craft I have 2 external fuel tanks:
Code:
external1  =  3.23,  -3.87, 1.93, 33.0, 0.0    //Longitudinal (feet), Lateral (feet), Vertical (feet), Usable(gallons), Unusable (gallons)
external2  =  3.23,   3.87, 1.93, 33.0, 0.0    //Longitudinal (feet), Lateral (feet), Vertical (feet), Usable(gallons), Unusable (gallons)

And assigned to them stations loads for weight of empty fuel tanks:
Code:
station_load.4  = 20, 3.23,  -3.87, 1.93     // Weight(lbs), longitudinal, lateral, vertical positions from datum (feet)
station_name.4  = "L Ex Fuel Tank"

station_load.5  = 20, 3.23,  3.87, 1.93     // Weight(lbs), longitudinal, lateral, vertical positions from datum (feet)
station_name.5  = "R Ex Fuel Tank"

I've created 3 codes for switches, which would empty those fuel tanks and set to 0 weights of those stations loads, as well as hide meshes of those external tanks on 3d model:
Code:
<Animation name="Vanship_Left_External_Fuel_Tank" guid="66d187c5-8f82-4089-1155-7d9fdeee3186" type="Sim" typeParam="AutoPlay" length="100" typeParam2="Vanship_Left_External_Fuel_Tank" />

<PartInfo>
    <Name>Vanship_Left_External_Fuel_Tank</Name>
    <AnimLength>100</AnimLength>
    <Animation>
        <Parameter>
            <Code>(A:PAYLOAD STATION WEIGHT:5, Pounds) 0 > 100 *</Code>
        </Parameter>
    </Animation>
    <Visibility>
                 <Parameter>
                        <Code>
                (A:PAYLOAD STATION WEIGHT:5, Pounds) 0 >
            </Code>
                </Parameter>
        </Visibility>
            <MouseRect>
                    <Cursor>Hand</Cursor>
                    <TooltipText>First external fuel tank release switch - Tank is %((A:PAYLOAD STATION WEIGHT:5, Pounds) 0 >)%{if}not %{els}%{end}released</TooltipText>
        <CallbackCode>
            0 (>A:PAYLOAD STATION WEIGHT:5, Pounds)
            0 (>A:FUEL TANK EXTERNAL1 LEVEL, Percent )
        </CallbackCode>
            </MouseRect>
</PartInfo>


<Animation name="Vanship_Right_External_Fuel_Tank" guid="d24c4837-020e-44a5-9135-1e90d7d98ffc" type="Sim" typeParam="AutoPlay" length="100" typeParam2="Vanship_Right_External_Fuel_Tank" />

<PartInfo>
    <Name>Vanship_Right_External_Fuel_Tank</Name>
    <AnimLength>100</AnimLength>
    <Animation>
        <Parameter>
            <Code>(A:PAYLOAD STATION WEIGHT:6, Pounds) 0 > 100 *</Code>
        </Parameter>
    </Animation>
    <Visibility>
                 <Parameter>
                        <Code>
                (A:PAYLOAD STATION WEIGHT:6, Pounds) 0 >
            </Code>
                </Parameter>
        </Visibility>
            <MouseRect>
                    <Cursor>Hand</Cursor>
                    <TooltipText>Second external fuel tank release switch - Tank is %((A:PAYLOAD STATION WEIGHT:6, Pounds) 0 >)%{if}not %{els}%{end}released</TooltipText>
        <CallbackCode>
            0 (>A:PAYLOAD STATION WEIGHT:6, Pounds)
            0 (>A:FUEL TANK EXTERNAL2 LEVEL, Percent )
        </CallbackCode>
            </MouseRect>
</PartInfo>


<Animation name="Vanship_Both_External_Fuel_Tank" guid="6ac83ec8-3664-469c-771f-912786dcddd2" type="Sim" typeParam="AutoPlay" length="100" typeParam2="Vanship_Both_External_Fuel_Tank" />

<PartInfo>
    <Name>Vanship_Both_External_Fuel_Tank</Name>
    <AnimLength>100</AnimLength>
    <Animation>
        <Parameter>
            <Code>(A:PAYLOAD STATION WEIGHT:6, Pounds) (A:PAYLOAD STATION WEIGHT:5, Pounds) + 0 > 100 *</Code>
        </Parameter>
    </Animation>
            <MouseRect>
                    <Cursor>Hand</Cursor>
                    <TooltipText>All external fuel tanks release switch - Tanks are %((A:PAYLOAD STATION WEIGHT:6, Pounds) (A:PAYLOAD STATION WEIGHT:5, Pounds) + 0 >)%{if}not %{els}%{end}released</TooltipText>
        <CallbackCode>
            0 (>A:PAYLOAD STATION WEIGHT:5, Pounds)
            0 (>A:PAYLOAD STATION WEIGHT:6, Pounds)
            0 (>A:FUEL TANK EXTERNAL1 LEVEL, Percent )
            0 (>A:FUEL TANK EXTERNAL2 LEVEL, Percent )
        </CallbackCode>
            </MouseRect>
</PartInfo>

As you can see I have one switch for left tank, one for right and one that suppose to empty both of them.

The visibility, tooltips and animation works fine - I checked that by manualny setting station load in menu before starting flight...

..but for some reason I have no respons when i try to click on those switches.

Does anyone have any idea what I've screwed up again?
 
To keep it simple you could just add ~ 3 gallons of unusable fuel to each tank to compensate for the weight of the tanks themselves. Then... Just use the stock drop tanks commands.
(>K:RELEASE_DROP_TANK_1)
(>K:RELEASE_DROP_TANK_2)
(>K:RELEASE_DROP_TANK_ALL)

Use the gallons remaining (>2) of the tank(s) or a (L:Var) for the visibility of the tanks in the model.
 
I think that SIMVARS from XMLTools would work the best (specially if it would help in the future cases).

But it doesn't work:

I've used this: http://www.fsdeveloper.com/forum/resources/xmltools-2-0-xml-expansion-module-for-fsx.148/
I've copied XMLTools.dll into "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X"
I've change dll.xml file inside C:\Users\username\AppData\Roaming\Microsoft\FSX\, now it looks like that:
Code:
<?xml version="1.0" encoding="Windows-1252"?>

<SimBase.Document Type="Launch" version="1,0">
  <Descr>Launch</Descr>
  <Filename>dll.xml</Filename>
  <Disabled>False</Disabled>
  <Launch.ManualLoad>False</Launch.ManualLoad>
  <Launch.Addon>
    <Name>Object Placement Tool</Name>
    <Disabled>True</Disabled>
    <ManualLoad>False</ManualLoad>
    <Path>..\Microsoft Flight Simulator X SDK\SDK\Mission Creation Kit\object_placement.dll</Path>
  </Launch.Addon>
  <Launch.Addon>
    <Name>Traffic Toolbox</Name>
    <Disabled>True</Disabled>
    <ManualLoad>False</ManualLoad>
    <Path>..\Microsoft Flight Simulator X SDK\SDK\Environment Kit\Traffic Toolbox SDK\traffictoolbox.dll</Path>
  </Launch.Addon>
  <Launch.Addon>
    <Name>Visual Effects Tool</Name>
    <Disabled>True</Disabled>
    <ManualLoad>False</ManualLoad>
    <Path>..\Microsoft Flight Simulator X SDK\SDK\Environment Kit\Special Effects SDK\visualfxtool.dll</Path>
  </Launch.Addon>
  <Launch.Addon>
    <Name>XMLTools</Name>
    <Disabled>False</Disabled>
    <ManualLoad>False</ManualLoad>
    <Path>XMLTools.dll</Path>
    <DllStartName>module_init</DllStartName>
    <DllStopName>module_deinit</DllStopName>
  </Launch.Addon>
</SimBase.Document>

I've changed codes of switches to:
Code:
<Animation name="Vanship_Left_External_Fuel_Tank" guid="66d187c5-8f82-4089-1155-7d9fdeee3186" type="Sim" typeParam="AutoPlay" length="100" typeParam2="Vanship_Left_External_Fuel_Tank" />

<PartInfo>
    <Name>Vanship_Left_External_Fuel_Tank</Name>
    <AnimLength>100</AnimLength>
    <Animation>
        <Parameter>
            <Code>(C:SIMVARS:PAYLOAD STATION WEIGHT:5, Pounds) 0 > 100 *</Code>
        </Parameter>
    </Animation>
    <Visibility>
                 <Parameter>
                        <Code>
                (C:SIMVARS:PAYLOAD STATION WEIGHT:5, Pounds) 0 >
            </Code>
                </Parameter>
        </Visibility>
            <MouseRect>
                    <Cursor>Hand</Cursor>
                    <TooltipText>First external fuel tank release switch - Tank is %((A:PAYLOAD STATION WEIGHT:5, Pounds) 0 >)%{if}not %{els}%{end}released</TooltipText>
        <CallbackCode>
            0 (>C:SIMVARS:PAYLOAD STATION WEIGHT:5, Pounds)
            0 (>C:SIMVARS:FUEL TANK EXTERNAL1 LEVEL, Percent )
        </CallbackCode>
            </MouseRect>
</PartInfo>


<Animation name="Vanship_Right_External_Fuel_Tank" guid="d24c4837-020e-44a5-9135-1e90d7d98ffc" type="Sim" typeParam="AutoPlay" length="100" typeParam2="Vanship_Right_External_Fuel_Tank" />

<PartInfo>
    <Name>Vanship_Right_External_Fuel_Tank</Name>
    <AnimLength>100</AnimLength>
    <Animation>
        <Parameter>
            <Code>(C:SIMVARS:PAYLOAD STATION WEIGHT:6, Pounds) 0 > 100 *</Code>
        </Parameter>
    </Animation>
    <Visibility>
                 <Parameter>
                        <Code>
                (C:SIMVARS:PAYLOAD STATION WEIGHT:6, Pounds) 0 >
            </Code>
                </Parameter>
        </Visibility>
            <MouseRect>
                    <Cursor>Hand</Cursor>
                    <TooltipText>Second external fuel tank release switch - Tank is %((C:SIMVARS:PAYLOAD STATION WEIGHT:6, Pounds) 0 >)%{if}not %{els}%{end}released</TooltipText>
        <CallbackCode>
            0 (>C:SIMVARS:PAYLOAD STATION WEIGHT:6, Pounds)
            0 (>C:SIMVARS:FUEL TANK EXTERNAL2 LEVEL, Percent )
        </CallbackCode>
            </MouseRect>
</PartInfo>


<Animation name="Vanship_Both_External_Fuel_Tank" guid="6ac83ec8-3664-469c-771f-912786dcddd2" type="Sim" typeParam="AutoPlay" length="100" typeParam2="Vanship_Both_External_Fuel_Tank" />

<PartInfo>
    <Name>Vanship_Both_External_Fuel_Tank</Name>
    <AnimLength>100</AnimLength>
    <Animation>
        <Parameter>
            <Code>(C:SIMVARS:PAYLOAD STATION WEIGHT:6, Pounds) (C:SIMVARS:PAYLOAD STATION WEIGHT:5, Pounds) + 0 > 100 *</Code>
        </Parameter>
    </Animation>
            <MouseRect>
                    <Cursor>Hand</Cursor>
                    <TooltipText>All external fuel tanks release switch - Tanks are %((C:SIMVARS:PAYLOAD STATION WEIGHT:6, Pounds) (C:SIMVARS:PAYLOAD STATION WEIGHT:5, Pounds) + 0 >)%{if}not %{els}%{end}released</TooltipText>
        <CallbackCode>
            0 (>C:SIMVARS:PAYLOAD STATION WEIGHT:5, Pounds)
            0 (>C:SIMVARS:PAYLOAD STATION WEIGHT:6, Pounds)
            0 (>C:SIMVARS:FUEL TANK EXTERNAL1 LEVEL, Percent )
            0 (>C:SIMVARS:FUEL TANK EXTERNAL2 LEVEL, Percent )
        </CallbackCode>
            </MouseRect>
</PartInfo>

When I first started FSX I accepted usage of that new dll file.

Switches still do nothing, but for some reason it starts flight with those PAYLOAD STATION WEIGHT set to 0 (I can see that from animation, visibility and tooltip).
 
Custom C: vars are not supported in Modeldef file. You must interface with LVars, like:

Code:
<CallbackCode>
  0 (>L:PAYLOAD STATION WEIGHT:5, Pounds)
  0 (>L:PAYLOAD STATION WEIGHT:6, Pounds)
</CallbackCode>

Then, in a typical gauge included in [VC] section of panel.cfg:

Code:
<Update>
   (L:PAYLOAD STATION WEIGHT:5, Pounds) 0 ==
   if{
       0 (>C:SIMVARS:FUEL TANK EXTERNAL1 QUANTITY,Gallons)
       0 (>C:SIMVARS:PAYLOAD STATION WEIGHT:5, Pounds)
     }
   (L:PAYLOAD STATION WEIGHT:6, Pounds) 0 ==
   if{
       0 (>C:SIMVARS:FUEL TANK EXTERNAL2 QUANTITY,Gallons)
       0 (>C:SIMVARS:PAYLOAD STATION WEIGHT:6, Pounds)
     }
</Update>

From this starting point you can add whatever extra code would be needed to obtain the final result.

Tom
 
But if I create custom variables L: PAYLOAD STATION WEIGHT, wont they be equal 0 by default and thus change SIMVARS:pAYLOAD STATION WEIGHT and SIMVARS:FUEL TANK EXTERNAL1 QUANTITY to 0 at the start?
 
Yes, of course. That's the reason I spoke of a starting point;)

Simply config those LVars with greater than zero values, for example:

Code:
<Update>
  (L:Payload Init, bool) !
  if{
      (A:PAYLOAD STATION WEIGHT:5, Pounds)  (>L:PAYLOAD STATION WEIGHT:5, Pounds)
      (A:PAYLOAD STATION WEIGHT:6, Pounds)  (>L:PAYLOAD STATION WEIGHT:6, Pounds)
      1 (>L:Payload Init, bool)
    }
   etc.
   etc.
</Update>


Tom
 
Wait!



Those Event IDs are not present on the official list: https://msdn.microsoft.com/en-us/library/cc526980.aspx

Does it mean there are more Events? Is there another list with them?

PS.: Thanks spokes2112! It works!
They have been in the sdk's since at least fs9, no idea what is missing from the esp sdk but the acceleration sdk had some extra events in it from previous vers...
The drop tank events are only partly implemented, basically all they do is empty the external tanks of fuel there is no corresponding A:var for them
 
Back
Top