FS2004 XML help please for a Supercharger

#1
Greetings fellas. I'm having problems with this Supercharger, I was granted permission to use this code for a 4 engine aircraft, for my single engine but I tried to reduce the entries to a single engine, and it's not functioning. Could you check it for me? I have an active light and a mod/auto switch to function. Neither does anything. Thank you, I appreciate any help.

HTML:
<Gauge Name="Supercharger" Version="1.0">
   <Image Name="Supercharger_background.bmp"/>
   <Element>
      <Position X="48" Y="32"/>
      <Select>
         <Value>(A:RECIP ENG EMERGENCY BOOST ACTIVE:1,bool) + 0 !=if{  (A:Gear left position,percent) near 100 == }			


			</Value>
         <Case Value="0">
            <Image Name="SUPER_Light_off.bmp"/>
         </Case>
         <Case Value="1">
            <Image Name="super_light_on.bmp"/>
         </Case>
      </Select>
   </Element>
   <Element>
      <Position X="190" Y="14"/>
      <Select>
         <Value>(A:RECIP ENG EMERGENCY BOOST ACTIVE:1,bool)</Value>
         <Case Value="1">
            <Image Name="super_switch_on.bmp"/>
         </Case>
         <Case Value="0">
            <Image Name="super_switch_off.bmp"/>
         </Case>
      </Select>
   </Element>
   <Mouse>
      <Area Left="84" Top="27" Width="29" Height="30">
         <Cursor Type="Hand"/>
         <Click>1 (&gt;L:Supercharger_FS,bool)


			</Click>
         <Tooltip>Supercharger Setting</Tooltip>
      </Area>
   </Mouse>
</Gauge>
 

n4gix

Resource contributor
#2
It won't work for quite a few reasons, but the primary reason is that there's no XML K:event in FS to turn on the Boost! Here is a post I made at AVSIM back in 2008:

=======================================
There used to be a C event called KEY_WAR_EMERGENCY_POWER but it no longer appears in the FSX SDK's listing of event_ids...
...even though it is still listed in FSX's gauges.h file!

As I recall though, there never was any XML token event for the command, which is why I wrote and released a small C gauge that provides an XML "command" that is "translated" by the hidden C gauge for this purpose.
XML Code:

Code:
<Click>(L:WEP_Boost,enum) ! (&gt;L:WEP_Boost,enum)</Click>
Use the above in your <Mouse> area. When the XML_WarEmerPower gauge detects the L:WEP_Boost variable is 1, it will switch on WEP in the sim, then reset the L:WEP_Boost variable back to zero to prevent looping.

It's still here at avsim.com in the File Library. xml_wep.zip
===========================================

In your first <Element> you have this, which is simply nonsense. Use the same script you've used in the second <Element> section:

Code:
         <Value>(A:RECIP ENG EMERGENCY BOOST ACTIVE:1,bool) + 0 !=if{  (A:Gear left position,percent) near 100 == }			
			</Value>
 
Last edited:
#3
Thanks Bill, as always your help is very much appreciated. If I could ask, what would be the test scenario in the sim to see if the WEP kicks in?

Off to test

Doug
 

n4gix

Resource contributor
#4
I did notice during testing of the C function, that the state variable remains at a zero value until manifold pressure has increased above some threshold.

Reducing MP will automatically toggle WEP off, and subsequently increasing MP will NOT trigger WEP again unless you've selected WEP explicitly again.

That is precisely why one cannot use my XML command to control their visible switch and/or light. The C gauge resets the command token back to zero immediately.

In short, flipping ON the WEP is simply "arming the system" so to speak. It will actually trigger at some manifold pressure and remain active until reducing manifold pressure below the trigger value.

How you will know it's working is because you'll see a subtantial increase in the achievable manifold pressure, as well as a huge increase in apparent power! :D

See this thread at AVSIM for more information: http://forum.avsim.net/topic/72992-...gency boost active__fromsearch__1#entry509732
 
#5
Wow, what's with that douglas guy? That was uncalled for....
So if I understand correctly I put the C gauge in the cab file, make the gauge02= entry in the panel cfg, then add the line in the <mouse> <click> section of the Supercharger. XML, and change the garb from the first <element> section to same as the second <element> section?

This is what I've done, and have no errors so far. (lol...)

Now in the airfile, Airwrench allows entry for Emergency Power. Currently the Est.Normal Rated Power is entered at 2250HP. Should I enter a percentage of HP over the ENRP or the actual boost max HP?

Thanks again Bill.

Doug Smith
 

n4gix

Resource contributor
#7
Wow, what's with that douglas guy? That was uncalled for....

So if I understand correctly I put the C gauge in the cab file
No, the .gau file should either be placed in the sim's ..\Gauges folder, or your aircraft's ..\panel folder.

I included a readme.txt file in the zipped package. ;)

There are entries required in the aircraft.cfg file:

emergency_boost_type=0
emergency_boost_mp_offset=0.000
emergency_boost_gain_offset=0.000
emergency_boost_duration=0

You need to read the SDK for details of each entry, but for the emergency_boost_type the following flags are used
Integer value indicating the emergency boost type available, one of:
0 = None
1 = Water Injection
2 = Methanol/Water Injection
3 = War Emergency Power, (typically used in WWII combat aircraft).
 
Last edited:
#8
Ok thanks for clearing Bill. That's what I thought, and initially added it to the cab file. Wouldn't you know it, since making WEP available through Airwrench, these values were added to the cfg.
Referring to the "emergency_boost_duration= ", the duration in my research files says for 5 minutes. Is that easily expressed as 5.000? Should I indicate minutes, or is that a given?

Also, does anyone know if Robert is still involved in simming/ designing and is he reachable? I think I should ask him about using that Supercharger code, it's a gem.
Thanks for the tip Wozza, I had that one in my files already:)
With your Mustangs for FS2004, did they not have WEP and was that factored into your model? BTW, they are still one of my favorite aircraft. I hope you like the Firefly I'm releasing.

Cheers
Doug
 

n4gix

Resource contributor
#9
Doug, emergency_boost_duration= is expressed in seconds, so 5 minutes would be:

emergency_boost_duration=300.00

Most of the stuff in the .air file has been either duplicated or superceeded by entries in the aircraft.cfg file. But, as you've discovered, if you add some things to the .air file, it will automatically update the aircraft.cfg file for you with some base values.

The main point though is that you could have added those entries directly in the aircraft.cfg file without bothering with the .air file at all...
 
Last edited:
#10
Hi
Dont know about Robert my last few emails over the last couple of years didnt get a reply :)
The mustang used Roberts code with a few mods
Cheers
Wozza
 
#11
Hi everyone... and Bill @n4gix!

I know that this post concerns FS2004, but as I want to use this Bill gauge, let me revive the discussion:

I try to use the gauge for starting my booster WWII aircraft for FSX. I have scrupulously followed the "readme.txt" for installation. Then, in my xml gauge in the modeldef.xml file, the variable (L: WEP_Boost, enum) is set to 1 after a mouse click; but the variable (A: RECIP ENG EMERGENCY BOOST ON: 1, bool) remains at 0 despite a high pressure manifold ... !!! Why?

Thank you for your help ...
 
#12
What ver of fsx are you using? fsx acceleration (sp2) used some different tags ...anyway make sure you have the needed sections in your aircraft.cfg?
this was used in fsx acceleration to model a 2 stage supercharger so the figures have been fudged a bit
but gives you an idea of whats needed
Code:
turbocharged= 0                                              //Is it turbocharged? 0=FALSE, 1=TRUE
max_design_mp= 44.8                                       //Max design manifold pressure, (inHg)
min_design_mp=0.0
critical_altitude=16500
supercharged=1                                                     // on/off
supercharger_boost_low_end=1.00                  //multiplier on manifold pressure at low RPM
supercharger_boost_high_end=2.65                //multiplier on manifold pressure at high RPM
supercharger_power_cost=0.10  
emergency_boost_type=0 
emergency_boost_mp_offset=0.0
emergency_boost_gain_offset=0.0 
fuel_air_auto_mixture=0 
auto_ignition=0 
emergency_boost_duration=300.0 
max_rpm_mechanical_efficiency_scalar=1.0
idle_rpm_mechanical_efficiency_scalar=1.0
max_rpm_friction_scalar=1.0
idle_rpm_friction_scalar=1.0
BestPowerSpecificFuelConsumption=0.5
detonation_onset=45.0

[Nitrous System.0]
reservoir_size=100.0                                        // gallons
flow_rate=0.01                                                   // gallons per minute
mp_boost=1.40
 
#13
Hi @Au-MaV,

I use FSX Acceleration! Yes, my aircraft.cfg contains the necessary sections.

It is as if the variable (L: WEP_Boost, enum) was not recognized by the gauge of Bill ... This variable can it actually be used in the modeldef.xml? Or should I use another way ...?
 

n4gix

Resource contributor
#14
Chris, as noted in the discussion at AVSIM, the sim's variable will remain zero until a sufficiently high manifold pressure is reached, at which time it will change to one. The WEP command acts as an "arming" system rather than a "do it now" system! :wizard:

I should emphasize that I haven't even thought about WEP for many, many years. I have no idea whatever if the WEP system in FSX even works the same way as FS9.
 
#15
Chris, as noted in the discussion at AVSIM, the sim's variable will remain zero until a sufficiently high manifold pressure is reached, at which time it will change to one. The WEP command acts as an "arming" system rather than a "do it now" system! :wizard:

I should emphasize that I haven't even thought about WEP for many, many years. I have no idea whatever if the WEP system in FSX even works the same way as FS9.
Hi Bill and thank you for your answer!

I understand the need for sufficiently high manifold pressure.... In my test, my manifold pressure is in the red zone, so very high; the variable (L: WEP_Boost, enum) = 1, but (A: RECIP ENG EMERGENCY BOOST ON: 1, bool) remainder = 0 without ever becoming = 1 ...! :mad:
 
#16
Hi Chris
like Bill its been a while since playing with wep..Accel actually supports wep much better due to the default mustang...Im not even sure if the older wep stuff works anymore
To toggle it on I used
Code:
<Gauge Name="Make it So">
          <Element>
      <Select>
         <Value>(L:boostit, bool) 0 &gt;
        if{ (A:RECIP ENG NITROUS TANK VALVE:1,number) 1 &lt; if{ (&gt;K:NITROUS_TANK_VALVE_TOGGLE) } }
        els{ (A:RECIP ENG NITROUS TANK VALVE:1,number) 0 &gt; if{ (&gt;K:NITROUS_TANK_VALVE_TOGGLE) } }
</Value>
    </Select>
  </Element>
</Gauge>
not sure if its the best way, but if you look at the sdk doc on the accel new tags should provide more info
 
#17
Hi Au-MaV,

That's probably a good alternative. It will be simply a little strange to use a nitrous system on a plane from the Second World War !! But apart from me, who will know that? ;)

I'll test as soon as I can ...

Thank you for the help!
 
#18
Hi Mate
Umm the Germans used NOS throughout the war..not sure when the allies started using it but they did......also used was water/menthol.... mainly for detonation suppression but also helped with a but more TTFN power
 
Top