play sound after caputered object


(Zer0Cool) #1

Hi,

I want to play a specific *.wav after the object is captured.
I added in the trigger_captured-scriptpart this:

	trigger captured					
	{
	
	setstate target2 invisible	// the trigger_objective_info			
					
	wait 2000				
	
	togglespeaker soundtest // name of my target_speaker

	}

I added a target_speaker with the targetname “soundtest” with the speakereditor ingame, but it doesnt matter what settings i do it does not work like i want to.

what are the correct settings to have a speaker which plays a specific sound for one time, after it got triggered ?

  1. Can i trigger a func_explosive by script? if yes, how?

Zer0


(S14Y3R) #2

For 1, set up your “toggleable” speaker like this:

For your func_explosive, you can play a specific sound with the noise key.

…with health set to 0 it can’t be shot. In your script there’s two ways to kill it.

1- alertentity func_explosive //this will play its “noise” key upon death
//it will also crash if called twice! eg, crashes to main menu with “targetname func_explosive not found” , but if you’re only calling it once that should work.

2- kill func_explosive -the kill command will repeat without crashing to main menu, but the noise key doesn’t get played. If the speaker has nothing to do with your func_explosive ignore the noise key altogether :stuck_out_tongue:

gl.


(Zer0Cool) #3

The func_explosive works fine but when i use the settings for the speaker i cant use range and volume but i need it.


(S14Y3R) #4

Hm, have a look in your etmain/sound/maps/yourbsp.sps

That is what the ingame speaker edits/creates, so if you can’t do it ingame just edit it manually :slight_smile:

use ctrl+f to find your targetname of your speaker.

This’s what your speaker will look like with the range/volume added


speakerDef {
		noise "sound/chat/axis/42b.wav"
		origin -3748.84 3488.61 1639.87
		targetname "spk_one"
		looped "no"
		broadcast "no"
		volume 127
		range 1250
	}

-does your .sps file have range/vol already?
-is the box there for range/vol ingame?


(Zer0Cool) #5

… of course i can set it ingame and also in the sps-file but it doesnt influence the sound in anyway! it still keeps the same volume and the same distance, Thats what i wanted to say. :frowning: