Trying to go to a specific frame of animation, and stay at it

Hello,

As the title says, I am trying to write a piece of XML code which will let me display a specific frame of SimObject’s animation, and stay frozen at that frame (until I set it to some other frame).

I succeeded doing it in “legacy” code, here:

<PartInfo>
<Name>BOOM_EXTENDED</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(L:BOOM_EXT_FRAME_NUMBER, number)
</Code>
</Parameter>
</Animation>
</PartInfo>

This basically freezes the animation of the SimObject at a frame number specified by the LVAR.

This works, but I would like to use “current” (non-legacy) format, something that would look like this:

`<UseTemplate Name="ASOBO_GT_Anim">`

<ANIM_NAME>BOOM_EXTENDED</ANIM_NAME>
<ANIM_CODE>(L:BOOM_EXT_FRAME_NUMBER, number)</ANIM_CODE>
<ANIM_LENGTH>100</ANIM_LENGTH>
</UseTemplate>

This code does not work, and frankly, I am not sure how to get it working. Any help would be greatly appreciated.

You’d be looking for “ASOBO_GT_Anim_Code”

1 Like

Thanks for suggesting that! That looked like an obvious omission, but I tried it, and it does not work (animation is not moved to the desired frame).

	<Include ModelBehaviorFile="Asobo\Generic\Animations.xml"/>
	<Template Name="My_Custom_Single_Frame_Animation">
	<UseTemplate Name="ASOBO_GT_Anim_Code">
		<ANIM_NAME>BOOM_EXTENDED</ANIM_NAME>
		<ANIM_CODE>(L:BOOM_EXT_FRAME_NUMBER, number)</ANIM_CODE>
		<ANIM_LENGTH>100</ANIM_LENGTH>
	</UseTemplate>
	</Template>

Legacy code, as posted originally, works fine.

I’d say it’s likely because you’re wrapping the UseTemplate within another template instead of a component.

In 2020 style XML you’d need something like:

<Include ModelBehaviorFile="Asobo\Common.xml"/>

<Component ID="My_Custom_Single_Frame_Animation">
    <UseTemplate Name="ASOBO_GT_Anim_Code">
        <ANIM_NAME>BOOM_EXTENDED</ANIM_NAME>
        <ANIM_CODE>(L:BOOM_EXT_FRAME_NUMBER, number)</ANIM_CODE>
        <ANIM_LENGTH>100</ANIM_LENGTH>
    </UseTemplate>
</Component>