Visibility nodes in ModelAttachment

I’ve noticed the following issue in SU2:

A Simobject contains Visibility nodes and Animations. Visibility nodes have conditions based on some L: SimVars. When the SImobject is used as is, stand-alone, everything works.

The same object, when used as a ModelAttachment of another Simobject, will have all Visibility conditions not working when it loads. The animations would still work though.

The odd thing, which suggests a possible bug, is if I use the Tools->Behavior option to check the calling SimObject, all Visibilities for the attached one are there, and no errors are reported, but setting the L: variables that are supposed to control them from the “Variables” tab doesn’t do anything.

But if I go to the Visibility RPN expression inspector, right-click on it to edit the code, and I just confirm the code as it is and save it, the Visibility “wakes up” and it starts to react to L: variable changes as expected.

They will continue to work even with the Behavior tool closed, for as long the object is loaded. If the object is removed from the scene and inserted again, Visibility don’t work anymore again, only to be “woken up” using the above method.

Note that, I’m not using the USER airplane at all, both objects are Ground Vehicles, with no connections with the user airplane. And, they are both compiled with the 2020 SDK.

I can’t test SU1 right now but, the exact same object works as expected in MSFS 2020.

1 Like

Ciao Umberto,
Confirm the behaviours not working for ModelAttachements already reported in this topic

Ok, the remark about being an issue with the “Once” not working is interesting but, it seems it’s not working even if it’s set to False.

I’m using a simpler code, using the ASOBO_GT_Visibility template, like this:

<Component ID="X_LEFT_Arrow_RED" Node="X_LEFT_Arrow_RED">
	<UseTemplate Name="ASOBO_GT_Visibility">
		<VISIBILITY_CODE>(L:safegate_azimuth_left,number) 0 &lt;</VISIBILITY_CODE>
	</UseTemplate>
</Component>

ASOBO_GT_Visibility calls ASOBO_GT_Visibility_Code, which is defined like this:

<Template Name = "ASOBO_GT_Visibility_Code">
	<DefaultTemplateParameters>
		<ONCE>False</ONCE>
	</DefaultTemplateParameters>
	
	<Visibility Once="#ONCE#">
		<Parameter>
			<Code>#VISIBILITY_CODE#</Code>
		</Parameter>
	</Visibility>
</Template>

So, “Once” should expand to “False”, suggesting the Visibility should be evaluated at every frame. The Template definition is identical in MSFS 2020, where it works.

Well actually my initial assumption was that the UPDATE_ONCE was the culript

However it turned out that the core of the issue are ModelAttachements (that are indeed used in the sample provided in the linked thread), just like your findings

Infact , I tried to discard the idea to use Zvar and revert to Lvar and use Simconnect to change them in order to achieve the randomness I needed.in the end, no joy, using Lvar doesn’t solve the problem because of behaviour now loading in ModelAttachements :woozy_face:

Exactly, the main issue is just Visibility don’t work anymore if the objects are used as ModelAttachements.

2 Likes

I can confirm this is a regression from SU1.

I exited the SU2 Beta, restarted the sim, no change to the objects, and Visibilities in ModelAttachements are working again.

1 Like

Let me ask you something, as we are having the same technical issue, are you able to see your objects from an external view vs interior view?

Because my issue is when im in the interior view and not the exterior view.

If you are not using ModelAttachements, I don’t think the situation is the same.

In my case, I was using ModelAttachements, and Visibility codes stopped working in SU2 if the object was attached to another one. It’s not an aircraft or something attached to the user aircraft, so the Exterior/Interior view doesn’t change anything.

It seem to be strictly related to the fact the object is attached, because the same object works if it’s inserted directly in the scene as a separate Simobject.

Gotcha.

Let’s hope to see if we can find a solution soon.

And they manage to sneak in the fix to both ModelAttachements and random in latest su2 beta :heart::heartbeat:
Thanks @EPellissier !

1 Like

WOW, it’s true, it was fixed in the latest beta! I had to exit the Beta to continue working on our new object, and was scared to get back in because the new release notes didn’t said anything about it, but I tried it now, and I confirm it’s working again! You really saved our new GSX update with this…

Thanks @EPellissier and @FlyingRaccoon and anybody else at Asobo for fixing this.

3 Likes

Indeed they fixed it. Thank you, Asobo! It works for me as well.