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

MSFS Getting temperature at a given location

Messages
60
Country
spain
Hi,

Can any of you think on a creative way of obtaining ambient temperature readings 1 NM in front of the aircraft (or a given lat/ long)? I’m asking for creative ideas since I know we can’t call simvar AMBIENT TEMPERATURE at any location.

Ideas are appreciated!

Thanks.
 

DragonflightDesign

Resource contributor
Messages
936
Country
northernireland
Well... what we used to do for creating TFR (terrain following radar) in FSX was to add an invisible aircraft (or flight of aircraft) that flew in formation directly along the heading of the user aircraft. You should be able to do something very similar in MSFS.
 
Messages
60
Country
spain
Well... what we used to do for creating TFR (terrain following radar) in FSX was to add an invisible aircraft (or flight of aircraft) that flew in formation directly along the heading of the user aircraft. You should be able to do something very similar in MSFS.
Yes, this is what I’m looking at as we speak. There are some nice implementations of sim probes out there.

Thank you!
 
Messages
42
Country
argentina
It could, but it should be adapted in many ways, initially you can't use includes like time.h and windows.h, math.h and stdio.h are OK, rest im not sure.
In some project I have "creatively" resolved not being able to use "time.h", but access to Windows definitely cannot be solved from an WASM module, thats why most add-ons need an external simconnect app.
 
Messages
60
Country
spain
my simconnect code from a century ago: https://github.com/ijl20/msfs_probe/blob/main/Modules/sim_probe/sim_probe.cpp

I'm wondering whether this could all be done from wasm in MSFS today.
I'd say yes, at least regarding the core of the code (which is what I've been working on). I even used for testing the SimProbe.mdl and it does show in the Sim :) So I'd say yes, with a little work probably.

It could, but it should be adapted in many ways, initially you can't use includes like time.h and windows.h, math.h and stdio.h are OK, rest im not sure.
In some project I have "creatively" resolved not being able to use "time.h", but access to Windows definitely cannot be solved from an WASM module, thats why most add-ons need an external simconnect app.
Not sure why you say that we can't use includes such as windows.h, math.h, time.h ... I am using all of them as we speak, and I don't have an issue with it. There are certain restrictions on file reading/ writing, but other stuff can be used without any problems.
 
Messages
42
Country
argentina
Not sure why you say that we can't use includes such as windows.h, math.h, time.h ... I am using all of them as we speak, and I don't have an issue with it. There are certain restrictions on file reading/ writing, but other stuff can be used without any problems.
you mean you use them in an in-game wasm module?
 
Messages
60
Country
spain
you mean you use them in an in-game wasm module?
Just so everyone is aware, after a few private comments with Diego, I wanted you to know that he is completely right concerning windows.h in a WASM module; it cannot be included. It works for a SimConnect module, but not WASM.

Regarding other libraries, all I can add is that at least chrono, cmath, iostream, string and time can be included.

I apologize for the misunderstanding, and thank you Diego for your feedback!

Best!
 
Messages
60
Country
spain
Continuing with this subject, I was able to create one test probe, send it to Oslo (in order to be very far from the user aircraft) and tried to read AMBIENT TEMPERATURE from it. So far that’s been unsuccessful. I keep getting the temperature from the user aircraft position, not the new created objectID.

Any thoughts?
 
Messages
26
Country
us-newyork
... concerning windows.h in a WASM module; it cannot be included.
To be more specific here, just in case it helps anyone avoid confusion, for WASM modules one would `#include <MSFS/MSFS_WindowsTypes.h>` instead of Windows.h. This is also required before trying to include "SimConnect.h" since that uses some MSVC types (mostly DWORD) but deliberately doesn't include any headers which declare them.

HTH,
-Max
 
Last edited:
Messages
60
Country
spain
To be more specific here, just in case it helps anyone avoid confusion, for WASM modules one would `#include <MSFS/MSFS_WindowsTypes.h>` instead of Windows.h. This is also required before trying to include "SimConnect.h" since that uses some Windows types but deliberately doesn't include any headers which declare them.

HTH,
-Max
Thank you!
 
Messages
60
Country
spain
Continuing with this subject, I was able to create one test probe, send it to Oslo (in order to be very far from the user aircraft) and tried to read AMBIENT TEMPERATURE from it. So far that’s been unsuccessful. I keep getting the temperature from the user aircraft position, not the new created objectID.

Any thoughts?
FYI, it seems AMBIENT TEMPERATURE cannot be extracted for different Objects, only for the User.
 
Top