Jump to content
The simFlight Network Forums

FSUIPC Clarification Questions


Recommended Posts

Hello,

I have a few questions about using FSUIPC and LUA:

1. What is the difference between manipulating controls using FSUIPC offsets (ipc.writeUB()) versus sending the FSX control directly (ipc.control())? Which is more efficient?

2. What is more optimized, assigning FSX controls to buttons through the FSUIPC interface or setting controls via FSUIPC offsets (ipc.writeUB()) from lua scripts or sending FSX controls directly from lua scripts (ipc.control()).

I've been doing quite a bit of programming using LUA and have discovered there are multiple different ways to interact with FSX. I'm just trying to determine what ways are better, simpler, more optimized, etc.

Thanks for any input or insight into the inner workings of FSUIPC.

Link to comment
Share on other sites

1. What is the difference between manipulating controls using FSUIPC offsets (ipc.writeUB()) versus sending the FSX control directly (ipc.control())? Which is more efficient?

It varies. For many things in FSX, and some things in FS9, writing to offsets causies FSUIPC to send the control in any case. The days of global variables inside FS being directly writeable are all but over.

2. What is more optimized, assigning FSX controls to buttons through the FSUIPC interface or setting controls via FSUIPC offsets (ipc.writeUB()) from lua scripts or sending FSX controls directly from lua scripts (ipc.control()).

Difficult to say. Buttons are being polled at intervals in any case. Action isn't instant. Lua plug-ins are being interpreted in a separate thread, but to stop them monopolising things there are plenty of Yields or Sleeps in the interpreter. I doubt you could measure any differences. Each is suited to what it is aimed at -- button assignments for buttons, Lua plug-ins for more esoteric applications.

I've been doing quite a bit of programming using LUA and have discovered there are multiple different ways to interact with FSX. I'm just trying to determine what ways are better, simpler, more optimized, etc.

It's what is best able to do what you want to do, not which is more "efficient". I doubt you could measure efficiency.

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.