July 28, 201213 yr Hi guys, I'm doing a little private user mod for ground spoilers and reversers, as there are custom L:var animations for ground spoilers and reversers which are not linked to the existing panel. As I'm XML illiterate I had to use codes from other forum postings, and I got the both of them working. However there's no animation e.g. the spoilers and reversers extend and retract instantly. I think may be caused by the panel as The spoiler and reverser levers are like "on or off" switches, or perhaps it's something I didn't know about. I'm pretty certain there are animations contained in the MDL file but I can't get them to work in my XML gauge. maybe it's something to do with the keyframes. Here's the code for the reversers and spoilers: <Element> <Select> <Value> (A:TURB ENG REVERSE NOZZLE PERCENT:1,percent) 1 > if{100} els{0} (>L:LeftReverser,number) (A:TURB ENG REVERSE NOZZLE PERCENT:2,percent) 1 > if{100} els{0} (>L:RightReverser,number) </Value> </Select> </Element> <Element> <Select> <Value> <!-- Right Spoiler --> (A:SIM ON GROUND, bool) 1 == (A:SPOILERS HANDLE POSITION,percent) 2 > & if{100} els{0} (>L:GroundSpoiler2,percent) <!-- Left Spoiler --> (A:SIM ON GROUND, bool) 1 == (A:SPOILERS HANDLE POSITION,percent) 2 > & if{100} els{0} (>L:GroundSpoiler1,percent) </Value> </Select> </Element>
July 28, 201213 yr The spoiler and reverser are default parts which will be contained in the model file. The timing for the spoilers is done in the aircraft.cfg similar to this:- [airplane_geometry] : : spoiler_limit =0.1 spoiler_extension_time =2.0 <===== spoiler_handle_available =1 : : There is also an entry in the *.air file, Section 1101, for 'Spoiler Cycle Time (secs) = 2.00000 ' I cannot find any entry defining the reverser timing. The XML code syntax requires a space after every { and a space before every } thus:- Element> <Select> <Value> <!-- Right Spoiler --> (A:SIM ON GROUND, bool) 1 == (A:SPOILERS HANDLE POSITION,percent) 2 > & if{ 100 } els{ 0 } (>L:GroundSpoiler2,percent) <!-- Left Spoiler --> (A:SIM ON GROUND, bool) 1 == (A:SPOILERS HANDLE POSITION,percent) 2 > & if{ 100 } els{ 0 } (>L:GroundSpoiler1,percent) </Value> </Select> </Element> <Element> <Select> <Value> (A:TURB ENG REVERSE NOZZLE PERCENT:1,percent) 1 > if{ 100 } els{ 0 } (>L:LeftReverser,number) (A:TURB ENG REVERSE NOZZLE PERCENT:2,percent) 1 > if{ 100 } els{ 0 } (>L:RightReverser,number) </Value> </Select> </Element> Regards, Ted.
July 29, 201213 yr Commercial Member It may be worthwhile loading the model into modelconverterX. With MCX you can step through the animations frame by frame which will tell you what keyframes the model is using for the spoilers and reversers. I'd also try this code for the reversers (assuming the keyframes for the reverser go up to 100) <Element> <Select> <Value> (A:TURB ENG REVERSE NOZZLE PERCENT:1,percent) (>L:LeftReverser,number) (A:TURB ENG REVERSE NOZZLE PERCENT:2,percent) (>L:RightReverser,number) </Value> </Select> </Element> There really isn't any need to check the value of the reverse nozzle var and the check you are doing is either setting the L var to 100 or 0 with none of the inbetween values. With reverse nozzle and spoilers the A: vars will return 0 if they are closed, between 1 and 99 while they are opening and 100 when open. Without being able to know the exact details of the model simply writing the A: vars into the L: vars should give you stages inbetween when they are opening or closing. www.antsairplanes.com
July 31, 201213 yr Author Many thanks for the help, I'm still experimenting with the gauges. The thrust reverser animations are now working thanks to Ant's codes. It may be worthwhile loading the model into modelconverterX. With MCX you can step through the animations frame by frame which will tell you what keyframes the model is using for the spoilers and reversers. Something is weird here, with MCX I can see the 100 keyframe animations for the ground spoilers, but I simply cannot get the ground spoiler L:var to animate. It's almost as if the L:var is just an on/off switch with 1 keyframe. Too bad those animations I've identified in MCX have generic "Ambient len" labels and I can't find a way to investigate further.
July 31, 201213 yr Hi, It's really very simple if you remember one thing - the value of the variable used in these XML parts becomes the displayed keyframe number of the part. So your original code only had 2 values - 0 and 100. This means that only those two keyframes were displayed, and the others were never seen. Anthony's code changed that so all values were assigned to the variables and thus all keyframes were displayed in FS. One other way to get the middle keyframes displayed is to add a Lag statement into the code, which slows down the transition between 0 and 100 keyframes. Thus you see the opening and closing. This also has the advantage of allowing *you* to determine the animation speed, without having to adjust the aircraft.cfg file (for some variables there is really no other way). Hope this helps, Tom Gibson CalClassic Propliner Page
August 1, 201213 yr Commercial Member The Spoilers may be causing some problems if you are trying to get them to work like real world ones do which would require some fancy logic. Perhaps if you use similar code for the reverse thrusters example but use the following vars instead of the handle position: A:SPOILERS LEFT POSITION,percent A:SPOILERS RIGHT POSITION,percent One thing I can recommend is creating a status gauge. This need only be very simple and you can use it to display the values of any variables. This can solve a heck of a lot of headaches by letting you know what numbers are actually being used by the vars which should help you tell what is going on within FSX. Here is a simple example: You would need to create a graphics file called "ConfigPanel.bmp" maybe 1024x200 pixels in size as a background image. You can then copy and paste the string elements (I have included three in the example) changing the x and y positions to map them across the screen. You then only need to plug in the variable names into the string statements. Finally add the gauge as a popup panel to the aircraft and that is it. <Gauge Name="radio" Version="1.0"> <Image Name="ConfigPanel.bmp"/> <Element> <Select> <Value> // Put some calc code in here if you to test some calcs </Value> </Select> </Element> <!-- ============================== First Column Engine Stuff ======================= --> <Element> <Position X="0" Y="5"/> <Text X="200" Y="10" Length="30" Fixed="Yes" Font="Quartz" Adjust="Center" VerticalAdjust="Center" Color="#22FF22" Bright="Yes"> <String>starter: %((A:TURB ENG MASTER STARTER SWITCH:1,bool))%!.6f!</String> </Text> </Element> <Element> <Position X="0" Y="15"/> <Text X="200" Y="10" Length="30" Fixed="Yes" Font="Quartz" Adjust="Center" VerticalAdjust="Center" Color="#22FF22" Bright="Yes"> <String>ignition: %((A:TURB ENG IGNITION SWITCH:1,bool))%!6.2f!</String> </Text> </Element> <Element> <Position X="0" Y="25"/> <Text X="200" Y="10" Length="30" Fixed="Yes" Font="Quartz" Adjust="Center" VerticalAdjust="Center" Color="#22FF22" Bright="Yes"> <String>gen starter: %((A:GENERAL ENG STARTER ACTIVE:1,bool))%!6.2f!</String> </Text> </Element> </Gauge> www.antsairplanes.com
August 1, 201213 yr Author Again many thanks for the help, I've discovered from Ant's status gauge that the ground spoilers L:var animation doesn't actually run from 0 to 100 percent, instead it runs from 0 to 1 percent, with 1 percent being fully deployed and 0.5 being half deployed. What I need to is to modify the gauge so it will force the ground spoilers to deploy at x100 slow motion.
August 2, 201213 yr Author After countless hours of trial and error (I'm XML iliterate, you know) I've finally found a way get the ground spoiler animations working properly. I had to look at the Posky 777 XML animation gauges to figure out the way. (A:SIM ON GROUND, bool) 1 == (A:SPOILERS LEFT POSITION,percent) max 0 - 0.01 * 1 min (>L:GroundSpoiler1,percent) Again many thanks for the help.
Create an account or sign in to comment