Quinch Posted June 27, 2019 Report Posted June 27, 2019 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))
Pete Dowson Posted June 28, 2019 Report Posted June 28, 2019 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
Paul Henty Posted June 28, 2019 Report Posted June 28, 2019 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
Paul Henty Posted June 28, 2019 Report Posted June 28, 2019 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
John Dowson Posted June 28, 2019 Report Posted June 28, 2019 Hi Paul. I've moved this to your sub-forum, as requested. Regards, John
Quinch Posted June 28, 2019 Author Report Posted June 28, 2019 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?
Paul Henty Posted June 28, 2019 Report Posted June 28, 2019 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now