Sign in to follow this  
n4gix

Linked animations

Recommended Posts

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
Help AVSIM continue to serve you!
Please donate today!

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.

Share this post


Link to post
Share on other sites

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.

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