Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hey guys,

 

So i wanted to create a script that changes over to the next fuel tank automatically when a specific fuel quantity is left in the mains. I thought FSUIPC might be a good way to do it. But I´ve never worked with it other than as an API to 3rd party tools. How do I approach this?

 

Thanks

Posted

First, look for the offsets which hold the fuels tank quantities - you probably want to use the fuel tank level offsets starting at 0x0B74 or 0x1244 (not sure why these are duplicated....). I would monitor them first (using Log =>Offsets) to verify that they are changing as expected. Then create a lua script and use event.offset to receive the level every time it changes. When it reaches a certain level, you can then send the control (using ipc.control) to switch fuel tanks, and maybe also start monitoring the level in that tank as well to switch to the next tank when the level drops below a certain quantity / %age - you can so this for as many tanks that are available. See the FSUIPC Lua Library document for details on how to use these functions.

Note also that the script should be auto-started from your FSUIPC7.ini, most probably only in the profile for the aircraft for which you want to use the script. See the Advanced User guide for automatic running of Luas.

John

Posted
6 hours ago, John Dowson said:

First, look for the offsets which hold the fuels tank quantities - you probably want to use the fuel tank level offsets starting at 0x0B74 or 0x1244 (not sure why these are duplicated....). I would monitor them first (using Log =>Offsets) to verify that they are changing as expected. Then create a lua script and use event.offset to receive the level every time it changes. When it reaches a certain level, you can then send the control (using ipc.control) to switch fuel tanks, and maybe also start monitoring the level in that tank as well to switch to the next tank when the level drops below a certain quantity / %age - you can so this for as many tanks that are available. See the FSUIPC Lua Library document for details on how to use these functions.

Note also that the script should be auto-started from your FSUIPC7.ini, most probably only in the profile for the aircraft for which you want to use the script. See the Advanced User guide for automatic running of Luas.

John

Thanks, maybe I need to emphasize it more: I have NEVER actively used FSUIPC. Do you have a good source on how to start in general?

Posted
1 minute ago, St54Kevin said:

Thanks, maybe I need to emphasize it more: I have NEVER actively used FSUIPC.

Do you have a license? You need a registered version for the lua facilities - if you have not purchased yet, please try the trial license, available here: 

 

3 minutes ago, St54Kevin said:

Do you have a good source on how to start in general?

Use the provided resources - the documentation that comes with FSUIPC (there is also a zip file containing example lua plugins), and the forums - you can look in the FAQ sub-forum and the User Contributions sub-forum for lua scripts that others have provided. 

John

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.