Jump to content
The simFlight Network Forums
mer

offsets for 2nd,3rd, and further temp/wind/cloud layers

Recommended Posts

How do I read the values from P3d when there is more than 1 layer of wind/cloud/temperature present?

The offsets mapped in FSInterrogate and the documentation provide data only for one layer of each of these parameters. An attempt to calculate the locations of other parameters and use the resultant offsets for querying them provides incorrect values.

For instance, when 2 cloud layers are present, the value of one can be accessed using locations 0xc680-0xc68e. But when i try to access the values for the 2nd layer from locations c68F-c69e i get the wrong readings.

Could you please guide?

 

Thank you

 

Share this post


Link to post
Share on other sites

Yes, I am using C#, the code in UIPC_SDK_CSHARP Revision 1.13 packaged with FSUIPC5. The code is  Scott McCrory and Bob Scott's, with improvements by you

I am making use of the fsuipc.cs file  in that folder

Share this post


Link to post
Share on other sites
Quote

the value of one can be accessed using locations 0xc680-0xc68e. But when i try to access the values for the 2nd layer from locations c68F-c69e i get the wrong readings.

The cloud layers start at 0xC680. Each layer is 16 (0x10) bytes. So the second layer will start at 0xC690 (not c68F). The third will be 0xC6A0 etc.

Paul

Share this post


Link to post
Share on other sites

Thank you, I got that. For wind layers, i tried the same logic. Locations for surface wind layers are 0xC4fc-0xC508. That comes to 12 bytes (0x0c) per layer. Does the second layer therefore starts at c50e?

Share this post


Link to post
Share on other sites

No, the wind layers are 16 bytes each. So the second wind layer will be 0xC50C.

I'm not sure where you're getting your information. The wind layers are from 0xC4FC-0xC67B.

The document you should be looking at is called NewWeather.h. This is found in a ZIP file called "New Weather Interface for FS2004.zip". This is found in the FSUIPC SDK.

It tells you the locations of each array and the size and layout of each structure (e.g. Wind, Clouds etc).

Paul

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.