Easiest way to trigger a sound that can be heard by all?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
sysQuik
Corporal
Posts: 25
Joined: Fri Feb 07, 2003 9:54 am

Easiest way to trigger a sound that can be heard by all?

Post by sysQuik »

What would be the easiest way to trigger a sound from script that is heard by everyone in the map, regardless of where they are located? I looked in tow_dm.scr as I think the final countdown of the bomb is heard by everyone, but I didn't understand what made it heard by everyone. Do I need to get into tikis or ubersound? I found a lot of great info here in the forum, but I'm not sure which approach to use or how to make it heard by all.

Thanks for your help!
Sysquik
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Sound

Post by tltrude »

Is it a custom sound, or one that is in the game already? Also, is it a wav or mp3?
Tom Trude,

Image
sysQuik
Corporal
Posts: 25
Joined: Fri Feb 07, 2003 9:54 am

Post by sysQuik »

In game sound, wav file. Not exactly sure which one yet. Thanks for the speedy reply! I really appreciate it.

Sysquik
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Make it play on the local channel (you can define a channel in the alias definition) or add "levelwide" after the playsound command.

Example:
level.alarm_sound loopsound alarmbell local.vol "levelwide"

(don't know if it works with playsound as well)
Image
sysQuik
Corporal
Posts: 25
Joined: Fri Feb 07, 2003 9:54 am

Solution! Script contained

Post by sysQuik »

Thanks for your response jv_map. Here's the script:

Code: Select all

main:

	exec global/ambient.scr
	
	level waittill prespawn
	
	  local.master = spawn ScriptMaster
	  local.master aliascache snd_river sound/amb/Amb_RainWindow_01.wav soundparms 1.0 0.2 1.0 0.2 10000 2000 auto loaded maps "obj dm"
	
	level waittill spawn
		
	thread sound
end

sound:
                    while (1)
	{	
		$sound_trigger waittill trigger
		$river_sound loopsound snd_river
		iprintln "Sound Triggered"
	}
end
Thanks to your excellent tut, I have the problem solved. I just set the min value to 10000 which should be larger than my map. What if I did just want to edit the ubersound.scr, how would I make MOHAA use the ubersound.scr in my pak file instead of the standard one in MOHAA?

Thanks again for all your help!

SySquik :P
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Re: Solution! Script contained

Post by jv_map »

sysQuik wrote:What if I did just want to edit the ubersound.scr, how would I make MOHAA use the ubersound.scr in my pak file instead of the standard one in MOHAA?
Simply make sure the filename of your pak has a later order in the alphabet than the stock paks. For instance prefix a 'z' (or more :P).

Like: zzzysquick.pk3 8-) (though sysquick.pk3 would work too)
Image
sysQuik
Corporal
Posts: 25
Joined: Fri Feb 07, 2003 9:54 am

Post by sysQuik »

Excellent! Thanks for the info. Sounds like a pak turf war for zzzzzzzz9999.pk3. :?

Sysquik
Post Reply