Jump to content
The simFlight Network Forums

Sound lua


Recommended Posts

Trying to set up a lua to play a wav when a button is pressed.

Created a file in FSX Modules folder named BingoFuel.lua.  Contents of file:

Sound.play("BingoFuel",2)

 

The sound I'm attempting to play is BingoFuel.wav located in FSX Sound folder.

 

I'm using a registered copy of FSUIPC 4.937.  In the button section of FSUIPC I assigned a button to "lua Playbingofuel".  I'm not getting the wav to play.

 

In the Linda console I see an error message of:

 

[E] *** LUA Error: C:\FSX\Modules\playbingofuel.lua:1: attempt to index global 'Sound' (a nil value)

 

I know this is pretty basic stuff for most of you but I'm stuck.

 

Thanks in advance,

Jerry

Link to comment
Share on other sites

Pete, another question for you, if you will. This lua plays a sound on server pc when joystick button is pressed. Joystick is connected to server pc. Is it possible for the button press to play a sound on a client pc?

 

You'd need to have your Lua on the Client. If your button is on a device on the server, in the client Lua just act on the relevant button bit (offsets 03C0 - 03FF). Use event.offsetmask.

 

Pete

Link to comment
Share on other sites

Thanks for the response Pete and I apologize for wasting your time.  That was WAY over my head.  You put that in college level terms and I'm a 1st grader.

 

I read the LUA Library documentation but could not comprehend event.offsets and such.

 

I do appreciate your reply and thanks for the work you do with FSUIPC.  

 

Jerry 

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.