- Messages
- 180
- Country

Is it possible to create a custom animation tag for a MDL model that I'm designing in GMax?
Thanks,
Manuel
Thanks,
Manuel
Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.
By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.


<Animation name="[Your animation name]" guid="[GUID]" length="[Length of the animation]" type="Sim" typeParam2="[Your animation name]" typeParam="AutoPlay" />
<PartInfo>
<Name>[Your animation name]</Name>
<AnimLength>[Length of the animation]</AnimLength>
<Animation>
<Parameter>
<Code>[Your animation code]</Code>
<Lag>[Lag parameter]</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>[Tooltip Text]</TooltipText>
<MouseFlags>LeftSingle</MouseFlags>
<CallbackCode>
[Code To Be Executed Upon Mouse Click]
</CallbackCode>
</MouseRect>
</PartInfo>
<PartInfo>
<Name>[Your visibility name]</Name>
<Visibility>
<Parameter>
<Code>
[Your visibility code]
</Code>
</Parameter>
</Visibility>
</PartInfo>

<part>
<Name>lever_propliner_blower1</Name>
<Animation>
<Parameter>
<Code> (L:supercharger control 1,bool) 100 * </Code>
<Lag>100</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<Tooltip_Text>Supercharger 1 %((L:supercharger control 1,bool))%{case}%{:1}HIGH%{:0}LOW%{End}</Tooltip_Text>
<mouse_flags>LeftSingle+LeftDrag</mouse_flags>
<Callback_Code>
(L:supercharger control 1,bool) ! (>L:supercharger control 1,bool) }
</Callback_Code>
</MouseRect>
</part>

[Your animation code] - The code that drives your animation. Make sure that the processing results of the code are within the keyframe range.
<Lag>...</Lag> - Remove this line if you're not dealing with switches. This will add some visual lag to switches that will otherwise immediately jump from "off" to "on" after clicking.
[Lag parameter] - Forumla used for determining a value for the lag parameter: [animation duration in seconds]=[number of keyframes for animation]/[lag value], e.g. 0.125 sec = 50 keyframes/400
<MouseRect>...</MouseRect> - Remove this section if you're not dealing with a switch or knob or lever. Mouserect code has to be attached
[Tooltip Text] - A custom tooltip text for your switch, knob or lever.
[Code To Be Executed Upon Mouse Click] - What happens when you click the button, knob or lever.
Notes:
[Your visibility name] - Same rules as for the animation name.
[Your visibility code] - The code that determines the visibility of your part. Keep in mind that the result of any evaluation for visibility is either 1 (= visible) or 0 (=invisible).



So here basicly I just write a code that will always return a number within my keyframe range right?
How can I write a code that would play my animation in a loop? without using any AIRCRAFT variable?, that would play my animation from keyframe 0 to let's say keyframe 50 which is my keyframe's length. How could I make it play a single time, and then how can I make it play in a loop?![]()
(L:Animation variable, number) ++ 51 % (>L:Animation variable, number)
So I can omit these if I'm writting a tag for a external model (not virtual cockpit) am I right?
If my part is a skinned mesh driven by a bone, then does this visibility attribute could make my mesh invisible/visible?

Drive an animation with a L: type custom variable and then use a controller type polygon (polygon or triangle with a visibility tag) with code like this:
Code:(L:Animation variable, number) ++ 51 % (>L:Animation variable, number)

