Jump to content
The simFlight Network Forums
Quinch

Offset's 3160, 313C and 3148.

Recommended Posts

Hi, Im trying to use the offsets 3160, 313C and 3148. but they dont work for me, when i try to use them it just gives me a string of "Offset 0x3160 (String: 24 Bytes))". i can use Offset 0x3130 and that gives me the airline callsign but not anything else, im trying to get the Aircraft name ex. (Boeing 737-800) and the player callsign ex. (N001). am i using the correct offset?

Code: C#

private Offset<string> aircraftType = new Offset<string>(0x3160, 24); // this one doesnt work
private Offset<string> aircraftID = new Offset<string>(0x3130, 12); // this one works
//
ATCID = aircraftID.Value;
ATCTYPE = aircraftType.Value;
//
string aircraftData = "({ATCID} - {ATCTYPE })";

output: (MAULE - Offset 0x3160 (String: 24 Bytes))

 

Share this post


Link to post
Share on other sites

Are you using Paul Henty's .NET DLL here? If so, I should move this into his Subforum just above. I can't really with programming his DLL.

There are ways you can check that the offsets do contain what you expect. Eith use the "monitor" facility on the right-hand side of the Logging tab. just enter up to 4 offsets, select the type, and the values (up to a limited length, at least) will show in the FSUIPC LOG.

You can also check any (or all) offsets by using the utility program "FSInterrogate" which you'll find in the FSUIPC SDK.

Please also always state which versions you are using -- version of FS, version of FSUIPC, and, if used, version of the .NET DLL. Provide the full version numbers.

Pete

Share this post


Link to post
Share on other sites

Hi Pete,

This is going to be a specific issue with using my DLL (or C# programming). I'll investigate further and help the OP. In the mean time it's best to move it to my sub forum.

Thanks,

Paul

Share this post


Link to post
Share on other sites

Hi Quinch,

This code doesn't look correct to me:

string aircraftData = "({ATCID} - {ATCTYPE })"; 

It should have a $ in front of the string to use variable concatenation. At the moment this string would have the value "({ATCID} - {ATCTYPE })".

You don't show your output code, but I suspect it's not outputting the 'aircraftData' string but something else.

The code below works. You can try it for yourself and change it to fit into your code:
 

        private Offset<string> aircraftType = new Offset<string>(0x3160, 24); 
        private Offset<string> aircraftID = new Offset<string>(0x3130, 12); 

        private void Button6_Click(object sender, EventArgs e)
        {
            FSUIPCConnection.Process();
            string ATCID = aircraftID.Value;
            string ATCTYPE = aircraftType.Value;
           
            string aircraftData = $"({ATCID} - {ATCTYPE})";
           
            MessageBox.Show(aircraftData);
        }

Paul

Share this post


Link to post
Share on other sites
4 hours ago, Paul Henty said:

string aircraftData = "({ATCID} - {ATCTYPE })";

Sorry, i forgot to Include $"",
 

4 hours ago, Paul Henty said:

private Offset<string> aircraftType = new Offset<string>(0x3160, 24);

This offset will not give me the full aircraft name, flying a boeing 747-800 with this offset will give me just "BOEING". is there an offset to get the full aircraft name? 

Share this post


Link to post
Share on other sites

There is Aircraft Model which you could use in addition to the Aircraft Type...

private Offset<string> aircraftModel = new Offset<string>(0x3500, 24)

There is also Aircraft Name. This often includes the livery as well.

private Offset<string> aircraftName = new Offset<string>(0x3D00, 256);

The contents of these offsets depends on what the developer of the aircraft has written in the Aircraft.cfg file.

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.