Jump to content
The simFlight Network Forums

How to print anything on screen?


Recommended Posts

Hi All,

My main question is how can I print anything on FS screen. But let me explain in short what led me to this need. I'm building some simple GA cockpit and after interfacing almost all functionality I needed to hardware, I encountered really annoying problem. In most aircrafts that I use (Carenado's F33, RealAir Duke), in order to dial in AP altitude and AP vertical speed you must switch between them with some special button so they appear to view in AP window. The catch is in that this functionality is not supported by FSX API and is implemented by each arcraft vendor. I tried to give a chance to mouse macro wizard in FSUIPC but it just doesnt work. At all. I get a mouse macro window, give it a name, clicking 'OK', exiting FSUIPC, clicking, dragging, switching all different things in cockpit of many different aircrafts and nothing happens, - no window, no text, no prompts. No .mcro file is created of course. So I left this idea behind and decided to create lua script that will print V/S and ALT values in the screen corner for example and will be updated in case of update event when I change it with rotaries.

I started to learn Lua scripting, read FSUIPC Lua Library Reference. However there is still some mess in my head regarding usage of the library so, please if anyone could provide me with small code snippet or point to right one from examples it will be very appreciated.

BTW, if anyone will tell me why mouse macros might not work it will be appreciated also, despite that I don't really believe macro will help me :)

I have FSX with Acceleration pack, FSUIPC 4.823, Win 7 Enterprise and ATI graphics card.

Best Regards,

Mike

Link to comment
Share on other sites

I tried to give a chance to mouse macro wizard in FSUIPC but it just doesnt work. At all. I get a mouse macro window, give it a name, clicking 'OK', exiting FSUIPC, clicking, dragging, switching all different things in cockpit of many different aircrafts and nothing happens, - no window, no text, no prompts.

mouse macros only work with gauges designed and written in C/C++ according to Microsoft's gauge SDK. Fewer and fewer aircraft are made that way these days, and most of Microsoft's own aircraft aren't even compliant.

I started to learn Lua scripting, read FSUIPC Lua Library Reference. However there is still some mess in my head regarding usage of the library so, please if anyone could provide me with small code snippet or point to right one from examples it will be very appreciated.

There are lots of examples provided in the ZIP of Lua examples in your FSUIPC Documents folder, and in fact listed in the Lua documentation PDFs provided. Several of them create windows on screen.

Regards

Pete

Link to comment
Share on other sites

Thank you for quick reply Pete.

I just thought I will find at least somethig in one of aircrafts suitable for macro just to be sure it works in general. But I got the point. And to be little more precise with my question, is it possible to write things in the main window instead creating new one? For example as I can see the framerate in the left upper corner by clicking Shift+z.

Best Regards,

Mike

Link to comment
Share on other sites

And to be little more precise with my question, is it possible to write things in the main window instead creating new one? For example as I can see the framerate in the left upper corner by clicking Shift+z.

You can easily display one-line messages for display in the same bar as ATIS messages, for example, by writing them to offset 3380 and putting a time-code into 32FA, From Lua, something like this:

ipc.writeSTR(0x3380, "This is a one-line message")

ipc.writeSW(0x32FA, 5)

The 5 in the second line makes the display last for 5 seconds (or until replaced). You can put 0 for no limit. The message must not be longer than 127 characters.

Regards

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.