Post your scripting questions / solutions here
Moderator: Moderators
agentmad007
Brigadier General
Posts: 570 Joined: Tue Feb 24, 2004 3:52 pm
Post
by agentmad007 » Thu May 13, 2004 4:38 pm
hi ,
here is some part of my script
Code: Select all
.................................
bla bla bla
main:
////////////////////////sound////////////////////////////
local.master = spawn ScriptMaster
local.master aliascache ring sound/amb/ring.wav soundparms 2.0 0.0 1.0 0.0 200 4000 auto loaded maps "m dm obj"
local.master aliascache open sound/amb/open.wav soundparms 2.0 0.0 1.0 0.0 200 4000 auto loaded maps "m dm obj"
local.master aliascache kawoosh sound/amb/kawoosh.wav soundparms 2.0 0.0 1.0 0.0 200 4000 auto loaded maps "m dm obj"
level waittill prespawn
bla bla
$speaker1 playsound open
$speaker2 playsound open
the command playsound work fine i hear my sound but.....
Code: Select all
$speaker1 loopsound open
$speaker2 loopsound open
dont work why ?
my sound isn't long enough so i had to looped it
thx
blue60007
General
Posts: 1247 Joined: Sun Mar 07, 2004 11:44 pm
Post
by blue60007 » Thu May 13, 2004 4:41 pm
That should work.
Try re typing it, maybe there are some extra spaces or line breaks...
agentmad007
Brigadier General
Posts: 570 Joined: Tue Feb 24, 2004 3:52 pm
Post
by agentmad007 » Thu May 13, 2004 4:47 pm
hehe nono i m not blind this is very strange!
that loopsound command dont want to work !.....i dont want to edit the .wav with a music tool , damn ........but if its the only solution
jv_map
Site Admin
Posts: 6521 Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:
Post
by jv_map » Thu May 13, 2004 5:16 pm
Hmm never heard of this problem before...
Are you absolutely sure you can't hear the sound? Do you get any errors in the console? What kind of entities (classname) are $speaker1 and $speaker2?
Try changing the channel the sound plays on, like 'item' instead of auto.
agentmad007
Brigadier General
Posts: 570 Joined: Tue Feb 24, 2004 3:52 pm
Post
by agentmad007 » Thu May 13, 2004 5:25 pm
yes i m totally sure
in game i change the script command playsound to loopsound
playsound worked but loopsound dont want
thats the only thing i changed
my speakers are script_origin then i ll try item...........
thx.
agentmad007
Brigadier General
Posts: 570 Joined: Tue Feb 24, 2004 3:52 pm
Post
by agentmad007 » Thu May 13, 2004 5:34 pm
same dont work ........is there any rapport with the sound's quality?
i mean the bitrates .....do i have to convert the .wav to lowest quality ?
actually is 88 kbps
tltrude
Chuck Norris
Posts: 4774 Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:
Post
by tltrude » Thu May 13, 2004 5:36 pm
You sould not use "open" as the name because it is a script command word. Change it to "open_snd" or something like that.
level waittill spawn
thread start_sounds
end
//================
start_sounds:
wait 1 // sometimes a little wait is required
$speaker1 loopsound open_snd
$speaker2 loopsound open_snd
end
Tom Trude,
agentmad007
Brigadier General
Posts: 570 Joined: Tue Feb 24, 2004 3:52 pm
Post
by agentmad007 » Thu May 13, 2004 7:00 pm
Code: Select all
main:
////////////////////////sound////////////////////////////
local.master = spawn ScriptMaster
local.master aliascache open_gate sound/amb/oepn.wav soundparms 2.0 0.0 1.0 0.0 200 4000 auto loaded maps "m dm obj"
bla bla bla
wait 0.1====> added a key wait (tried even without )
$speaker1 loopsound open_gate====> changed open by open_gate
$speaker2 loopsound open_gate
dont work
blue60007
General
Posts: 1247 Joined: Sun Mar 07, 2004 11:44 pm
Post
by blue60007 » Thu May 13, 2004 9:49 pm
Hmm...
Try using a script_model with these key/values:
model/ fx/dummy.tik
targetname speaker1
Although any entity can be a speaker, try that...
tltrude
Chuck Norris
Posts: 4774 Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:
Post
by tltrude » Fri May 14, 2004 3:32 am
I got the wave file from him and tried it with a script_origin. Wouldn't work for me either. Changing it to a script_model fixed it, but still doesn't explain why loopsound fails with a script_origin. It might be something to do with it being an 8 bit wave file, not sure.
Tom Trude,
blue60007
General
Posts: 1247 Joined: Sun Mar 07, 2004 11:44 pm
Post
by blue60007 » Sat May 15, 2004 3:48 am
I guess script_origin's can only play certain formats, while script_models can play all?
tltrude
Chuck Norris
Posts: 4774 Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:
Post
by tltrude » Sat May 15, 2004 4:27 am
I have used script_origins to loop sound before with no problems. All of the stock wave files in the game are 16bit format.
Tom Trude,
blue60007
General
Posts: 1247 Joined: Sun Mar 07, 2004 11:44 pm
Post
by blue60007 » Sat May 15, 2004 5:01 am
Then I guess script_origins only support 16bit audio.
agentmad007
Brigadier General
Posts: 570 Joined: Tue Feb 24, 2004 3:52 pm
Post
by agentmad007 » Sat May 15, 2004 2:07 pm
yes think same .......a script_origin can read some kind of format
my .wav was a 8 bit and only playable via script_model fx/dummy.tik