Cockpitbuilders.com

LUA Projects => General Discussions => Topic started by: navymustang on May 27, 2020, 05:04:44 PM

Title: LUA access to FSUIPC offsets versus P3D AVars
Post by: navymustang on May 27, 2020, 05:04:44 PM
OK, I'm new to LUA. What is the difference between accessing the FSUIPC offset 0B54 (APU RPM) versus reading the AVar "APU PCT RPM" ?
Am I always guaranteed to get the same result? Are they both always maintained by P3D?
That is:
 something = ipc.readDBL(0x0B54)
or
 something = varget("A:APU PCT RPM")
Title: Re: LUA access to FSUIPC offsets versus P3D AVars
Post by: Trevor Hale on May 29, 2020, 09:00:07 AM
Quote from: navymustang on May 27, 2020, 05:04:44 PMOK, I'm new to LUA. What is the difference between accessing the FSUIPC offset 0B54 (APU RPM) versus reading the AVar "APU PCT RPM" ?
Am I always guaranteed to get the same result? Are they both always maintained by P3D?
That is:
 something = ipc.readDBL(0x0B54)
or
 something = varget("A:APU PCT RPM")
FSUIPC variables are Generic and work on aircraft that use the built in generic flight sim sim connect facility. 

lvars or Lua variables are specific to aircraft for internal systems. Ie PMDG don't use generic sim connect stuff but have their own coded LVARS that interact with their own coded systems. 

hope that clears the differences up. 

Trev
Title: Re: LUA access to FSUIPC offsets versus P3D AVars
Post by: navymustang on May 29, 2020, 04:14:49 PM
mmm, not quite. I wan't using LVARs in this example, just the same two references to what seems to be an FSUIPC variable and a P3D variable ("A:"). Are they referring to the same exact data? Can I use either one or is one more preferred?

Thanks
Title: Re: LUA access to FSUIPC offsets versus P3D AVars
Post by: Trevor Hale on May 31, 2020, 05:09:57 AM
Maybe if you could give me an example. 

For instance: The P3D (simconnect) variable for flaps and landing gear will be the same FSUIPC offset for flaps and gear. 

The FSUIPC Offset or P3D Simconnect variable for Cockpit lighting will be the same however an aircraft may not listen to that to turn on its cockpit light and may need to be turned on through its own specific LVAR. 

Does that make more sense?

Trev
Title: Re: LUA access to FSUIPC offsets versus P3D AVars
Post by: navymustang on May 31, 2020, 06:02:07 AM
Yes, it was what I though, you simply can't depend on it. So just test test test until you prove what variables are being used.