• 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 Equality between two variables

Messages
59
Country
france
I need your help to write in modeldef the following equality :

(L:CouplemetreAiguille1,enum) = (8550 / (A:GENERAL ENG RPM:1, rpm) )

Thank you for your help
 
Hi,

to me it is not perfectly clear from your question exactly what it is what you want, so i'll give the two options i think you might be after:

1. you want to check whether (L:CouplemetreAiguille1,enum) equals (8550 / (A:GENERAL ENG RPM:1, rpm)

Code:
(L:CouplemetreAiguille1,enum)  (8550  (A:GENERAL ENG RPM:1, rpm) / ) == if{ do something }

or (more likely),
2. you want the value of (8550 / (A:GENERAL ENG RPM:1, rpm) - meaning 8550 divided by (A:GENERAL ENG RPM:1, rpm), which in xml would be 8550 (A:GENERAL ENG RPM:1, rpm) / - to be put into (L:CouplemetreAiguille1,enum)

Code:
8550  (A:GENERAL ENG RPM:1, rpm) / (>(L:CouplemetreAiguille1,enum)

So if you want to give an L:Var a value the syntaxis is:
(Value "x") (>L:variable name, enum)

Now L:variable name,enum has the value of x, and x could be another L:var or A:var (such as airspeed, altitude, flaps position etc) but also a "hard number", for instance: 10 (>L:Variable name, enum) .
Note that unit-wise you are not restricted to enum but you can also use booleans in an L:Var, for instance L:variable name, bool which is then either 0 or 1 (false or true).

Hope this helps

grt
Willem
 
Last edited:
Thank you for your rapid response.

This is the second opportunity that interests me

But in your code, it seems that this bracket is useless

8550 (A: GENERAL ENG RPM: 1, rpm) / (> (L:CouplemetreAiguille1, enum)

I'll try without.

8550 (A: GENERAL ENG RPM: 1, rpm) / (>L:CouplemetreAiguille1, enum)

Regards
 
Hi,
But in your code, it seems that this bracket is useless
yep you are right! :o
copy paste isn't always the best way of answering to posts.

Good thing is that if you were to use an editor such as notepad2, this kind of mistake would be highlighted with colors when you place the cursor over the brackets.

grt
Willem
 
Last edited:
This code works perfectly, and the control gauge gives me right value.

To animate the needle of the torque I wrote this code:

<PartInfo>
Name>00-NORD_Couplemetre1_Aiguille</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
8550 (A:GENERAL ENG RPM:1,rpm) / (&gt;L:CouplemetreAiguille1,enum)
</Code>
</Parameter>
</Animation
</PartInfo>


.... and the needle doesn't move.

I certainly made ​​a syntax error, but which one?

Thank you for your help.
 
<PartInfo>
<Name>00-NORD_Couplemetre1_Aiguille</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
8550 (A:GENERAL ENG RPM:1,rpm) / (&gt;L:CouplemetreAiguille1,enum)
</Code>
</Parameter>
</Animation>
</PartInfo>

Marquée en rouge.
 
Thank you for your reply.... in French

I checked The modeldef. The "<,>" signs are present.

I think if they were absent, the control gauge wouldn't have returned any value.

.....But the needle still doesn't move
 
Thank you for your reply.... in French

I checked The modeldef. The "<,>" signs are present.

I think if they were absent, the control gauge wouldn't have returned any value.

.....But the needle still doesn't move

Oh, j'ai oublié:
Ta entrée pour l'animation a besoin d'une éntree dans le fichier modeldef avec une GUID unique.

Qu'el que chose comme:
<Animation name="00-NORD_Couplemetre1_Aiguille" guid="571GC011-78AA-4aa7-BD64-AACAC2AA121C" length="100" type="Sim" typeParam2="00-NORD_Couplemetre1_Aiguille" typeParam="AutoPlay" />

J'ai déja adaptée le GUID pour le rendre unique.
Cette entrée doit être positionée au dessus de l'entrée principal pour l'animation comme ça:

<Animation name=... />

<PartInfo>
...
</PartInfo>



(Excuse moi, si mon français est très mal. J'ai seulement voulu pratiquer mes abilités linguistiques françaises pour un peu. :D)

(If you really couldn't understand me, I can also write this again in english.)
 
Dein Französisch ist sehr verständlich, aber als wir in einem englischen Forum sind, schlage i vor, Englisch zu benutzen.

The error must come from elsewhere.

My Modeldef has the elements that you give.

.....But the needle still doesn't move
 
If you are alreadly calculating the value of the L:var elsewhere, then you do NOT need to "recalculate it" in your <Animation> <Code> section again!

Code:
<PartInfo>Name>00-NORD_Couplemetre1_Aiguille</Name>
   <AnimLength>100</AnimLength>
   <Animation>
     <Parameter>
       <Code>
              (L:CouplemetreAiguille1,enum)
       </Code>
     </Parameter>
   </Animation>
</PartInfo>
 
Thank you for your answers.

But I'd like to have only one code for the animation ? Is it possible or it is necessary to create two codes ?

  • One assigned to "a tiny, hidden poly in my poly model"
  • An another one to animate the needle?
 
Dein Französisch ist sehr verständlich, aber als wir in einem englischen Forum sind, schlage i vor, Englisch zu benutzen.

Wow, well played monsieur! :D



But I'd like to have only one code for the animation ? Is it possible or it is necessary to create two codes ?

  • One assigned to "a tiny, hidden poly in my poly model"
  • An another one to animate the needle?

Why don't you just assign the code directly to each needle?

I mean, of course it's possible to have a "controller" object that basically calculates everything for every (custom) animated part of the model, but it's generally not necessary.


By the way, the needle is keyframe animated, isn't it?
 
Back
Top