#SYNC_AVIONICS_TO_BATTERY_STATE# is generating an error

Version: 1.0.77.0

Frequency: Consistently*

Severity: High

Marketplace package name: AeroSachs Tecnam P92 Echo

Context: MSFS2020 package in the community folder

**Similar MSFS 2020 issue: Nothing, it is working properly

**Bug description: The following script:

<UseTemplate Name="ASOBO_ELECTRICAL_Switch_Battery_Master_Template">
 <NODE_ID>ELECTRICAL_Switch_Battery_Master</NODE_ID>
 <ANIM_NAME>Battery_Master_Switch</ANIM_NAME>
	<!-- This battery switch also controls avionics -->
	<ON_TOGGLE_MASTER_BATTERY>
		#SYNC_AVIONICS_TO_BATTERY_STATE#
		(A:ELECTRICAL MASTER BATTERY:1, Bool) if{
			1 (&gt;K:ALTERNATOR_ON) }
		} els{
			1 (&gt;K:ALTERNATOR_OFF) }
		}
	</ON_TOGGLE_MASTER_BATTERY>
</UseTemplate>
<UseTemplate Name="ASOBO_GT_Update">
	<FREQUENCY>5</FREQUENCY>
	<UPDATE_CODE>
		#SYNC_AVIONICS_TO_BATTERY_STATE#
	</UPDATE_CODE>
</UseTemplate>"

is generating the following error in the console:
Invalid script (no command is more than 4 characters): "SYNC_AVIONICS_TO_BATTERY_STATE

Hello @erasam

MSFS 2020 1.38.2.0 produces the same error for me:

You are using a parameter that isn’t defined anywhere.
It’s not part of the base ASOBO_ELECTRICAL_Switch_Battery_Master_Template.

I assume this is inspired from the Asobo C152 implementation?
The difference is the C152 defines a default value for this parameter:

<DefaultTemplateParameters>
	<SYNC_AVIONICS_TO_BATTERY_STATE>
		(A:ELECTRICAL MASTER BATTERY:1, Bool) (&gt;O:_AvionicsShouldBeOn) 
		1 (&gt;A:BUS LOOKUP INDEX, Number)
		(O:_AvionicsShouldBeOn) (A:BUS CONNECTION ON:2, Bool) != if{
			2 1 (&gt;K:2:ELECTRICAL_BUS_TO_BUS_CONNECTION_TOGGLE)
		}
		(O:_AvionicsShouldBeOn) (A:CIRCUIT SWITCH ON:17, Bool) != if{
			17 (&gt;K:ELECTRICAL_CIRCUIT_TOGGLE)
		}
	</SYNC_AVIONICS_TO_BATTERY_STATE>
</DefaultTemplateParameters>

Regards,
Sylvain

Hi Sylvain

thanks for chasing it

I’ll correct it for the next update

2 Likes