• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

L: and G: Variable TYPE ?

Messages
497
Country
unitedstates
Gauge Parameters ( G: )
Parameters of the “G” kind have names from Var1 to Var9. These are used by gauge developers to store and retrieve variables across gauge elements. These values are unitless so do not put unit names after them. The default value of a gauge parameter is 0.

Local Parameters ( L: )
When a local parameter is first referenced, it is created and its value is set to zero. Use your own names for these parameters, but care should be taken that these names are unique.

So, are ( G: ) and ( L: ) variables only Numeric/bool. ?
ie Cannot be STRINGS ??

I tried using them to hold Strings, and they always return a result of 0 !!
Could be me using incorrect syntax ???

If ( G: ) and ( L: ) cannot be STRING variables, is there any way to to have Local or shared STRING Variables in XML Gauges ??

Geoff
 
G:vars and L:vars are all FLOAT64 types. Period.

There's no facility for storing, much less sharing string data.
 
G:vars and L:vars are all FLOAT64 types. Period.

There's no facility for storing, much less sharing string data.

OK, good to know . so its not possible.

but :idea:

One could store, share a fixed length string, as a set of Dwords, with each Dword represting 4 x 8-bit Ascii chars. ie ABCD = 0x41424344

actually, if they are Float64 types, that could be 8 x 8-bit Ascii chars maybe !!
Not so bad :)

========================

Back to my Vizability "decoding" issue:

Display Viz as 0, 1/16, 1/8, 3/16, 1/4, 5/16 .......1, 1 1/8, 1 1/4 .... 3, 4 .. 15, 20, >20 ( 43 unique "string" values)

seems I have two methods

(a) Decode for each being within a Range and print "string" if in range is true ( requires to compaires per value, high & low) 43 * 2 Comparisons pairs, each with an {if}

or

(b) Decode each and compare to be less than, and if less than, set numeric variable to increasing enum, then use the enum in a "case" statement to print "string"
43 Comparisons, and then a single Case statement


Looks like method (b) is the most efficient , and cleaner solution,
Calculate first, and then display based on calculation.

Anyone know a better way than (b) ????

Geoff
 
Option (b) would seem to be the most efficient.

As for scripting, you might wish to take advantage of "stored register" results function to cut down on the amount of actual typing...

s0...s9 (nine storage registers)
l0...l9 (load from the registers)
 
Back
Top