Jump to content
The simFlight Network Forums

Writing Current 'Status' to Screen on Button Toggle


Recommended Posts

Hi, I have been looking for a solution up and down the Web, but other than getting confused about offsets, 32FA, Showtext and FsWindow I haven't gotten much further and maybe someone here can help.

 

I have setup a joystick button to act as a toggle (flag) between two 'states': one is a 'Camera State' in which most buttons on my joystick act as EZDOK camera switches, the other one is a 'Flight State' in which the same buttons are controlling airplane functions. On top of that there are actions which are independent from any state and perhaps in the future more states will be added.

 

I basically want to have a visual reminder of the state I am currently in, as in the thick of the action this can get quite confusing. So whenever I press the toggle button I'd like to have an onscreen message telling me the state. It would be enough if it was one word (i.e. 'Camera'/'Flight', 'State1'/'State2') or even just a Number ('0','1') and it doesn't have to be there all the time, perhaps for 3 seconds and then fade away, but just something that gives me a visual feedback of where I currently am.

 

I wouldn't know where to start – is this monitoring? offset programming? something build in?– let alone write the code in the ini file, though I did manage to create compound buttons and flags.

 

Thx

 

 

Link to comment
Share on other sites

I wouldn't know where to start – is this monitoring? offset programming? something build in?– let alone write the code in the ini file, though I did manage to create compound buttons and flags.

 

The only way to get a message on the screen is either by writing a program interfacing to SimConnect directly, or easier, a Lua plug-in writing to FSUIPC offsets.

 

Yes, 32FA and 3380 are the offsets to be written. The message is written to 3380 and then you write a control value (defining things like how long the display should stay, and whether it should scroll) to 32FA. The relevant Lua functions are

 

ipc.writeSTR(0x3380, "string to be displayed")

ipc.writeSW(0x32FA, controlvalue)

 

where, for example, the controlvalue would be 3 for a 3 second display.

 

You can have a small Lua plugin, with just those two lines, for each mode, and assign that Lua to the button (plus condition if applicable) which sets that mode.

 

Of course, alternatively, or as well, you could use the Lua sound library to play a wave file, annunciating the mode.

 

Pete

Link to comment
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
×
×
  • 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.