Sound for all players?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Waylander76
Sergeant Major
Posts: 122
Joined: Wed Jun 01, 2005 10:03 am

Sound for all players?

Post by Waylander76 »

Hi all

How do I have an end of game message bradcast to all players in SH?
Something like 'Allies Win' or 'Axis Win' in CoD2?

It's for an OBJ map so if the objectives are destroyed or the allies kill all the axis the sound triggers or if the Axis kill all the allies or the times runs out it triggers saying 'Axis Win'.

I've tried the below with a $speaker playsound and it doesn't work and I've also put the aliases in an Ubersound.scr and still nothing.

local.master = spawn scriptMaster
local.master aliascache allies_win_snd sound/allies_win.wav soundparms 1.5 0.0 0.8 0.1 200 8000 auto loaded maps "dm obj"
local.master aliascache axis_win_snd sound/axis_win.wav soundparms 1.5 0.0 0.8 0.1 200 8000 auto loaded maps "dm obj"

What am I doing wrong?

Thanks in advance as always.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

post

Post by tltrude »

Please post the victory threads--where it says "$speaker playsound allies_win_snd" and "$speaker playsound axis_win_snd".
Tom Trude,

Image
Waylander76
Sergeant Major
Posts: 122
Joined: Wed Jun 01, 2005 10:03 am

Post by Waylander76 »

Here they are.
Just the standard OBJ victory threads with my line added.
I've moved it up and down and still no joy.

Code: Select all

//*** --------------------------------------------

allies_win_thread:
	while(level.targets_destroyed < level.targets_to_destroy)
		waitframe
	
	teamwin allies
wait 2
$allies_win_speaker playsound allies_win_snd

end

//*** --------------------------------------------
//*** "Axis Victory"
//*** --------------------------------------------

axis_win_timer:

	level waittill axiswin
wait 2
$axis_win_speaker playsound axis_win_snd

end

User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

wait

Post by tltrude »

Have you tried it this way?

Code: Select all

//*** -------------------------------------------- 

allies_win_thread: 
   while(level.targets_destroyed < level.targets_to_destroy) 
      waitframe 

$allies_win_speaker playsound allies_win_snd
wait 2 
 
teamwin allies

end 

//*** -------------------------------------------- 
//*** "Axis Victory" 
//*** -------------------------------------------- 

axis_win_timer: 

   level waittill axiswin

$axis_win_speaker playsound axis_win_snd 
wait 2

   teamwin axis

end 
I think the wait line should be below the sound line--to give it time to play before the game ends.
Last edited by tltrude on Wed Mar 01, 2006 7:56 pm, edited 1 time in total.
Tom Trude,

Image
Waylander76
Sergeant Major
Posts: 122
Joined: Wed Jun 01, 2005 10:03 am

Post by Waylander76 »

Thanks Tom that works :)

The problem I have now is that the sound is only played from 1 centrally located speaker in the map,so depending where you are on the map the sound is either too loud or bearly audible.

I've tried adjusting the soundparms and the channel but i'm not getting it
so that the sound is 'even' depending on where players are on the map.

Are there any specific settings for the soundparms I can use so the sound
is played 'normally' or is there another way to do it?

Can i just use the playsound command without using a $peaker or does
it not work like that?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

range

Post by tltrude »

The range of the sound is controled by these number.

alias m2l3_attack1 sound/dialogue/Generic/A/attack/dfr_attack_01k_2.wav soundparms 1.3 0.0 1.0 0.0 100 8000 dialog streamed subtitle "Open fire!" maps "m dm obj"

These two numbers mean the sound will be full volume for 100 units and fade away until 8000 units is reached, where it cuts off.
Tom Trude,

Image
Waylander76
Sergeant Major
Posts: 122
Joined: Wed Jun 01, 2005 10:03 am

Post by Waylander76 »

Thanks Tom...will try it when i get in from work and let you know how it goes.
Waylander76
Sergeant Major
Posts: 122
Joined: Wed Jun 01, 2005 10:03 am

Post by Waylander76 »

Tom, did'nt get a chance to post yesterday, but i tested it and it works :)

Thanks again for all the help! :D
Post Reply