Raysot Posted September 14, 2023 Report Posted September 14, 2023 Greetings all, I'm hoping someone has some insight into why certain A:Vars can't be read by LUA using the FSUIPC LUA engine. Specifically, I'm trying to read the following A:Vars: CIRCUIT SWITCH ON:73 CIRCUIT ON :125 I'm using the call: RudderBoost = ipc.readLvar("CIRCUIT SWITCH ON:73") Using the SimVar Watcher tool that comes with the 2020 SDK, I can get values from that A:Var I've tried several variations, like ipc.readLVar("A:CIRCUIT SWITCH ON:73") and ipc.readLVar("A:CIRCUIT SWITCH ON,73") ...and a few other variants, all returning NIL. It's a stupid-simple script so I won't take up text real estate with the other stuff. I have had success in reading most other L:Vars and offsets, but not A:Vars Hope somebody can help!
John Dowson Posted September 15, 2023 Report Posted September 15, 2023 Which version of FSUIPC and what FS are you using? If its FSUIPC7 / MSFS, please use the specific sub-forum for this product. No A-type variables (also known as simvars) can be read via lua. The only A-type variables can be read are those that are held in FSUIPC offsets. 7 hours ago, Raysot said: I've tried several variations, like ipc.readLVar("A:CIRCUIT SWITCH ON:73") and ipc.readLVar("A:CIRCUIT SWITCH ON,73") ...and a few other variants, all returning NIL. Of course, as these facilities are for L-type variables, or lvars, only. You cannot use them for any other variable type. So, A-type variables (simvars) can only be accessed (read/write) via FSUIPC offsets. Facilities are provided to add any simvar to a free/spare FSUIPC offset (see the Advanced User guide) using a file called myOffsets.txt. So you can add them to a spare/free FSUIPC offset, and then use the appropriate lua offset function to read the value.
Raysot Posted September 15, 2023 Author Report Posted September 15, 2023 Quote using a file called myOffsets.txt That was the ticket!. I didn't even know about this facility. Thanks for the info. I've tested it with my 2 A:Vars that I've been struggling with and it works like a charm. Thanks, John 😁
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now