Data Realms Fan Forums
http://45.55.195.193/

Lua to play a sound?
http://45.55.195.193/viewtopic.php?f=73&t=14696
Page 1 of 1

Author:  smithno13 [ Sat May 16, 2009 11:10 pm ]
Post subject:  Lua to play a sound?

How would I go about making Lua play a sound that is not affected by lag like gun sounds are, and stop the current music from playing?

Author:  mail2345 [ Sat May 16, 2009 11:35 pm ]
Post subject:  Re: Lua to play a sound?

Not sure about one, but two:
Code:
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/bossfight.ogg", 0, -1);

Author:  Grif [ Sat May 16, 2009 11:49 pm ]
Post subject:  Re: Lua to play a sound?

I dunno about not being affected by lag, since that's part of the sim time setup. But you can have a sound play automatically by creating an emitter that plays the sound. See the teleporter modules for an example.

Author:  smithno13 [ Sat May 16, 2009 11:54 pm ]
Post subject:  Re: Lua to play a sound?

Well I already have the sound playing as the firing sound with my gun, but it is part of a song and the lag (Atleast on my computer) ruins it.

Author:  TheLastBanana [ Sat May 16, 2009 11:56 pm ]
Post subject:  Re: Lua to play a sound?

If you play the sound the same way as music, it won't be affected by lag.

Author:  smithno13 [ Sat May 16, 2009 11:58 pm ]
Post subject:  Re: Lua to play a sound?

Will playing the sound with PlayMusic stop the current song?

Author:  TheLastBanana [ Sat May 16, 2009 11:59 pm ]
Post subject:  Re: Lua to play a sound?

I'm not sure. StopMusic stops the music, but whether this just adds another buffer or not I don't know.

Author:  smithno13 [ Sun May 17, 2009 12:17 am ]
Post subject:  Re: Lua to play a sound?

Hmm. I should probably learn lua before I try any of this :P
Yea, what do I need to put before that to make it play?
I do understand coding languages, and can read and understand Lua, but I dont know the specifics.
Do I need something like "for actor in MovableMan.Actors do" but for sound?

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/