thedutchguy Posted April 13, 2019 Report Share Posted April 13, 2019 Hi, I'm completely new to offsets and have no idea if this is even possible. But is there a way i can link the belt offset of the pmdg737 ngx to the belt offset of p3dv4? So if the pmdg offset changes from 1 to 3 the p3dv4 changes from 1 to 2? I need this functionality in order for the application Sim Sounds to recognize the belt signs in the NGX. I have talked to it's developer and he says simsounds monitors the offsets No smoking sign: FSUIPC 8 bit U: Offset 0x341C Seatbelt sign: FSUIPC 8 bit U: Offset 0x341D and i want those to be coupled to the pmdg 649E 1 BYTE COMM_NoSmokingSelector 0: OFF 1: AUTO 2: ON 649F 1 BYTE COMM_FastenBeltsSelector 0: OFF 1: AUTO 2: ON can this be done? And how? Link to comment Share on other sites More sharing options...
John Dowson Posted April 13, 2019 Report Share Posted April 13, 2019 Hi, it should be relatively straightforward to do this with a short Lua program. Check the lua documents and examples in your FSUIPC Documents folder. Basically you want to write a function that monitors the pmdg offsets (using event.offset) and in your function you can update the P3D offsets. Good luck! Cheers, John Link to comment Share on other sites More sharing options...
thedutchguy Posted April 14, 2019 Author Report Share Posted April 14, 2019 (edited) ok, i'm trying this now. but i'm stuck. i found the below piece of code on the forums and im just trying to get it to play the sound when i flick the switch. But it doesn´t do anything. i 'm purpusly just playing a sound because i want to build the code for checking the value first before adding the "changing the offset" part. function belts(offset,value) if value==2 then sound.play(""C:\\\\Applause.wav"") end end event.offset(0x649F, "UB", "belts") any idea?!? Edited April 14, 2019 by thedutchguy Link to comment Share on other sites More sharing options...
John Dowson Posted April 14, 2019 Report Share Posted April 14, 2019 Is your lua script activated? You need to add it to the '[Auto]' section in your ini file, or program to activate on something. Please check the documentation. Cheers, John Link to comment Share on other sites More sharing options...
thedutchguy Posted April 14, 2019 Author Report Share Posted April 14, 2019 (edited) yes it is. and i checked the fsuipc log while running the sim,. no entry of the function so it's not running for some reason. Edited April 14, 2019 by thedutchguy Link to comment Share on other sites More sharing options...
Pete Dowson Posted April 14, 2019 Report Share Posted April 14, 2019 24 minutes ago, thedutchguy said: yes it is. and i checked the fsuipc log while running the sim,. no entry of the function so it's not running for some reason. You used Lua logging to check this? Or did you add an ipc.log line in the function? Did you enable the 737NGX offset data by editing the 737NGX_Options.ini file, as described at the beginning of the PMDG offsets list provided? Also check that this parameter in the FSUIPC5.INI file: PMDG737offsets is set to 'Yes', or 'Auto'. not 'No'. If both are ok, add the offset to the Monitor (right-hand side of the FSUIPC Logging tab), to check if the offset value is changing. Pete Link to comment Share on other sites More sharing options...
thedutchguy Posted April 15, 2019 Author Report Share Posted April 15, 2019 I used Lua Logging to check it. I temporarily enabled the lua script dynamic friction to check functionality of the logger. I see that lua script running as expected. I just don't see the belt scipt running. 737NGX_options.ini is edited (was already done because i use fs2crew and it needs the enable broadcast enabled) PMDG737offsets is in the fsuipc.ini file and set to Auto Added the offset 649F to the monitor and enabled onscreen display to check it. Value changes as expected from 0 to 1 to 2 and vice versa. Link to comment Share on other sites More sharing options...
John Dowson Posted April 15, 2019 Report Share Posted April 15, 2019 Could you post you log and ini files please. Link to comment Share on other sites More sharing options...
thedutchguy Posted April 15, 2019 Author Report Share Posted April 15, 2019 as requested. 408489 Monitor IPC:649F (U8) = 1 onwards in the log is me flicking the switch in the ngx FSUIPC5.ini FSUIPC5.log Link to comment Share on other sites More sharing options...
John Dowson Posted April 16, 2019 Report Share Posted April 16, 2019 Your [Auto] entry should be 1=Lua Belts John Link to comment Share on other sites More sharing options...
thedutchguy Posted April 16, 2019 Author Report Share Posted April 16, 2019 excellent. That was the problem. And i have edited the code so it´s now working like a charm! thanks for the help guys! in case anyone´s looking for the code for this function Belts(offset,value) if value == 2 then ipc.writeUW(0x341D,1) end if value == 0 then ipc.writeUW(0x341D,0) end end event.offset(0x649F,"UB","Belts") Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now