Jump to content
The simFlight Network Forums

Lua - Calling addon event ID via ipc.control()


Psistorm

Recommended Posts

I'm in the process of setting up a VRInsight panel for my msfs needs, and my plan is as follows. There are two rotary knobs I want to bind to MFD/PFD map zoom, since the knobs have a limited range as does the map zoom, and since most encoders are already spoken for.

To that end I've found this thread 

in which Pete Downson posted an example lua file I mean to support for my ends, eventually figure out a way to create "steps" within the range rather than update map zoom on every little rotary change. My question though is, using an external .evt file (also from these forums), how do I need to call them in ipc.control()? I've found the documentation for the function, but it basically just says to call the numerical event ID. Does that mean that if say, I want to call event #8 in the .evt file, I'll simply go ipc.control(8)? I read up on the lua documentation but havent noticed information specific on how to call event IDs from evt files. Some help would be greatly appreciated, I should be able to figure the rest out from there, I've got some scripting experience in another - relatively specific - language for years, lua should be straightforward enough to pick up.

 

Link to comment
Share on other sites

13 hours ago, Psistorm said:

Does that mean that if say, I want to call event #8 in the .evt file, I'll simply go ipc.control(8)? I read up on the lua documentation but havent noticed information specific on how to call event IDs from evt files.

Thee control numbers for events in event files are determined as follows:
       control number = 32768 + (event file index)*256 + event index number
where event file index is the index number of the event file (in your FSUIPC7.ini, under [EventFiles]) and event index number is the idex number if the event in the event file.
So, the first event in the first event file will have a control number of 32768, the second event 32769, first event in the second file as 33024. etc

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.