Acidic32 Posted May 25, 2009 Report Posted May 25, 2009 Im trying to create a program, which interfaces with FS9/FSX thru FSUIPC. Problem is, i dont know where to start. I dont really know to much C++, but i know a little C# but mainly vb.net. How do i create a addon module, which creates a menu item in vb.net/c#.net ? I dont want an external program, rather a internal FS program. Any help appreciated Acidic32.
Pete Dowson Posted May 25, 2009 Report Posted May 25, 2009 How do i create a addon module, which creates a menu item in vb.net/c#.net ? I dont want an external program, rather a internal FS program. The problems you will face trying to get a Managed program module, with all of its encumbrances, running inside a native C/C++/ASM environment such as FS will be pretty horrendous. Quite honestly, I wouldn't know where to start -- and I've been a programmer for 45 years! You don't say WHY you don't want it to be an "external" program. Apart from the ease of language choices, there are two other significant advantages of it being so: 1) Easy to take advantage of multi-core processors, as the program will be a separate process to FSX. To achieve any efficiency in a in-process module you have to take great care to offload much of your processing to other threads, and then try to manage their priorities well. 2) If your program uses the FSUIPC interface only for its connections to FS, then it would be capable of running on a separate PC too, via WideFS. Regards Pete
Acidic32 Posted May 25, 2009 Author Report Posted May 25, 2009 Its for a pilot client, similar to FSINN/Squawkbox, i mean, i could learn native C++ but its a language i really dont want to learn ;) Daniel
Pete Dowson Posted May 25, 2009 Report Posted May 25, 2009 Its for a pilot client, similar to FSINN/Squawkbox, i mean, i could learn native C++ but its a language i really dont want to learn ;) Well, that's up to you, of course. Incidentally, Squawkbox is actually mostly a separate program -- SB3 can be run as a WideFS client, and SB4 can be used with a SimConnect remote connection. Regards Pete
Acidic32 Posted May 25, 2009 Author Report Posted May 25, 2009 Ok, thank you, i notice multiplayer clients send a PBH value to the FSD server, but im not sure what data this is in FSUIPC? Any one shed a light? Also how do i start a FSX multiplayer connection, ie AI aircraft controlled via my program... Daniel
Acidic32 Posted May 25, 2009 Author Report Posted May 25, 2009 Ok, last question Pitch bank and Heading, are they INT or UINT's? from offset 0578 057C and 0580 ? Daniel
Acidic32 Posted May 25, 2009 Author Report Posted May 25, 2009 Ok, im trying to generate a PBH to send to the FSD Server, im currently struggling! public Offset pitch = new FSUIPC.Offset(0x578); public Offset bank = new FSUIPC.Offset(0x57c); public Offset heading = new FSUIPC.Offset(0x580); uint pbh = 0; pbh = ((uint)pitch.Value << 22) | ((uint)bank.Value << 12) | ((uint)heading.Value << 2); Console.WriteLine(pbh.ToString); it returns: P: 53070376 B: 12994522 H: 4274734951 PBH = 4286430620 but the FSD server, using another client sends for the same pitch, bank and heading: PBH unsigned value is 50348012 P=12 B=3 H=1019 What am i missing?
Pete Dowson Posted May 25, 2009 Report Posted May 25, 2009 uint pbh = 0; pbh = ((uint)pitch.Value << 22) | ((uint)bank.Value << 12) | ((uint)heading.Value << 2); What on Earth is that all about? You'll end up with a right mish-mash of meaningless bits! If you are trying to put approximate values into 10 bits apiece, then, since they arrive as 32 bits (and make full use of that 32 bits), you'll need to convert them all to integers first! P: 53070376 B: 12994522 H: 4274734951 Okay. Using my calculator that gives pitch = +4.448 degrees, bank = +1.089 degrees and heading 358.304 degrees, to 3 decimal places anyway. You ARE reading the description of these offsets, aren't you, and not just wasting my time? Pete
Acidic32 Posted May 26, 2009 Author Report Posted May 26, 2009 But why is the other FSD client sending P=12 B=3 H=1019 ? PBH unsigned value is 50348012? for the exact same pitch bank and heading..
Pete Dowson Posted May 26, 2009 Report Posted May 26, 2009 But why is the other FSD client sending P=12 B=3 H=1019 ?PBH unsigned value is 50348012? for the exact same pitch bank and heading.. Sorry, I've not the foggiest idea -- but obviously a heading of 1019 is nonsense in any case. Get the code right first then compare. And please try using the tools (like FSInterrogate) and the documentation provided. Regards Pete
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