target_speaker


(DarkViper) #1

Hi all again :slight_smile:

What im trying to do is, make a speaker, and allow people to turn it on or off with a button.

I got the idea how it can be turned on when someone walks into the room… but id like to try with a button instead.

Any ideas?

DarkViper :drink:


(S14Y3R) #2

Hey, I’d try a func_invisivle_user that toggles the speaker in the script. Set it up as targetname and scriptname as speaker_button, then in the script:

speaker_button
{
activate axis
{
togglespeaker your_speaker
}

activate allies
{
togglespeaker your_speaker
}
}

(codejockey13) #3

You should really use a sound script file and enable and disable the sound like what is done with a command post.

Go to this website and download the SpeakerButton.zip file. It will have all the components that you need for your button and speaker. If it doesn’t work correctly post a reply but I think I included everything needed in the zip.

http://webpages.charter.net/ettutorial


(DarkViper) #4

S14Y3R: Sorry i got lost with yours

codejockey13 : Ok ill try that, i have tried the map to see if it works… it worked fine… but i get Entitly leaked… but still builds the bsp… is that normal? :banghead:

DarkViper.


(S14Y3R) #5

D’oh!


(codejockey13) #6

not quite sure why you got the entity leaked error. mine compiled clean.


(DarkViper) #7

Ok i dont get the leaks now :slight_smile:

I have tried the button and stuff on my map, But the button does work, nor does the music… im thinking its what ever you used on that block of wood for the sound, doesnt show me what it was…

DarkViper :drink:


(DAbell) #8

Hey DarkViper

Have you had a look at the Level Designers Reference section about using the speaker editor to add speakers into your map.

Check it.

http://simland.planetquake.gamespy.com/ldr1_1/default.htm

Click on the Speaker Editor link on the side bar

Hope this helps you out.

<DJ>


(MrLego) #9

Try this forum post, there are a few solutions there.


(codejockey13) #10

make sure you have all the files. one item you’ll probably need to change for the speaker is the origin value in the sps file. I used the info_notnull to find the origin. get the origin from that and change the one in the sps file to fit what you need.

as far as the button goes it works fine in the prefab box. maybe you missed something when copying into your map. make sure you have the script set up correctly too.

other than that i would recommend like the others to look into some other forum posts.