• 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.

Flight - Missions - Lua - varget - Exposed vars

Messages
1,361
Country
scotland
Hi Folks

Any suggestions/help/code would be much appreciated.


N.B.
Following examples only show RHS of variable assignments.

From looking at various mission's xml scripts
I can see data being extracted for use in calculations, e.g.
Code:
varget('S:Performance.MaxTakeoffWeight', 'pounds')
Above appears to be reading MaxTakeoffWeight
from the user-aircraft's staticproperties.spb file.



I'm trying to extract other data
from that same staticproperties.spb file, e.g.
Code:
varget('S:Aerodynamics.StallSpeedVs1', 'knots')
Above always appears to return a zero/nil value.



My trigger code itself is working ok,
as I can fire my trigger correctly,
with a dirty workaround, by substituting -
Code:
(varget('S:Performance.MaxTakeoffWeight', 'pounds') / 1000 )
Above returns 50 as a number, (i.e. for C-46, 50000 lbs MTOW / 1000).



Is my StallSpeedVs1 code incorrect,
or can varget() only utilise a limited selection of variables ?


If the latter, is there a list somewhere please ?



I'm guessing a translation table may possibly be involved,
as for example -
Code:
increment_career_stat('TotalHappyPassengers', 2)
is saved to the user's online profile as - PassengersHappy



Many thanks
ATB
Paul
 
Hi Steve

Thanks, that's a most useful list.
It gives me a definitive base framework to work from.
Very much appreciated.

I'd suspected it might be limited to those seen.
I'll investigate workarounds for what I was hoping to achieve

It saves me further extracting from missions themselves,
or XSD'ing and extracting from the simprops, (which'd mainly have been guesswork).



Looks like the MaxTakeoffWeight call might be hardcoded in Airplane.dll.
Not surprising given its import to Flight,
relevance in payload/fuel dialogs, and all dynamic missions.

Entirely seperately, also seeing references in there,
to MaxTakeoffWeight, plus several other staticproperties entries.
Again guessing, possibly for the aircraft's infobox in the Hangar.



Many thanks
ATB
Paul
 
Hmm, I tried looking and couldn't find anything. I may need to look again.

Edit: Ahh! You are right. That is the only variable in there though. :(
 
Last edited:
That is a very useful list Steve! Thanks for extracting the knowledge!;)

Just one question for Paul:
.. You are processing the missions through XSD right? Isn't this a bit difficult? :scratchch
Are you just varying some mission code/tweaking to make it a different challenge?

I've been trying to create some new missions, so I thought that you may have a bit of an insider!:confused: You seem like the only one interested in some mission development!
Well, except for Steve..of course.
 
Back
Top