Page 1 of 2

playing sounds in pak3 (yeah its a noob question)

Posted: Sat Mar 20, 2004 4:05 pm
by M&M
i did a small search (i could have done a better one) but i couldnt find the answer ,how do i play a sound i want from the pak3 via script?

the name of the sound is m6l3a_slidingdoors_close.wav and its in pak3.pk3\sound\mechanics

do i type playsound pak3.pk3\sound\mechanics ?

Posted: Sat Mar 20, 2004 5:27 pm
by bdbodger
usually you play sounds by the alias

aliascache door_vault_roll_open sound/mechanics/m6l3a_SlidingDoors_Open.wav soundparms 1.0 0.0 1.0 0.0 160 1600 item loaded maps "m6l3a m6l3b m6l3c m6l3d m6l3e "

but this sound will only play in maps who's name starts with m6l3a or m6l3b or m6l3c or m6l3d or m6l3e

but if you use the script master soundfix you can use it in your map like this

local.master = spawn scriptmaster

local.master aliascache door_vault_roll_open sound/mechanics/m6l3a_SlidingDoors_Open.wav soundparms 1.0 0.0 1.0 0.0 160 1600 item loaded maps "my_mapname_here dm obj "

then you do in your map

$mything playsound door_vault_roll_open

Posted: Sat Mar 20, 2004 9:32 pm
by M&M
darn,more scripting .
well i have 2 understand what im typing here so can u plz tell me and expand my v.small scripting knowledge

Code: Select all

local.master = spawn scriptmaster 

local.master aliascache door_vault_roll_open sound/mechanics/m6l3a_SlidingDoors_Open.wav soundparms 1.0 0.0 1.0 0.0 160 1600 item loaded maps "my_mapname_here dm obj "
so where exactly do i type this?the .scr file?

and what exactly did i type :D ? does it mean that i want door_ vault_roll_open 2 play this soundm6l3a_SlidingDoors_Open.wav when i type playsound?
and if i change door_ vault_roll_open 2 freaking_cool_sound in the code above as an example would i have 2 type playsound freaking_cool_sound ?
and what about that stuff after soundparms??and my map name ,do i just type map name or map name dm ??

tnx 4 ur reply :wink:

Posted: Sat Mar 20, 2004 9:40 pm
by jv_map
M&M, maybe read the 'new ubersound' sticky on top of this page, and/or the adding custom sounds tutorial... it should explain pretty much any questions you could have 8-)

Posted: Sat Mar 20, 2004 10:34 pm
by M&M
odd!!!i remember replying 2 this post 5 mins ago saying ill check them out :?
anyways im still unclear about a few things ,2 be exact i dont understand what these are [basevolume] [randvolume] [basepitch] [randpitch].i understood the rest of the tut thought :wink:

Posted: Sat Mar 20, 2004 11:09 pm
by Splaetos
you shouldnt use the plain blue coloring on a black background =p

the base numbers are the BASE settings for the effect. If you change basevolume from 2 to 4 the sound is louder, etc etc.

as for randvolume and pitch, I could only guess based on what it sounds like it is...

this blue is hard to read
but other shades are quite nice =)

Posted: Sun Mar 21, 2004 7:59 am
by jv_map
In my experience basevol and randvol don't really work :? so you can type whatever fancy numbers you want there :)

Basepitch does work however, you can use it to transpose your sound up or down (make it sound 'higher' or 'lower'). 1.0 leaves the sound unchanged... randpitch adds a random deviation to basepitch, so that each time the sound is played it sounds a little different :)

Posted: Sun Mar 21, 2004 9:08 am
by bdbodger
I used this in a map playsound explode_tank 2 "levelwide" and it seems to work meaning you can change the volume of the sound from script . The 2 is the volume or twice normal volume and it plays levelwide .

basevol

Posted: Sun Mar 21, 2004 3:25 pm
by tltrude
// UBER SOUND FILE
// Current Format:
// aliascache (?alias?) snd wavfile soundparms basevol volmod basepitch pitchmod minDist maxDist channel loaded|streamed maps "mapstr1 mapstring2 mapstring3 ..."
//
// MIN DIST AND MAX DIST
// sound has linear falloff from minDist to maxDist. Within minDist sound is at normal volume.

------------------------------------------------------------------------
local.master aliascache freaking_cool_sound sound/mechanics/m6l3a_SlidingDoors_Open.wav soundparms 1.0 0.0 1.0 0.0 160 1600 item loaded maps "e t m dm lib moh obj test "
------------------------------------------------------------------------

Base volume has always worked for me, although it does make a differance which channel you use. Using "1.0" for it means the volume within the minimum distance (160 units) will be the same as if you played the wav sound at full volume in Windows Media Player. The sound fades as you leave the minimum distance and move toward the maximum distance (1600 units) where it cuts off completly.

THANKS ALOT ALL

Posted: Sun Mar 21, 2004 5:48 pm
by M&M
wow!!! thanks guys ,i never expected such a wide response :D ,i now have a better understanding of scripting sound :wink:

oh an splaetos i just chose a random colour from the font colour window and clicked it however i can c the colour blue fine,perhaps ur screen is 2 dark :P and the background isnt black its dark green btw :wink: so try brightning up ur monitor

edit:just wanna be sure of something here ,in the tut i should write after
loaded maps my map name in quotes right?
then y did tltrude put "e t m dm lib moh obj test "
(what the hell is e t m?).do i type all game modes or my map name or what exactly?

Posted: Sun Mar 21, 2004 10:02 pm
by jv_map
If your map is in the plain maps folder, use your full map name. If it is in a subfolder (dm or obj), then use 'obj' or 'dm' (or 'obj dm') after the 'maps' keyword.

Posted: Mon Mar 22, 2004 11:29 pm
by M&M
aha ,i c .tnx alot guys i guess this topic is solved

e t m

Posted: Tue Mar 23, 2004 7:05 am
by tltrude
All that "e t m lib" stuff is for Spearhead and Breakthrough, so is not really needed. I was just thinking of what would work for every game type and game, but the local.master work around does not work for Spearhead and Breakthrough anyway.

Posted: Tue Mar 23, 2004 3:19 pm
by M&M
lol :lol: .tnx alot anyways tltrude .i understand how 2 add sounds now :wink:

Posted: Wed Mar 24, 2004 5:58 am
by agentmad007
damn after a long reading about the sound i got my answer

the local master script dont work for moh breakthrough !!!!!!!!

grrrrrrrrrr

i got a trigger use with a setthread how do i go to put several sounds one after one ...........without local master

Ty

Btw: if igot to make a tik file plz explain coze i dont understand those stuffffff