February 2, 200521 yr 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
February 2, 200521 yr Author Moderator 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
February 3, 200521 yr 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
February 3, 200521 yr Author Moderator 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
Create an account or sign in to comment