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

FSXA How to save throttle value in modeldef.xml?

Messages
230
Country
ecuador
Hi all,

In my modeldef.xml file, I try to save the return value (A: GENERAL ENG LEVER THROTTLE POSITION: 1 percent) in a variable (L: variable name, enum) at a specific time. But I see that my variable changes when the position of my throttle changes ... !!!

How to save the value given by (A: GENERAL ENG LEVER THROTTLE POSITION: 1 percent) without it being altered by a change in position of the throttle?

A big thank you for your help
 
hmmm... pseudo-XML below!

Code:
(L:throttlesaved, bool) 0 ==
if{
    (A: GENERAL ENG LEVER THROTTLE POSITION: 1, percent) (>L: variable name, number)
    1 (>L:throttlesaved,bool)
}

so, you save once and set the no-save variable to 1. Want to save again? reset L:throttlesaved to 1 as needed.
 
Hi Mario,

Thank you! But I had already tried this:

Code:
 (L:VitesseHaute, bool) !
                        if{
                            (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (>L:SaveThrottleHVInicio, percent)
                  
                            1 (>L:VitesseHaute, bool)
                        }

And unfortunately it does not work. My variable and consistently updated with every movement of my trottle ...

Abrazo fuerte de Quito ;)
 
Are you controlling (L:VitesseHaute, bool) somewhere else? That may be the issue...
Try 0 ==. Should be the same, but FS-X has some nasty habits with syntax. Also I avoid using (>L:varaiable,units) and use (>L:variable,units).
 
The problem is that all variables that depend on (A: GENERAL ENG LEVER THROTTLE POSITION: 1 percent) are systematically modified when a change in position of the throttle ... This, regardless of whether the receiving variables be conditioned (if {...}) or not.

How to avoid this?
 
The if{ } statement should just work...
again, are you doing something throttle related with (L:VitesseHaute, bool) ? If you are resetting that to 0 somewhere else in your code, then (L:SaveThrottleHVInicio, percent) will be updated at next cycle.

P.S. : what aircraft is involved here?
 
After many tests, I've realized that I had two versions of my code running at the same time ... one for the external model of the plane, and another for the virtual cockpit! That's been THE problem to me ...

So you were right Mario... Thanks for your help! :)
 
Back
Top