Global sound, once.


(Yatta) #1

Heeey again.

I need an alert sound (using world/alarm_01.wav) to be played global / broadcast on certain events.

Problem :

  • apparently, using a target_speaker is not possible for that since ET code has broken the GLOBAL flag
  • using soundeditor speakers, i fail : the best I got is the alert sound play once, except it did not play from start - it behaves as a constant playing sound thats just temporarily unmuted by my script.

So, the question is very simple : what should i write in my script to make it sound just once ? What params on the speaker in the soundeditor ?

things i tried :


//trying to make it play once, quite like alertentity
togglespeaker spk

//trying to turn it on, play it, wait the length of sound, turn it off
enablespeaker spk
togglespeaker spk
wait 2000
disablespeaker spk

//trying to toggle on/off
togglespeaker spk
wait 2000
togglespeaker spk

I think this should be something like this, but for some reason no combination seems to work.
; _ ;


(ailmanki) #2

I know the map MML Church has an alarm, I am not really aware how global that sound is… but it does work.(mml_church_et_v1.pk3). I suppose that is controlled by the range…

the sps for the speaker:

	speakerDef {
		noise "sound/world/alarm_01.wav"
		origin -2927.93 -73.75 -16.94
		targetname "global_speaker_alarm"
		looped "no"
		broadcast "global"
		volume 127
		range 1250
	}

It is only toggled once in script, there is no disabling of it by the script, whenever the alarm should get off.

togglespeaker global_speaker_alarm

(Yatta) #3

I dont get it, i do exactly the same thing, but it does not work …

Bah, ill give up on those sounds for this version.


(Yatta) #4

Following your advice, I decided to try to play the sound with a great range instead of global :

broadcast “no”
range “40000”

It just played the sound in constant loops. So i put back to “global”, but letting the huge range. And now works … o_o. I suppose “global” is really broken or I misunderstand what it stands for.

Thanks Alimanki !