Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hello,

I have been working on a display message with in FSUPIC to display the landing rate. I have got the message to show, the issue I am getting is the message showing then closing and then it will never show again.

public Offset<string> messageWrite = new Offset<string>(0x3380, 128);
public Offset<short> messageDuration = new Offset<short>(0x32FA);

string Message = "my message test";
this.messageWrite.Value = Message;
this.messageDuration.Value = 2;
FSUIPCConnection.Process();

^ Here is my code.

Posted

Hi George,

Apologies for the delay in replying.

The reason it won't show after the first time is that the values of the offsets have not changed since the first time Process() was called. The DLL will not write normal offsets unless their values change.

To solution is to mark the offsets as 'Write-Only'. These type of offsets will be written every time Process() is called, even if the offsets values have not been changed. The messaging offsets are a good example of write-only offsets. You would never have to read value from them.

Because they are written on every process, you should also put them in their own group so that you can control exactly when they are written. (You process that group only).

Here are the offset declarations, placing them in their own group called 'message' and marking them as write-only: (Last parameter is set to true).

        private Offset<string> messageWrite = new Offset<string>("message", 0x3380, 128, true); 
        private Offset<short> messageDuration = new Offset<short>("message", 0x32FA, true); 

Here is the code for writing. It's the same except we are now processing the specific group.

            string Message = "my message test";
            this.messageWrite.Value = Message;
            this.messageDuration.Value = 2;
            FSUIPCConnection.Process("message");

Paul

 

  • 7 months later...
Posted

Hi

This is a really easy way to push messages to the screen that is used whilst flying an aircraft.

How can I request an input using a similar interface where it just asks for a string input or maybe multiple selection inputs like what we find in the built-in ATC system of FSX?

Thanks

Posted
Quote

How can I request an input using a similar interface where it just asks for a string input or maybe multiple selection inputs like what we find in the built-in ATC system of FSX?

I don't know any way to accept a string input inside of the Flight Sim. I don't think that's possible. You would have to do this on a form or message box in your own application.

You can respond to key presses in the sim. So you could display a list of options and then wait for the user to press the appropriate key (or key combo) in the sim. See the example code application under 'Input Services', specifically IS001_KeyPresses.

Paul

Posted

Hi Paul and thanks for the quick response. Whilst going through the examples I did end up using code from the keypress example code and it seems to work the way I want it to work. One just needs to take special care to unassign keys before closing otherwise it eventually gives errors when opening and closing the app several times whilst FSX is running a single instance (obviously this is experienced only during debugging when one binds and unbinds the keys several times for a single FSX session)


I think the ideal approach for me in the end might be to add my code as an instrument but I have no idea how to start with this with c# so if you have any thoughts on how to create a simple instrument such as FSX Ground Handling 5 (https://flyawaysimulation.com/downloads/files/2634/fsx-groundhandling-gauges-pushback-taxispeed-control-etc/) I would be highly appreciative 🙂


Basically I'm using your DLL to create macro's for setting flight conditions so having it as an instrument add-on will probably be more useful to other users when I can release it to the public.

Thanks again for your hard work that I'm sure has made FSUIPC interfacing a lot easier for many other folks.

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
×
×
  • 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.