Behaviors Not Triggering Animation

Version: 1.4.20.0 (Also checked in SU3 Beta)

Frequency: Consistently

Severity: High

Marketplace package name: 67FL Bald Eagle Airfield- Myakka Head

Bug description:
I have a hangar door animation that is triggered using Behavior code. The animation works in 2020. The door is either fully opened or fully closed depending on several factors:

<Behaviors>
		<Include ModelBehaviorFile="Asobo\Generic\Animations.xml"/>
		<Component ID="Open">
			<UseTemplate Name="ASOBO_GT_Anim">
				<ANIM_NAME>Opening</ANIM_NAME>
				<!-- Hangar open Dawn-Dusk on Sunday, Tuesday, Wednesday, & Saturday, while not raining.-->
				<ANIM_CODE>(E:LOCAL DAY OF WEEK, Number) 1 == (E:LOCAL DAY OF WEEK, Number) 2 == || (E:LOCAL DAY OF WEEK, Number) 5 == || (E:LOCAL DAY OF WEEK, Number) 6 == || (E:TIME OF DAY, Enum) 3 &lt; && (A:AMBIENT PRECIP STATE, Mask) 2 == && if{ 100 } els{ 0 }</ANIM_CODE>
				<ANIM_WRAP>1</ANIM_WRAP>
				<ANIM_LENGTH>100</ANIM_LENGTH>
			</UseTemplate>
		</Component>
	</Behaviors>

To ensure that it wasn’t an issue with a Simvar, I have temporarily rewritten the code to only allow the door to open if it’s raining. Code that I know works, because I have other SimObjects using it currently without issue in 2024:

<Behaviors>
		<Include ModelBehaviorFile="Asobo\Generic\Animations.xml"/>
		<Component ID="Open">
			<UseTemplate Name="ASOBO_GT_Anim">
				<ANIM_NAME>Opening</ANIM_NAME>
				<ANIM_CODE>(A:AMBIENT PRECIP STATE, mask) 4 == if{ 100 } els{ 0 }</ANIM_CODE>
				<ANIM_WRAP>1</ANIM_WRAP>
				<ANIM_LENGTH>100</ANIM_LENGTH>
			</UseTemplate>
		</Component>
	</Behaviors>

Even with this simple code, I still cannot get the hangar door to open or close. When I use the Behaviors tool in the dev toolbar, I can see the current value in the Animations tab. Using Simvar Watcher I can see the precip state change with the slider, however on the Animations tab the value always remains 0/100. I can force this value to 100 and the hangar door does open.

Is there something that needs to be done differently for 2024? Am I missing something, or is this just a sim bug?

I did notice a template structure error in the Logs tab of the Behaviors tool. I’m not sure if that is part of the issue or not…

Hello,

Can you send us the complet simobject ?
See 3) Provide Private Content

Regards,
Boris

1 Like

SimObjects sent.

Hello @Rotornut44

After investigation, it appears that the issue is caused by the <ANIM_WRAP>1</ANIM_WRAP> tag.

This tag is only useful when the start and end of the animation are identical (i.e., frame 0 and frame 100 share the same position).

In your case, this condition is not met, which is why the animation is being blocked.

The fact that it works in KH is likely a bug.

Regarding the behavior error, it is unrelated to your issue and has no impact.

You will need to remove the <ANIM_WRAP>1</ANIM_WRAP> tag from your XML files.
I did this with your sample, and the animation started working as expected.

Let me know if it works on your side as well.

Regards,
Boris

1 Like

Hi Boris,
I swear I have commented that line out before while debugging as well, but it must have been while the other simvar bugs were still happening a while back. I must have just reverted it. Thanks for spotting that! All is working as intended. I’ll go back and remove the line in 2020 as well since it’s useless in this case.

Thanks!

1 Like