Can no longer set an Lvar using SimMission.Calculator

Version: 1.0.72.0

Frequency: Consistently

Severity: Blocker

Marketplace package name: Emerald Object Library & 8AK5 Fort Crosby
(Library contains the controller script, which affects SimObjects and Wwise sounds called in the airport scenery.)

Bug description:
I use a basic WorldScript in my object library that acts as a controller for a lot of dynamic features in my sceneries. This includes stuff like, making Wwise audio only play when certain simvars are met that are not supported by the Wwise XML or making SimObjects appear or disappear based on variables that I cannot read in a SimObject XML.

It’s a workaround in 2020 to get around a lot of limitations of those two systems.

The WorldScript uses a SimMission.Calculator to write a custom Lvar if certain conditions are met. For whatever reason this Lvar no longer changes. I am not exactly sure if this is a fault in the script or if this goes deeper into the actual simvars themselves. At the moment, it seems that the script just doesn’t update the Lvar to 1 and it remains 0 if I debug it using the Behaviors tool in the sim.

Here is an example of some conditions I use for an Owl SFX in the scenery. The Owl should only be audible at night near the Hangar at Fort Crosby, but because the Lvar is not being updated, it plays all the time:

<SimMission.Calculator InstanceId="{C826657A-5392-464D-B510-6834BE4862FF}" id="NightNoWX">
	<CalculatorActions>
		<CalculatorAction>
			<CalculatorFormula>(E:TIME OF DAY, Enum) 3 == (A:AMBIENT PRECIP STATE, mask) 2 == and (L:ESD_NightNoWX, bool) !=</CalculatorFormula>
			<OnActionCompleteFormula>(E:TIME OF DAY, Enum) 3 == (A:AMBIENT PRECIP STATE, mask) 2 == and (&gt;L:ESD_NightNoWX, bool)</OnActionCompleteFormula>
		</CalculatorAction>
	</CalculatorActions>
</SimMission.Calculator>

Repro steps: Spawn in the hangar at Fort Crosby and you will hear an Owl call from the trees just to the right, every so often.

For me this is working, so I think it got fixed. However without the working flight object debug, it’s hard to know what is going on inside the calculators. Hopefully the public release will fix it.

Hmm. I’m still seeing no difference here.

I’m not sure if it’s a case of the script not being able to read the simvars, or if it just can’t set the custom Lvar to 1. As mentioned in my original post, I can use the Behaviors debug tool and view that the Lvar is at least showing up with a value of 0 for the simobject in question.

Maybe something else is causing it not to work? If you simplify it, setting an lvar from a worldscript calculator should still work.

I’ve spent the last hour researching it and have determined that it is reading the simvars and setting the Lvar, the problem seems to be that it’s no longer updating if the conditions change.

Whatever conditions are met on the first load are what Lvars will trigger. For example, roof snow and snow banks controlled by snow depth are not visible if I load in during summer and then change the conditions to winter, but they will show if I load in as winter first. Then it’s the same deal if I change that back to summer conditions. All the snow objects will still be visible.

maybe the onactioncomplete part is broken? You could rewrite as:

<SimMission.Calculator InstanceId="{C826657A-5392-464D-B510-6834BE4862FF}" id="NightNoWX">
	<CalculatorActions>
		<CalculatorAction>
			<CalculatorFormula>
                (E:TIME OF DAY, Enum) 3 == 
                (A:AMBIENT PRECIP STATE, mask) 2 == 
                and d (L:ESD_NightNoWX, bool) !=
                if{ (&gt;L:ESD_NightNoWX, bool) }
           </CalculatorFormula>
		</CalculatorAction>
	</CalculatorActions>
</SimMission.Calculator>

the d duplicates the value so it can be used twice. For the comparision and for setting the Lvar

Still no luck on my end with this format. I did verify it in 2020 just to make sure the code actually works, and it does. So, it’s still just something specific with 2024 it seems.