wulybugger Posted November 22, 2012 Report Share Posted November 22, 2012 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. Quote Link to comment Share on other sites More sharing options...
Pete Dowson Posted November 22, 2012 Report Share Posted November 22, 2012 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.