Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
  YaBB is sponsored by XIMinc!

FFDS Home | TIPS Section | Tutorials Section | Resources Section | Utilities Section

Military | FSDS | Jetliners | Real Planes Section | Gmax | Rotorcraft | Business | Civilian

  HomeHelpSearchLoginRegister  
 
 
Pages: 1 
Send Topic Print
Auto Slats FSX (Read 4741 times)
17th Jun, 2008 at 1:31am

Nije32   Offline
Spline Extruder
FFDS the digital saviours!

Gender: male
Posts: 231
***
 
Hi guys, doing an A4 which has leading edge slats that push back into the wing once air pressure from forward flight reaches a certain point. How do I mimick this in FSX?
Have tried the following but didn't work. I want to avoid visibilty animations as I want to see the parts actually move.
Thanks in advance
Nigel  Roll Eyes

Code:
   <PartInfo>
	  <Name>Auto_slats</Name>
	  <AnimLength>100</AnimLength>
	  <Animation>
		<Parameter>
		<Code>
	   (A:AIRSPEED TRUE, KNOTS) 150 &lt;
			if{
			    (A:LEADING EDGE FLAPS RIGHT PERCENT, percent) 50 +
			  }
			els{ 0 }
		</Code>
                </Parameter>
	  </Animation>  
    </PartInfo> 


 
IP Logged
 
Reply #1 - 17th Jun, 2008 at 9:51am

Fr. Bill   Offline
Inspecteur des Polygonnes
I used to have a life:
now I have GMax...
Hammond, IN

Gender: male
Posts: 5426
*****
 
You can NOT change the values of any "read only variables." IOW, all the state variables A:, E:, or P:...  Shocked

You can only use key_events (stock commands) or custom_events (those you invent) to affect things... Wink

Try this on for size then:

Code:
   <PartInfo>
	  <Name>Auto_slats</Name>
	  <AnimLength>100</AnimLength>
	  <Animation>
		<Parameter>
		<Code>
                        (A:AIRSPEED TRUE, KNOTS) 150 &lt;
			if{
			    (>L:MySlats, enum) 50 +
			  }
			els{ 0 }
		</Code>
                 </Parameter>
                 <Lag>200</Lag>
	  </Animation>  
    </PartInfo>
 

 

Fr. Bill
Gauge Programming - 3d Modeling Eaglesoft Development Group Intel Core 2 Quad Q6600-4 GB DDRII Crucial PC6400-500 GB SATA-ATI Radeon HD2400 Pro 256MB
IP Logged
 
Reply #2 - 17th Jun, 2008 at 12:15pm

Nije32   Offline
Spline Extruder
FFDS the digital saviours!

Gender: male
Posts: 231
***
 
Hmmm, I canna get it to go captain....
I just call the part Auto_Slats and animate it aye... then of course make the entries in the Modeldef.xml and wallah?
Cheers Nije

 
IP Logged
 
Reply #3 - 17th Jun, 2008 at 4:38pm

jimslost   Offline
LDV Engineer
The more I learn, the
less I know

Posts: 337
****
 
My skills in xml are minimal, but with his blessing I modified Wozza's autoslat gauge for my Moth and it works in both FS9 and FSX (although the slats deploy and retract at about 3 kts slower speed in FSX-??).  I'm building in FSDSv3.5.1 for FS9.  I named the part r_pct_lead_edge_flap0 (or l_ as the case may be) which I pulled out of the FS9 MakeMDL document.  The format may look odd (and I can't remember why I did it this way) but again, it works for me.  Maybe it will work for you.

BTW I called them "AUTOSLOTS" because that's what Handley Page and De Havilland called them. 


<Gauge Name="AUTOSLOTS">
  <Comment>
  </Comment>
  <Update Frequency="6"/>
  <Element>
    <Select>
<Value>(A:SPOILERS RIGHT POSITION,position) 0 == (A:INCIDENCE ALPHA,
degrees) 8 >  (A:Airspeed select indicated or true,knots) 55 &lt; and and

<!--TRUE: If flaps are not (all the way) down, drop
them-->
if{ (A:Flaps Handle Percent, Percent) 100 != if{
(>K:FLAPS_DOWN) } }

<!--FALSE: If flaps are not (all the way) up, raise
them-->
els{ (A:Flaps Handle Percent, Percent) 0 != if{
(>K:FLAPS_UP) } }
      </Value>
    </Select>
  </Element>
</Gauge>

jim
 
IP Logged
 
Reply #4 - 17th Jun, 2008 at 7:22pm

Fr. Bill   Offline
Inspecteur des Polygonnes
I used to have a life:
now I have GMax...
Hammond, IN

Gender: male
Posts: 5426
*****
 
I really shouldn't try to think that early in the morning...

Code:
   <PartInfo>
	  <Name>Auto_slats</Name>
	  <AnimLength>100</AnimLength>
	  <Animation>
		<Parameter>
		<Code>
			(A:AIRSPEED TRUE, KNOTS) 150 &lt;
			if{
			    50 (>L:MySlats,enum)
			  }
			els{ 0  (>L:MySlats,enum) }
		</Code>
		     </Parameter>
		     <Lag>200</Lag>
	  </Animation>  
    </PartInfo>
 

 

Fr. Bill
Gauge Programming - 3d Modeling Eaglesoft Development Group Intel Core 2 Quad Q6600-4 GB DDRII Crucial PC6400-500 GB SATA-ATI Radeon HD2400 Pro 256MB
IP Logged
 
Reply #5 - 18th Jun, 2008 at 10:40am

Nije32   Offline
Spline Extruder
FFDS the digital saviours!

Gender: male
Posts: 231
***
 
Cheers Guys, most helpful as per usual however I wonder if I am doing something wrong in FSDS as it doesn't animate despite altering and tweaking. Other than the modeldef entries and the Auto_Slats part in FSDS animated at keyframes 0 10 20 30 40 50 60 70 80 90 and 100 what else am I missing?
I'm such a dumb bum with this stuff!!
Undecided
 
IP Logged
 
Reply #6 - 18th Jun, 2008 at 7:03pm

jimslost   Offline
LDV Engineer
The more I learn, the
less I know

Posts: 337
****
 
I'm no genius myself, so don't feel like the Lone Ranger.  Were it not for dumb luck and the wisdom of those who have gone before me, I wouldn't get anything done.

Just to make sure we're on the same page, this is a step-by-step of how I installed my autoslot xml switch.  If this is too basic for you, ignore me (my kids can teach you how to do that in one easy lesson). 

1.  Name the part using an appropriate name from the list in the MakeMDL document or the MakeMDL.parts xml (I use the former).    As I noted before, I named my slats
r_pct_lead_edge_flap0  and l_pct_lead_edge_flap0

2.  Animate the part.  I note you used 10 different keyframes.  On my plane the travel is quite small so I used only two, 0 for retracted and 100 for fully deployed.  I have found that simpler is better, as it gives me fewer chances to make errors (and I tend to make errors whenever given a chance).

3.  Place the xml switch in your (aircraft name)\panel\(specificly named aircraft gauges) folder; in my case  that's the De Havilland 60G\panel\UK_Moth folder.  To be on the safe side, try using an xml switch that someone else says works.  Mine works.  I assume Fr. Bill's works or he would not have posted it.  If you can get a switch to work at all, you can always go back later to modify it to suit your needs, but for now we just want something that works.

4.  Add a line to your panel.cfg file that tells FS where to find the switch.  I placed it as the last item in my [VCockpit01] list of gauges and it reads:

   gauge08=UK_MOTH!AUTOSLOT,          0,  0,  0,  0   

Make certain that you have everything formated exactly because I've been known to spend days looking for problems that turned out to be simple misplaced punctuation marks in configuration files.

I trust the Great Brains will speak up if I've skipped a step, but I think this will work.  Keep us posted.

jim
 
IP Logged
 
Reply #7 - 18th Jun, 2008 at 10:30pm

Nije32   Offline
Spline Extruder
FFDS the digital saviours!

Gender: male
Posts: 231
***
 
Ok, I'll get onto that today and post back... if successfull will add to WORKING XML CODES crediting you wise blokes  Grin
 
IP Logged
 
Reply #8 - 19th Jun, 2008 at 1:43am

Au-MaV   Offline
Inspecteur des Polygonnes
Whatcha lookin at
Adelaide South Australia

Gender: male
Posts: 1956
*****
 
Hi
Bills code will give you the animation but wont effect the FDE
If you want to generate a little bit of lift then using the flaps or spoiler will help
the problem comes up when you aircraft already uses these(ie the tiger moth has no flaps:) )
If you are already using flaps you can use the first indent as slats then the remaining indents as normal flaps.You will need to animate the slats as flaps say kf 0 slats closed kf  25 slats open
then animate the flaps kf0 up kf 30 up kf 100 down
You can then use something like K:AXIS_FLAPS_SET 

something like this..this was used for a swing wing aircraft which animated the wings as flaps
if L:lock,enum is 0 the the flaps will only travel 80% of the travel,if its 1 then the flaps will travel 100%
its not perfect and only kinda works just throwing it up so to give you an idea of the syntax.You could use Bills code above and use the L:MySlats,enum to trigger the flap/slat position
Code:
<Gauge Name="Spoiler_ding"
Version="1.0">
<Element>
  <Select>
    <Value>
	(L:lock,enum) 1 ==
	if{
	  (L:spl_drop,bool)
	  if{
	    0 (&gt;L:spl_drop,bool)
	   16384 (&gt;K:AXIS_FLAPS_SET)
	  }
	}
	els{
	(A:FLAPS HANDLE PERCENT,percent) 100 ==
	if{
	  (L:spl_drop,bool) !
	  if{
	    1 (&gt;L:spl_drop,bool)
	   12000 (&gt;K:AXIS_FLAPS_SET)
	  }
	  els{
	    0 (&gt;L:spl_drop,bool)
	    -16384 (&gt;K:AXIS_FLAPS_SET)
	  }
	}
  </Value>
 </Select>
</Element>
</Gauge>

 



cheers
Wozza
 
IP Logged
 
Reply #9 - 19th Jun, 2008 at 1:56am

Nije32   Offline
Spline Extruder
FFDS the digital saviours!

Gender: male
Posts: 231
***
 
Lol I think that went well over my head....
Just be happy to have it animate at this stage. No luck as yet using the gauge approach nor the part. I am doing something wrong somewhere, just gotta find where.
BTW Wozza, you gonna sign the online petition for YSSY TODAY to get its own server from GameArena? Do you use the YSSY Today server? Swear I have seen you there....
Cheers Nigel
Nije32
 
IP Logged
 
Reply #10 - 19th Jun, 2008 at 2:15am

Au-MaV   Offline
Inspecteur des Polygonnes
Whatcha lookin at
Adelaide South Australia

Gender: male
Posts: 1956
*****
 
Hi Mate
YSSY today nfi what that is Smiley linkage? only online gaming I do on GA is BF2
re the slats Bills code should work at least from the visual side of things are you knocking up a new GUID for the animation ?
Wozza
 
IP Logged
 
Reply #11 - 19th Jun, 2008 at 5:04am

Nije32   Offline
Spline Extruder
FFDS the digital saviours!

Gender: male
Posts: 231
***
 
Hi Wozza, ah yes I sold BF2 and went to Call of Duty 4 which seems to lack in many ways but has nice graphics. I miss the choppers and WAKE and being able to drive or fly everything.
 Yeh YSSY server is the ozzies main FSX server and is run by a great bunch of very professional yet humourous blokes who man the tower, ground and a center at Sydney and usually another twr and grn at another airport.. very enjoyable experience.
 Anyways, here is what I have done...
used the following code for the modeldef.xml
Code:
<Animation name="Auto_Slats" guid="EF79F3D9-01AC-40f8-A492-139487DF000E" length="100" type="Sim" typeParam2="Auto_Slats" typeParam="AutoPlay" />

<PartInfo>
	  <Name>Auto_slats</Name>
	  <AnimLength>100</AnimLength>
	  <Animation>
		<Parameter>
		<Code>
			(A:AIRSPEED TRUE, KNOTS) 150 &lt;
			if{
			    50 (>L:MySlats,enum)
			  }
			els{ 0  (>L:MySlats,enum) }
		</Code>
		     </Parameter>
		     <Lag>200</Lag>
	  </Animation>  
    </PartInfo>
 


In addition I have made the leading edge slat and called it Auto_Slat (rather selected from the list in FSDS). I have animated it at 0 (Retracted) and 100 (deployed). I have tied it to a non animated DUMMY part as an axis.
I have tried a number of alterations to Bills code inc different conditions that I know work such as
(A:RADIO HEIGHT, feet) 10000 &lt; but to no avail. I think its something to do with being a custom animation. I understand visibilty xml stuff reasonably well thanks to Bill but custom L: varaibles etc blow me away.
Cheers Nigel
 
IP Logged
 
Reply #12 - 19th Jun, 2008 at 7:06am

Au-MaV   Offline
Inspecteur des Polygonnes
Whatcha lookin at
Adelaide South Australia

Gender: male
Posts: 1956
*****
 
Hi
Well I had a few min to kill and tried the code and no matter what couldnt get it to work
The more I play with fsx the more I hate the bloody thing.I tried my slat code in fs9 and it worked first up
sorry but by all accounts it should work ??????
Ill try and fudge it later tonight but maybe before then one of the madmen that work in fsx will be able to help Cheesy
cheers
Wozza
 
IP Logged
 
Reply #13 - 19th Jun, 2008 at 9:08am

Nije32   Offline
Spline Extruder
FFDS the digital saviours!

Gender: male
Posts: 231
***
 
Cheers chap, I'm am quietly glad it didn't work cos it confirms my pile PC isn't an issue. I guess its like anything, will take a bit of work. Perhaps someone has a custom code we can rewrite/alter to suit? Could be a handy addition to the XML WORKING forum. I'll keep playing and see what transpires.

Thanking you and Bill
Nigel  Shocked
 
IP Logged
 
Reply #14 - 19th Jun, 2008 at 12:22pm

jimslost   Offline
LDV Engineer
The more I learn, the
less I know

Posts: 337
****
 
Just to be sure, I tried Wozza's code and my modified version of it and both work in FS9 and FSX. 

Actually I find FSX quite useful, Wozza.  I keep the disk in my survival kit so that if I go down out here in the desert, I'll have a signal mirror.
 
IP Logged
 
Reply #15 - 19th Jun, 2008 at 1:20pm

Au-MaV   Offline
Inspecteur des Polygonnes
Whatcha lookin at
Adelaide South Australia

Gender: male
Posts: 1956
*****
 
LOL Jim If I did that with my fsx luck Id blind the rescue pilot and he crash,I use mine as a coaster safer that way Smiley  

Ok I got it to work through the brute force method,there is something wrong with fsds when working with fsx,I think its not the code but has something to do with how fsds and xtomdl work together.anyway what I did was a simple keyframed animation and then a normal xml gauge code controller to work the action,not elegant but it works Smiley
So until I can work out a better way this will have to do LOL
the part xml code and guid,animate the part kf0 closed kf100 up
make sure its a parent of some other part  
Code:
     <Animation name="test_slat" guid="1D7F7013-28B4-4316-8947-12B3A5ABD8D0" length="100" type="Sim" typeParam2="test_slat" typeParam="AutoPlay" />

    <PartInfo>
	  <Name>test_slat</Name>
	  <AnimLength>100</AnimLength>
	  <Animation>
		<Parameter>
		    <Code>
			  (L:test_slat,number) 100 *
		    </Code>
		    <Lag>400</Lag>
		</Parameter>
	  </Animation>
    </PartInfo>

 



Then put this in as a hidden gauge somewhere in the VC section of the panel.cfg
Code:
<Gauge Name="slat a day" Version="1.0">
   <Element>
	<Select>
    <Value>(A:AIRSPEED SELECT INDICATED OR TRUE, KNOTS) 150 &lt; if{ (L:test_slat,number) 1 &lt; if{ 1 (>L:test_slat,bool) } }
 els{ (L:test_slat,number) 0 &gt; if{ 0 (>L:test_slat,bool) } }</Value>    
	</Select>
   </Element>
 </Gauge>

 



Cheers
Wozza



 
IP Logged
 
Reply #16 - 19th Jun, 2008 at 8:24pm

Nije32   Offline
Spline Extruder
FFDS the digital saviours!

Gender: male
Posts: 231
***
 
WORKS A TREAT WOZZA!
Grin
Yep, very happy with that, will alter lag to get it to slow down a bit but thankyou very much for playing guinea pig. Perhaps Felix can move/copy this to the 'WORKING XML' page?
Also many thanks to Bill L for his coding and Jim. Awesome job, really appreciated.
Regards Nigel  Cool
 
IP Logged
 
Reply #17 - 20th Jun, 2008 at 10:25am

Felix/FFDS   Offline
YaBB Administrator
It is my solemn duty to
obfuscate and confuse.
YaBB Admin Land

Posts: 4593
*****
 
Nigel - may I suggest that you do a NEW post at the XML Working COdes board that summarizes the problem and provides the final working code.  That way, a reader can see the code directly.  A link to this thread would be convenient for the reader that wants to see the "How you got to the final code".

 

Felix/Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login or Register
IP Logged
 
Reply #18 - 20th Jun, 2008 at 11:37am

Nije32   Offline
Spline Extruder
FFDS the digital saviours!

Gender: male
Posts: 231
***
 
Great call Felix, will do when I get home again later.
Cheers muchly
Nigel
 
IP Logged
 
Reply #19 - 24th Jun, 2013 at 6:16am

ukmil   Offline
Spline Extruder
I Love FFDS!

Posts: 125
***
 
I am looking to amend this script, for my current project.  I would like to have auto slats, but between a speed range of 90-250knts.

So currently, I have amened the gauge script to set &lt 250Knts, but how do I add the &gt 90 knts?
 

Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login or Register
IP Logged
 
Reply #20 - 25th Jun, 2013 at 1:14pm

Fr. Bill   Offline
Inspecteur des Polygonnes
I used to have a life:
now I have GMax...
Hammond, IN

Gender: male
Posts: 5426
*****
 
ukmil wrote on 24th Jun, 2013 at 6:16am:
I am looking to amend this script, for my current project.  I would like to have auto slats, but between a speed range of 90-250knts.

So currently, I have amened the gauge script to set &lt 250Knts, but how do I add the &gt 90 knts?


Use the "rng" function:
Code:
90 250 (airspeed,knots) rng if{ do something here } 


In essence this is saying if the airspeed is in the range of 90 to 250 knots, "do something"...
 

Fr. Bill
Gauge Programming - 3d Modeling Eaglesoft Development Group Intel Core 2 Quad Q6600-4 GB DDRII Crucial PC6400-500 GB SATA-ATI Radeon HD2400 Pro 256MB
IP Logged
 
Pages: 1 
Send Topic Print