View unanswered posts | View active topics It is currently Fri Dec 27, 2024 11:00 pm



Reply to topic  [ 10 posts ] 
 What is the best way to play a sound through Lua? 
Author Message

Joined: Sat Jan 13, 2007 11:04 pm
Posts: 2932
Reply with quote
Post What is the best way to play a sound through Lua?
I need to play a sound at a certain moment that is managed by a Lua script, but I dont know what is the best and hassle free method to do so.

I've heard that a direct command for playing a sound is broken having to spawn an emitter to play a sound is just gay.


Wed Sep 09, 2009 8:04 am
Profile
User avatar

Joined: Mon Jun 30, 2008 9:13 pm
Posts: 499
Location: Finland
Reply with quote
Post Re: What is the best way to play a sound through Lua?
I'd say spawning the emitter is easiest and least hassle-free. Nothing gay about it.


Wed Sep 09, 2009 2:30 pm
Profile
User avatar

Joined: Thu Feb 12, 2009 1:47 am
Posts: 1182
Reply with quote
Post Re: What is the best way to play a sound through Lua?
Gay isn't an insult, or any kind of negative term. Stop using it as such. That's no way for a developer to speak.


Wed Sep 09, 2009 11:51 pm
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post Re: What is the best way to play a sound through Lua?
this isnt a perfect world, however right you may be.

nummy, just use an aemitter, lua is currently all about lazy hacks, making sounds is no different (sadly)


Wed Sep 09, 2009 11:54 pm
Profile WWW

Joined: Sat Jan 13, 2007 11:04 pm
Posts: 2932
Reply with quote
Post Re: What is the best way to play a sound through Lua?
I still think it sucks, a simple statement like "PlaySound = "Filepath", but ah well. I used the emitter for some extra features to spew some particles to enhance the effect.

Btw, I´m a developer and I am cool. :cool:


Thu Sep 10, 2009 8:31 am
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post Re: What is the best way to play a sound through Lua?
as such you should ask data to give you a working playsound function as the current one fails.


Thu Sep 10, 2009 8:36 am
Profile WWW

Joined: Sat Jan 13, 2007 11:04 pm
Posts: 2932
Reply with quote
Post Re: What is the best way to play a sound through Lua?
Geti wrote:
as such you should ask data to give you a working playsound function as the current one fails.


Oh but I have already. 2 Fast 2 Furious 4 u.
No idea if he has fixed it yet, but its in his list afaik.


Thu Sep 10, 2009 10:57 am
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: What is the best way to play a sound through Lua?
More like TLB has because he's the one who reports all the lua errors (and doesn't try to lord his status as a developer over the community somehow)


Thu Sep 10, 2009 2:47 pm
Profile
User avatar

Joined: Mon Oct 06, 2008 2:04 am
Posts: 1559
Reply with quote
Post Re: What is the best way to play a sound through Lua?
Sidestepping numgun's retarded comment:
The two best ways right now do play a sound through Lua are as follows:
1) Spawn an Emitter.
2) Spawn an invisible, instantly dying actor whose death sound is the desired sound file.

The biggest problem with sounds right now isn't how to make them play, but how they are affected by lag unlike music.
Only two ways to sidestep those problems I've found is to either use Lua to set ctrl+o when the sound plays and disable it when the sound ends, or to individually raise the pitch of each sound file so that when lag slows it down it sounds somewhat normal.

The former method is used in CTF Facing Worlds thanks to mail2345, the latter method I use with the Nurses. You can check each out to compare the execution.


Sun Sep 13, 2009 6:53 am
Profile
User avatar

Joined: Fri Mar 13, 2009 2:31 am
Posts: 217
Location: Earth... I think
Reply with quote
Post Re: What is the best way to play a sound through Lua?
LowestFormOfWit wrote:
Sidestepping numgun's retarded comment:
The two best ways right now do play a sound through Lua are as follows:
1) Spawn an Emitter.
2) Spawn an invisible, instantly dying actor whose death sound is the desired sound file.


The Emitter lags less I think. The Actor is good for a short sound like a beep but for a long sound loop like a steam exhaust or engine noise is best left for the AEmitter.
(this is my personal opinion founded from experience)


Tue Sep 15, 2009 3:11 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 10 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.034s | 14 Queries | GZIP : Off ]