Jump to content
Sign in to follow this  
n4gix

Animated door handle XML wanted

Recommended Posts

Guest lionheart777

Hey guys,This might not be possible but thought I would ask.I need a door handle that animates as well as opens the passengers doors.I realise this is a 'dual fold' command, so I dont think it can be done.The XML I have that 'opens' the doors but wont animate is this;pilot_side_latch_knobHandPilot's DoorTOGGLE_AIRCRAFT_EXIT Many thanks in advance for your advice.BillLHC

Share this post


Link to post
Share on other sites

It sounds a lot like my canopy latch animation on my Thorp T-18...In the VC I click the latch handle, which begins the animation sequence. First the latch unhooks from the canopy frame, then the canopy slides back. You might look through the FreeFight Design forums, that's where I figured out mine.Robert

Share this post


Link to post
Share on other sites

>The XML I have that 'opens' the doors but wont animate is>this;>> > pilot_side_latch_knob > > Hand > Pilot's Door > TOGGLE_AIRCRAFT_EXIT > > > Gee Bill, why don't you look in the "XML Parts" forum at FFDS? There are working examples posted there ya know! ;)pilot_side_latch_knobEXIT OPEN:0Percent200HandToggle EXIT #1(>K:TOGGLE_AIRCRAFT_EXIT,bool) (>K:SELECT_1,bool)


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest JeanLuc_

Hi Bill,just curious about the code: what does the "lag" parameter is about?

Share this post


Link to post
Share on other sites

>Hi Bill,>>just curious about the code: what does the "lag" parameter is>about?>The "lag" parameter affects the speed of response to the animation code. Higher numbers equal faster response.In the code above, we are using a stock "sim variable" so we use the tags and to bracket our variable. This will automatically expand the variable output to a range of 0 to 100 for us.In the case of a custom L:var,bool type, we must take the boolean value and multiply it by 100, thus generating a range of 0 to 100 'keyframes'. The sim takes that range and applies the "lag" paramater as a scalar value to determine the total time that needs to be applied to the part's animation track.Alternatively, we could also create a custom L:var,number type and use our own logic to derive the driving animation output. I did this in the Cirrus SR20/22 series aircraft for the parachute sequence. In this case, a C gauge provides all the logic and "talks" directly to the model's embedded XML code. In such cases we would not use the "lag" parameter at all, since we have direct control over the animation programmatically.I've never taken the time to determine the precise mathematical relationship between the keyframe animation and the "lag" scalar, as I'm truly only interested in the end results, which I have thus far achieved experientially... good old "trial and error!" :)


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest JeanLuc_

Thank you for the insights! As a matter of fact, can I understand that as long as you feed an L: variable with a value from a gauge, and that you tell the model xml file that the animation is keyed to this L: variable, you can then define any number of frames for the animation, provided you update the L: variable from 0 to the number of frame (could be a variable going from 0 to 30 for which the animation will be told to be 30 frames (both in the XML file and in the modeling tool), as well as a variable going from 0 to 2567 for which the animation will be told to be 2567 frames (both in the XML and the modeling tool as well)?In this respect, you can animate anything over any time length as long as you do the correct L: var update yourself over the expected period of time it takes to go from frame 0 to frame max I guess?

Share this post


Link to post
Share on other sites
Guest lionheart777

Hello Bill,I actually did use your example from FreeFlightDesign.com but on my computer, the only animation produces the doors opening but with no door latch animation, unfortunately.Your post above reminds me of a lecture by Einstein on quantum physics. How these things come so easily to you is amazing. For me, when I look at these XML 'equasions', they are like egyptian heiroglyphs. Perhaps if I had a list of what each line meant and could study over that for a week, it would become apparent how they function.Bill

Share this post


Link to post
Share on other sites

Try this...Use the tag for the exit with the numerical extension (01, 02, etc) as the name for the knob. Link the knob to the door. Then break up the keyframe sequences something like this...0-25: Knob opens25-75: Door opens75_100: Knob returns to original positionThis is basically how I did my canopy latch, except the latch is attached to the rollbar & not linked to the canopy.Good Luck!Robert

Share this post


Link to post
Share on other sites
Guest lionheart777

Hey Robert,Many thanks.I'll give that a try.Bill

Share this post


Link to post
Share on other sites

>Thank you for the insights! As a matter of fact, can I>understand that as long as you feed an L: variable with a>value from a gauge, and that you tell the model xml file that>the animation is keyed to this L: variable, you can then>define any number of frames for the animation, provided you>update the L: variable from 0 to the number of frame (could be>a variable going from 0 to 30 for which the animation will be>told to be 30 frames (both in the XML file and in the modeling>tool), as well as a variable going from 0 to 2567 for which>the animation will be told to be 2567 frames (both in the XML>and the modeling tool as well)?>>In this respect, you can animate anything over any time length>as long as you do the correct L: var update yourself over the>expected period of time it takes to go from frame 0 to frame>max I guess?You are welcome! Yes, that is indeed correct, Jean-Luc. There is currently a limit of 1024 frames exported, which for a "looped" animation means there is a practical limit of approximately 57 seconds.Using a custom L:var,number type to control the animation though, there is no time limit, since you can programmatically "drive" the animation at any speed you wish.


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

>Hello Bill,>>I actually did use your example from FreeFlightDesign.com but>on my computer, the only animation produces the doors opening>but with no door latch animation, unfortunately.Bill, there are two "parts" to the example given above. The part seems to work for you... ;)The code between the tag pair is what "drives" the animation of the part. As Robert suggested, you need to key_frame animate the part itself though, as well as use the name specified in the section:pilot_side_latch_knobEXIT OPEN:0Percent200The above would be for the "main exit". For other doors, use the following:EXIT OPEN:0 = main doorEXIT OPEN:1 = second doorEXIT OPEN:2 = third doorEXIT OPEN:3 = fourth doorRemember, each door must also be listed in the aircraft.cfg section! ;)


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest JeanLuc_

Hi Bill,so for loop, I understand FS jumps to the next frame of the animation at 18Hz (hence 1024/18 ~= 57). Is this supposed to be time based in FSX instead of tick18?As for other animations, there is no "18Hz" constraint isn't it? you just set the L: Var as fast as you can and the model will jump to the frame you would index directly with the L: Var (well, you can do math but to stick to simple examples, var from 0 to 1010 for frames from 0 to 1010). Now, if you want to transition from 0 to 1010 at the FPS the model is displayed (i.e. actual FS FPS), you would need to update the L: Var at the same speed (impossible from a gauge limited to 18Hz update cycle, so you can use min/max values only, like with a BOOL example, and use LAG parameter to let FS interpolate itself overtime isn't it?

Share this post


Link to post
Share on other sites

>Hi Bill,>>so for loop, I understand FS jumps to the next frame of the>animation at 18Hz (hence 1024/18 ~= 57). Is this supposed to>be time based in FSX instead of tick18?Jean-Luc, this thread is getting a bit long and off-topic from the OP's question, so I've replied to this in a new thread: "XML Animations in Models & Gauge Control (redux)" ;)http://forums.avsim.net/dcboard.php?az=sho..._id=30312&page=


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest dupa

I use f_canopy and r_canopy when there are two exits, but what must the names of the animating exit parts be when I want more than two?

Share this post


Link to post
Share on other sites

>I use f_canopy and r_canopy when there are two exits, but>what must the names of the animating exit parts be when I want>more than two?I alreadly answered this question (partly) in an earlier post in this very thread. However, here it is again, this time complete with both token and key_event information:For all four doors, use the following tokens and key_events:......TOKENS................................KEY EVENTS..........................= main door......EXIT OPEN:0......(>K:TOGGLE_AIRCRAFT_EXIT,bool) (>K:SELECT_1,bool)= second door...EXIT OPEN:1 ......(>K:TOGGLE_AIRCRAFT_EXIT,bool) (>K:SELECT_2,bool)= third door.....EXIT OPEN:2 ......(>K:TOGGLE_AIRCRAFT_EXIT,bool) (>K:SELECT_3,bool)= fourth door...EXIT OPEN:3 ......(>K:TOGGLE_AIRCRAFT_EXIT,bool) (>K:SELECT_4,bool)NOTE: because of different numbering conventions used in the code, the index numbering for the TOKENS and the KEY EVENTS are different!Thus, door #1 is called "0" for the TOKEN, but "1" for the KEY EVENT!!![/iFor further XML Tips, see: http://www.aerodynamika.com/cgi-bin/yabb/Y...;num=1147535113


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...