Sasa
December 12, 2022, 4:12pm
1
Hi! What’s the correct way to set up a time variable for a simobject that
should show at every 1st of a month? Tried this but it doesn’t seem to work:
(E:DAY_OF_MONTH,Day) 1 == if{ 1 } els{ 0 }
The mesh doesn’t show up on on any day of the month here. This variable using
ambient temperature (=show above 1°C) works great - so the basic setup
shouldn’t be a problem:
(A:AMBIENT TEMPERATURE,Celsius) 1 >= if{ 1 } els{ 0 }
Also not sure if “Day” is the correct unit above as I don’t see this
documented in the SDK. Thanks!
Sasa
December 12, 2022, 4:27pm
2
This isn’t working neither:
(E:LOCAL DAY OF MONTH) 1 == if{ 1 } els{ 0 }
Problem is that neither of them can be found in the SDK’s SimVar Watcher and
therefore cannot be easily checked.
Try this…The unit would be a number! Works on my end.
(E:LOCAL DAY OF MONTH, Number) 1 == if{ 1 } els{ 0 }
@FlyingRaccoon Be great to have
this in the SDK but more important the Simvars.
Sasa
December 13, 2022, 7:41am
4
This works perfectly, thank you @Flysimware !!! Agree, Simvars would be a heck
of a tool if it would support queries for all variables mentioned in the SDK.
On the other side the SDK documentation lacks some crucial information like
the one you posted above. Assuming this is the source:
https://www.prepar3d.com/SDKv4/sdk/references/variables/environment_variables.html
Sadly the applicable page from the MSFS SDK lacks any information on units
entirely:
https://docs.flightsimulator.com/html/Additional_Information/Reverse_Polish_Notation.htm?rhhlterm=%22local%20day%20of%20month%22&rhsearch;=%22LOCAL%20DAY%20OF%20MONTH%22
Boris
December 13, 2022, 8:32am
5
Hi @Sasa , @Flysimware , Thank you for the feedback, we will update the doc
and add the type of each E: environment variable Regards, Boris
@Boris Hi, just to make sure about something with the RPN expression above,
would the following work too? (E:LOCAL DAY OF MONTH) 1 ==
Jean-Luc
Boris
December 13, 2022, 4:19pm
7
Hi Jean-Luc, You will need to add the type for this to work like this
example (for the visibility):
(E:LOCAL DAY OF MONTH, **number** ) 1 == if{ 1 } els{ 0 }
Regards, Boris
Yes, you are right, I missed this one in copy/pasting the above ex. My
question was more about:
1==
vs
1== if{ ......`
If you use this variable without an if{do something} action then it becomes a
true/false question. Can be used for many types of code.
(E:LOCAL DAY OF MONTH, number) 1 ==
Example: This would allow you to return true or false to the function
getdayofmonth() for HTML code.
getdayofmonth() {
return SimVar.GetSimVarValue("E:LOCAL DAY OF MONTH", "number") 1 ==;
}
Example: This XML example would show the visibility of a mesh on this day.
(E:LOCAL DAY OF MONTH, number) 1 ==
So to answer your main question, no you do not need to include the if{do
something} action.