View unanswered posts | View active topics It is currently Thu Apr 25, 2024 8:39 am



Reply to topic  [ 8 posts ] 
 Lua to play a sound? 
Author Message

Joined: Sun May 18, 2008 5:47 am
Posts: 265
Reply with quote
Post 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?


Sat May 16, 2009 11:10 pm
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post Re: Lua to play a sound?
Not sure about one, but two:
Code:
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/bossfight.ogg", 0, -1);


Sat May 16, 2009 11:35 pm
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post 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.


Sat May 16, 2009 11:49 pm
Profile

Joined: Sun May 18, 2008 5:47 am
Posts: 265
Reply with quote
Post 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.


Sat May 16, 2009 11:54 pm
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post Re: Lua to play a sound?
If you play the sound the same way as music, it won't be affected by lag.


Sat May 16, 2009 11:56 pm
Profile WWW

Joined: Sun May 18, 2008 5:47 am
Posts: 265
Reply with quote
Post Re: Lua to play a sound?
Will playing the sound with PlayMusic stop the current song?


Sat May 16, 2009 11:58 pm
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post 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.


Sat May 16, 2009 11:59 pm
Profile WWW

Joined: Sun May 18, 2008 5:47 am
Posts: 265
Reply with quote
Post 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?


Sun May 17, 2009 12:17 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.129s | 15 Queries | GZIP : Off ]