FSXA [Solved]Gauge to ModelDef, any XML changes required?

#21
Here you go, then, purely playful stuff for concept testing. Note, have reduced anim length to 50, kept some of your vars, made some assignments and logic, introduced a new var that holds the animation, which is trivial. Forgive me for being sparing with the indentations. The explanation for the final "reminder" line can be found in this thread https://www.fsdeveloper.com/forum/threads/why-wont-this-rotate.444116/post-810600
Code:
<Animation name="Pelicandrome_Guidage_anim1" guid="994959c3-90d4-4f94-b229-8ef5ba9d5c91" length="50" type="Sim" typeParam2="Pelicandrome_Guidage_anim1" typeParam="AutoPlay" />
<PartInfo>
<Name>Pelicandrome_Guidage_anim1</Name>
<AnimLength>50</AnimLength>
<Animation><Parameter>
<Code>
  (L:Peli_Timer, number) 0 &gt;= if{ (L:Peli_CurrentStatus, number) ++ (>L:Peli_CurrentStatus, number) }
  (L:Peli_CurrentStatus, number)      300 &gt; if{ 50 (>L:animcheck,enum) }
  els{ (L:Peli_CurrentStatus, number) 200 &gt; if{ 25 (>L:animcheck,enum) }
  els{ (L:Peli_CurrentStatus, number) 100 &gt; if{ 10 (>L:animcheck,enum) } } }
  (L:animcheck,enum) d
</Code>
</Parameter></Animation></PartInfo>
 
Last edited:

Kekelekou

Resource contributor
#23
Hello,

It finally occurred to me yesterday evening that I want to add this specific animation not to the user’s airplane, but to a ground vehicle added by FireFighterX.
So I assigned mjahn’s test code to my MDL and used the MDL as the external model of the current airplane. The animation ran as expected.
But when I used the very same MDL for the ground vehicle, the animation didn’t run. I’ll double-check that tonight (I’m pretty mistake-prone as this thread suggests).
This might be the key of all this!
 

Kekelekou

Resource contributor
#25
So now I am positive : the test code kindly posted by mjahn runs when the MDL is the current airplane's model, but not if used for a ground vehicle.
That was it all along... Happy to have found out why.

I guess I have to go the "gauge" route then. Not optimal, but it works! @tgibson : Lvars can be used for defining the anim keyframes (this very anim does work indeed with "100 (L: peli_CurrentStatus, number) * (L: peli_Timer, number) +"), but it seems that "complex" calculations will fail.

Anyway, thanks to all of you for your kind help and instructive feedback!
 
Top