fs2020_variable_write Question nav sound:1

Help creating logic scripts for Air Manager Instruments

Moderators: russ, Ralph

Post Reply
Message
Author
jet46
Posts: 20
Joined: Fri May 21, 2021 12:24 am

fs2020_variable_write Question nav sound:1

#1 Post by jet46 »

Hello, I am trying to write:
fs2020_variable_write("NAV SOUND:1", "bool", false)

but there doesn't seem to be any effect (with true or false). I was able to use spad.next and manually set NAV SOUND:1 and it had the desired effect in the sim so I know it's working. I can read that variable from air manager, just not set it. Any ideas?

What I am trying to do is program a button to listen to the VOR ident.

jet46
Posts: 20
Joined: Fri May 21, 2021 12:24 am

Re: fs2020_variable_write Question nav sound:1

#2 Post by jet46 »

I did discover that I can use the event RADIO_VOR1_IDENT_TOGGLE instead.

However, I am curious is there a reason I cannot directly set the simconnect variable directly from within AM?

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: fs2020_variable_write Question nav sound:1

#3 Post by Sling »

jet46 wrote: Mon Jul 11, 2022 12:43 am However, I am curious is there a reason I cannot directly set the simconnect variable directly from within AM?
Because the MSFS SDK has that variable documented as non writeable.

User avatar
Crunchmeister
Posts: 222
Joined: Tue Aug 10, 2021 2:06 pm

Re: fs2020_variable_write Question nav sound:1

#4 Post by Crunchmeister »

When it comes to defaults, a large number of variables are read only and you need to use events to fire them. There are some exceptions, but the first assumption should always bee that you use and event to change a value, and a variable to read its value. The exception is custom lvars used in 3rd party planes which can both be read and written to.

You can get a list of all default vars and events in the SDK documentation: https://docs.flightsimulator.com/html/I ... uction.htm
- Ryzen 5950x, 64GB 3600MHz RAM, RTX3070Ti

Simstrumentation Instrument dev
Free Air Manager instruments for MSFS available at http://www.simstrumentation.com

Post Reply