Sign in to follow this  
Au MaV

Please help xml hyd failure..

Recommended Posts

HiIm trying to toggle a hydr. failure when the landing gear is fully up Im wanting to have the hydr system fail,when the gear is first raizedand not work again till aircraft is reloaded.Thanks Warwick

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

if the a_varHYDRAULIC SYSTEM INTEGRITYis alive and well in planes defined to have hydraulically operated gear retraction / extension this is how it should work, described in words:first check the state of the gear, in this example I am using the nose gear position:If GEAR POS NOSE is 0 (nose gear is up) check state ofHYDRAULIC SYSTEM INTEGRITYIf HYDRAULIC SYSTEM INTEGRITY is not 0 trigger (or send) key event KEY_TOGGLE_HYDRAULIC_FAILUREThis last bit is to ensure the key event KEY_TOGGLE_HYDRAULIC_FAILUREis not constantly sent as soon as nose gear is up. It also ensures that if for any reason the HYDRAULIC SYSTEM INTEGRITY should become unequal 0 it will immediately be returned to 0 via the key event.I hope you are up to translating this into working XML or C++ code. I for my part am a C++er :)

Share this post


Link to post
Share on other sites

Hi Im building a ME163 with the jettson dolly,Ive got it all working exceptthe hydr failure(Im curently using a click spot to fail the hyd)The following is one of many different xml gauges I tried but they all do the same thing keep toggling the hyd failure :( Ive tried a gauge which togles cabin lights on and off and it to duznt work so I know its my choise of A: vars cheersWozza(A:GEAR HANDLE POSITION,number) 0 ==! if{ (A:GEAR RIGHT POSITION,percent) 100 = if{ (>K:TOGGLE_HYDRAULIC_FAILURE) } } els{ (A:GEAR RIGHT POSITION,percent) 0 = if{ (>K:TOGGLE_HYDRAULIC_FAILURE) } }

Share this post


Link to post
Share on other sites

I think you need to set an L:Var to remind the gauge whether it needs to toggle hydraulic failure or not. Your initial test against Gear Handle Position should also test the L:Var against zero. When you toggle Hydraulic Failure, you should then also toggle the L:Var, thus preventing the initial If statement from succeeding again.Doug

Share this post


Link to post
Share on other sites

Hiand thanks for the reply,I tried this and a hundred other ver still no luck,why oh why dose one var work and another not cheersWozza(A:GEAR HANDLE POSITION,number) if{ (A:GEAR HANDLE POSITION,number) 1 = if{ (>L:GEAR_DUMP,number) 1 } } els{ (A:GEAR HANDLE POSITION,number) 0 = if{ (>L:GEAR_DUMP,number) 0 } } (A:GEAR HANDLE POSITION,number) if{ (L:GEAR_DUMP,number) 0 == if{ (A:GEAR HANDLE POSITION,number) 0 (>K:TOGGLE_HYDRAULIC_FAILURE) } } els{ (L:GEAR_DUMP,number) 1 == if{ (A:GEAR HANDLE POSITION,number) 0 (>K:TOGGLE_HYDRAULIC_FAILURE) } }

Share this post


Link to post
Share on other sites

>Hi>and thanks for the reply,I tried this and a hundred other ver>still no luck,why oh why dose one var work and another not >cheers>Wozza>(A:GEAR HANDLE POSITION,number)> if{ (A:GEAR HANDLE POSITION,number) 1 = if{>(>L:GEAR_DUMP,number) 1 } }> els{ (A:GEAR HANDLE POSITION,number) 0 = if{>(>L:GEAR_DUMP,number) 0 } } > That will never work, simply because of the "unit" you've used. The variable GEAR HANDLE POSITION is reported as "16K = dn, 0 = up".That is, without conversion the range is between 16,384 to 0...Hence, the variable *will never equal 1*...With XML you do have the capability of "auto-unit-conversion" so you could make the units "percent" and change the test from 1 = to 100 =Even so, I've found with such variables it's best to use "ranges of values" for the test, rather than fixed values. Even better, use "not 1," e.g., 1 ! if{

Share this post


Link to post
Share on other sites

Hi,If I ain't wrong, you need to "generate" an hyd failure as soon as the gear is full up, right?Well, maybe (A:GEAR TOTAL PCT EXTENDED,percent) is best suited than HANDLE POSITION, as it shoud return 0 (or near, honestly I didn't tested) when the WHOLE LG is full stowed; notice you may have the handle in up position and the gear be still in transit.Then, as Mathias said, you need to test (A:HYDRAULIC SYSTEM INTEGRITY,percent) to avoid toggling the failure continuosly, as it seems it's happening.One approach (not tested) could be: (A:GEAR TOTAL PCT EXTENDED,percent) 0.1 < (L:Gear Failure On, bool) ! (A:HYDRAULIC SYSTEM INTEGRITY,percent) 100 == && && if{ (>K:TOGGLE_HYDRAULIC_FAILURE) 1 (>L:Gear Failure On, bool) }Regards,Tom

Share this post


Link to post
Share on other sites

Hi and thanks for the replys Im learning :)Still no luck,We are getting closer,what I have s far(below) toggles the hyd fail back and forth when gear rased then if I toggle gear again it kills the hyd system and it stays dead. Anyway here is what I have so far and Im completely lost :)thanks Wozza(A:GEAR TOTAL PCT EXTENDED,percent) 0.1 < if{ (A:GEAR TOTAL PCT EXTENDED,percent) 0.1 < if{(>L:GEAR_DUMP,number) 1 } } els{ (A:GEAR TOTAL PCT EXTENDED,percent) 1 > if{(>L:GEAR_DUMP,number) 0 } } (A:GEAR TOTAL PCT EXTENDED,bool) if{ (L:GEAR_DUMP,number) 0 if{ (A:GEAR TOTAL PCT EXTENDED,percent) 0.1 < (>K:TOGGLE_HYDRAULIC_FAILURE) } } els{ (L:GEAR_DUMP,number) 1 if{ A:GEAR TOTAL PCT EXTENDED,percent) 1 > (>K:TOGGLE_HYDRAULIC_FAILURE) } } here a pic of the project just to keep ya interested :D http://members.optusnet.com.au/~au_mav/ggty.jpg

Share this post


Link to post
Share on other sites

Wozza,Just did some test and found that HYD SYSTEM FAILURE event, though commands a failure when toggled (lows Avar *Hyd Syst Integrity* to 0), seems to be ignored by FS2004; then you can put gear up/down, move flight controls, etc as normal, without trouble. Searching a bit I found that FS2004 doesn't include "hydraulics" in its "System Failures" table, accesed through "aircraft failures" menu. It only shows Vacuum, Pitot Static and Electrical.When you state "..then if I toggle gear again it kills the hyd system and it stays dead.."do you mean you cannot operate the gear again? or how do you know the hyd system is out, test the variable's value?TomBTW, your code needs more debuggin :-)

Share this post


Link to post
Share on other sites

I think it would be far easier to simply immediately retract the gear again once the gear was intentionally retracted and then the virtual pilot tried to extend it again.And if I am not completely mistaken when that plane takes off it automatically leaves its wheels on the ground, so you would have to add even a little more automation:When AIRCRAFT_ON_GROUND is smaller than 1 (i.e. 0)andgear is extended retract gear.That way there would be no need to toggle anything manually, apart from if the original plane could control the release of the wheels manually.This system described above works well on my project when I fail the flaps due to "damage" by the main door opening while flaps are extended. Whenever the pilot tries to put the flaps in a different position than they were in when they failed my gauge immediately returns the flaps to that position. This way the pilot loses active control of the flaps.

Share this post


Link to post
Share on other sites

For your project I'd use (A:sim on ground,bool) as a test to automatically "raise" the gear. Once the "gear" is "up" (dolly dropped), then I'd constantly test the gear handle for staying in the up position. Then if the gear handle is not "up," I'd automatically move it/trigger it/toggle it back up. I'd also set the gauge frequency rather high to avoid as much "dolly magically returning animation" as possible.

Share this post


Link to post
Share on other sites

Hi Ok I think Id better explain what Im exactly trying to do.First up the modelThe wheel dolly is taged r_gear and animated so itsup possy is down and far out behind the aircraft,with a preprocess to only be visable between key frames 95 200 the 100 and 200 keyframes follow the skid.The skid which is taged l_gear is animated normallyso normally when toggleing the gear up down the dolly flys of but when droping the gear to fully down it pops back on The hidden xml gaugesI want to disable the gear hyd system when up,so I can use the gear_pump (wont work until the gear system is dead and the gear handle in the down possy)to drop the gear down via the tailhook.As Im using the tailhook animation the gear will only come down to keyframe 90ish so as I got the r_gear(wheel dolly) hidden between 95 and 0 it wont show.The Gear which is not fully down will cause the center gear/skid to contact the deck and make the aircraft behave like it should on landing Ie drop a wing and slide on a skid contact piot which is slightly higher than the L/R wheel contact point The link gauge (A:GEAR RIGHT POSITION,position) 0 == !if{ (A:TAILHOOK POSITION,position) 0 == if{ (>K:TOGGLE_TAIL_HOOK_HANDLE) } } els{ (A:TAILHOOK POSITION,position) 1 == if{ (>K:TOGGLE_TAIL_HOOK_HANDLE) } } The gearpump gauge(A:TAILHOOK POSITION,bool) ! if{ (A:TAILHOOK POSITION, Percent) 10 > if{(>K:GEAR_PUMP) } }els{ (A:TAILHOOK POSITION, Percent) 100 < if{(>K:GEAR_PUMP) } } Now all this works fine if I fail the hyd system via a mouse click gauge.Thats why I need to find some way of tieing in the gear possy or somthing to the hyd system(or maybe use another gear related system the flaps still have to work with engine/system dead).This is only in case somebody hits the G key repedely.The ME 163 only has about 6min run time and when engine dead the hyd system will fail,But fs9 keeps a small reserve which takes ages to bleed off.So in that situation you could end up with the gear fully down and doly back in placethanksWozza

Share this post


Link to post
Share on other sites

>do you mean you cannot operate the gear again? or how do you>know the hyd system is out, test the variable's value?>>>Tom>>BTW, your code needs more debuggin :-)>>>Hi Tom Yes to the first question so after take off gear key pressed gear comes up a few seconds later the hyd gauge pulses (meaning it toggling on and off)hit the g key again gear comes down and hyd pressure falls to 0 now no matter how many times I hit the g key hyd pressure stays 0like I said we are close :) Im using a hyd pressure gauge to test pressureNa the codes fine its me that needs debugging :DthanksWozza

Share this post


Link to post
Share on other sites

May I ask why you define l_gear to be a skid when you can define any fixed contact point as being 3 = Skid? Is the skid on the Me163 also retractable?

Share this post


Link to post
Share on other sites

Hi Yep the skid and tail wheel are retractable,also the l_gear is an animation tag and has no effect in fs9 persay,as these are defined in the aircraft.cfgcheersWozza

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this