Page 1 of 1

Custom sounds in SinglePlayer ?

Posted: Tue Jun 26, 2007 7:12 pm
by mcunha98
In multiplayer maps when i can play a sound i put a script -> object and give to it the targetname.

But, in singleplayer this technique dont work :oops:
How i do ?

Code: Select all

InitSounds:
	local.master = spawn ScriptMaster
	local.master aliascache radio_snd sound/mechanics/Mec_RadioLoop_04.wav soundparms 0.5 0.0 1.0 0.0 256 256 auto loaded maps "dm moh obj train"
	local.master aliascache phone_snd sound/mechanics/Mec_PhoneRing_01.wav soundparms 0.5 0.0 1.0 0.0 256 256 auto loaded maps "dm moh obj train"
end

Code: Select all

PlaySounds:
	wait 1
	$radio_sound1 loopsound radio_snd
	$phone_sound1 loopsound phone_snd
end

Posted: Tue Jun 26, 2007 11:18 pm
by tltrude
maps "dm moh obj train"

You need to put your map's name in the list.

local.master aliascache radio_snd sound/mechanics/Mec_RadioLoop_04.wav soundparms 0.5 0.0 1.0 0.0 256 256 auto loaded maps "dm moh obj train my_map"

Posted: Wed Jun 27, 2007 12:13 am
by jv_map
Or just

maps getcvar(mapname)

:)

(will work in sp and mp, and also if you rename the map)

Posted: Wed Jun 27, 2007 2:04 pm
by mcunha98
Works fine, thanks !