Jump to content
The simFlight Network Forums

Offset Help


Recommended Posts

Hello every body.

I would like to ask some question as following:

1) I want to build radar contact program. If my program is not connected to the multiplayer(but the player's simulatror is connected), can my program still get AI information?

2) I am programming with VB. In the read function of the FSUIPC module, I am using the offset D010.

a) When Iam writing &D010, I am getting an error about the & symbol.

b) This offset is 48 bytes long. I am not familiar with variant that his size is 48. How can I get an variant with a size of 48 bytes?

3) The offsets for the AI traffic gets a data from all the AI planes? If yes how can I get information from a specific plane?

Thank in advance and a happy new year.

Nahman Boguslawsky.

Link to comment
Share on other sites

If my program is not connected to the multiplayer(but the player's simulatror is connected), can my program still get AI information?

FS does not support both multiplayer and AI traffic simultaneously, so there is no AI information to obtain in multiplayer modes.

I am programming with VB. In the read function of the FSUIPC module, I am using the offset D010. When Iam writing &D010, I am getting an error about the & symbol.

I think, in VB, you indicate hexadecimal by that leading & so I don't know why it would fail. However, the Microsoft compiler stupidly sign extends the D010 making the value FFFFD010 which will cause problems. You have to postpenf an & too I think: &D010&.

This offset is 48 bytes long. I am not familiar with variant that his size is 48. How can I get an variant with a size of 48 bytes?

Do you mean "variable", not "variant"? Offsets are hexacimal numbers and are containable in an integer. You must be talking about the data to which the offset relates? Data can be of any length. This message I am writing now, for instances, can be thought of as one string which is several hundred bytes long.

You will see from the FSUIPC Programmer's Guide that the data at D010 is an array of structures (TCAS_DATA2) each of which is actually 20 bytes long. There can be 96 of these, so the real data length at offset D010 is 96 x 20 or 1920 bytes. Where exactly are you reading "48" from?

The offsets for the AI traffic gets a data from all the AI planes? If yes how can I get information from a specific plane?

You find the one you want in the complete list of planes within range, of course. How else? How are you identifying the plane? By position, by an ID of some kind?

Regards,

Pete

Link to comment
Share on other sites

If my program is not connected to the multiplayer(but the player's simulatror is connected), can my program still get AI information?

FS does not support both multiplayer and AI traffic simultaneously, so there is no AI information to obtain in multiplayer modes.

I am programming with VB. In the read function of the FSUIPC module, I am using the offset D010. When Iam writing &D010, I am getting an error about the & symbol.

I think, in VB, you indicate hexadecimal by that leading & so I don't know why it would fail. However, the Microsoft compiler stupidly sign extends the D010 making the value FFFFD010 which will cause problems. You have to postpenf an & too I think: &D010&.

This offset is 48 bytes long. I am not familiar with variant that his size is 48. How can I get an variant with a size of 48 bytes?

Do you mean "variable", not "variant"? Offsets are hexacimal numbers and are containable in an integer. You must be talking about the data to which the offset relates? Data can be of any length. This message I am writing now, for instances, can be thought of as one string which is several hundred bytes long.

You will see from the FSUIPC Programmer's Guide that the data at D010 is an array of structures (TCAS_DATA2) each of which is actually 20 bytes long. There can be 96 of these, so the real data length at offset D010 is 96 x 20 or 1920 bytes. Where exactly are you reading "48" from?

The offsets for the AI traffic gets a data from all the AI planes? If yes how can I get information from a specific plane?

You find the one you want in the complete list of planes within range, of course. How else? How are you identifying the plane? By position, by an ID of some kind?

Regards,

Pete

So, you are meaning that I can not build an radar contact program with FSUIPC?

Else, how can I get information about the planes that connected to the multiplayer?

Link to comment
Share on other sites

If my program is not connected to the multiplayer(but the player's simulatror is connected), can my program still get AI information?

FS does not support both multiplayer and AI traffic simultaneously, so there is no AI information to obtain in multiplayer modes.

I am programming with VB. In the read function of the FSUIPC module, I am using the offset D010. When Iam writing &D010, I am getting an error about the & symbol.

I think, in VB, you indicate hexadecimal by that leading & so I don't know why it would fail. However, the Microsoft compiler stupidly sign extends the D010 making the value FFFFD010 which will cause problems. You have to postpenf an & too I think: &D010&.

This offset is 48 bytes long. I am not familiar with variant that his size is 48. How can I get an variant with a size of 48 bytes?

Do you mean "variable", not "variant"? Offsets are hexacimal numbers and are containable in an integer. You must be talking about the data to which the offset relates? Data can be of any length. This message I am writing now, for instances, can be thought of as one string which is several hundred bytes long.

You will see from the FSUIPC Programmer's Guide that the data at D010 is an array of structures (TCAS_DATA2) each of which is actually 20 bytes long. There can be 96 of these, so the real data length at offset D010 is 96 x 20 or 1920 bytes. Where exactly are you reading "48" from?

The offsets for the AI traffic gets a data from all the AI planes? If yes how can I get information from a specific plane?

You find the one you want in the complete list of planes within range, of course. How else? How are you identifying the plane? By position, by an ID of some kind?

Regards,

Pete

So, you are meaning that I can not build an radar contact program with FSUIPC?

Else, how can I get information about the planes that connected to the multiplayer?

And, I tried to write &D010&, and it still cause me a problem. The error is:

Compile Error:

expected: expression.

Here is my code:

    Dim AIDat As Variant

    Call FSUIPC_Read(&D010&, 48, VarPtr(AIDat), dwResult)

    Label1 = AIDat

The variant type is because I don't know what type I need, to this offset, I don't know what type of variable is 48 size long.

Thanck in advance.

Nahi.

Link to comment
Share on other sites

So, you are meaning that I can not build an radar contact program with FSUIPC?

Else, how can I get information about the planes that connected to the multiplayer?

I don't know anything about multiplayer, but programs written to inject aircraft into FS using Multiplayer can, if they wish, also inject details of those aircraft into FSUIPC's TCAS tables.

It depends how you are getting these MP aircraft. There's a utility called AIBridge from Jose Oliveira which used to do this job for Squawbox 2, but I think (I am not sure) that SB3 does it by itself now. I'm not sure about the other programs. You'd really need to talk to whoever is doing the multiplayer program which you are using.

The other way, of course, if you only ever want to deal with multiplayer is for you to write to the MP interface in FS directly, not to FSUIPC at all. It seems a roundabout system to have a utility interfacing to MP just to inject information into FSUIPC so you can read it out again, when you could do it all directly. The only reason the facility for injecting MP data into FSUIPC's tables was added was so that existing TCAS gauges and the like, written for the FS AI traffic, would work with MP traffic too.

Regards,

Pete

Link to comment
Share on other sites

And, I tried to write &D010&, and it still cause me a problem.

Sorry, I've no idea at all then. You will need to refer to a VB programming book I think, unless someone else here spots this and comes to your aid. I really don't know VB at all. It seems to be deliberately designed to confuse -- at least it always confuses me. C may look more complex to some but it seems far more logical.

The variant type is because I don't know what type I need, to this offset, I don't know what type of variable is 48 size long.

So "Variant" is some really magic type, is it? I've no idea how VB can reserve the correct space if you give it no dimensions. Why 48 in any case? Where do you get this 48 from? I asked you before but you don't answer. The table at D010 is an array of 96 structures each 20 bytes long, so overall it is 1920 bytes long, not 48. The number 48 doesn't figure in it anywhere.

Regards,

Pete

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...

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.