Jump to content
Sign in to follow this  
n4gix

Linked animations

Recommended Posts

Guest grimmy69

Hi!I am trying to toggle an animation on and off with a switch. Can anyone point me in the right direction or a gauge that I can study?Best,Roger

Share this post


Link to post
Share on other sites

Assuming that you're refering to a GMax animation, then here is some sample code for the MakeMDL.parts.xml file to control a "reclining seat:" cabin_seat_lr (L:CabinSeatLR,bool) 100 * 40HandSeat Recline (L:CabinSeatLR,bool) ! (>L:CabinSeatLR,bool) The seat may be "reclined" my clicking anywhere on the part named "cabin_seat_lr_xx" in the virtual cabin. If you want to control the part only via a gauge, then leave out the section above, and simply code a gauge to toggle the L:CabinSeatLR variable.


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 grimmy69

Hi Bill and thanks for replying!Actually, I was trying to find a solution for my problem withs creating a switch for the oxygen system, which I have another thread for in this forum. I still haven't found a solution for it.From what I understand, it is a scripted animation that toggles between two images show the oxygen flow in an indikator. I would like to be able to start and stop that animation with a two-way switch, but as I am new to XML and MSFS, I am having a hard time figuring this out.The code for the oxygen blinker is as follows:"(P:Absolute time, seconds) 4 % 2> if{ 1 (> L:OXFLOW, bool) } els{ 0 (>L:OXFLOW, bool) } (L:OXFLOW, bool)"Thanks,Roger

Share this post


Link to post
Share on other sites

Well, it's important to keep in mind that the process in a model is different than with a gauge. In your gauge you have two static images that create the illusion of a switch or knob being moved.In the model though, you have a "physical part" that is either "flipped" or "rotated" based on some control variable.In your case, the L:OXFLOW, bool variable would be your "control variable" for the 3d modeled part, so simply replace the L: var in my example code and your animation should work, and be controlled by the 2d gauge. If you also modify the code to toggle the L:OXFLOW, bool variable, then you'll have mouse control of the switch in the VC as well.


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...