2 sounds I want played by pushing a button

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
sHaRp_ShOoTa
Private
Posts: 3
Joined: Tue Apr 22, 2003 12:08 am

2 sounds I want played by pushing a button

Post by sHaRp_ShOoTa »

Hi all.. I've asked in many forums but one guy over at AlliedAssualt.com told me to come here... Ok first off.. You guys remember in SP in MOHAA at Vershnelt, You could play the Piano.. I want to make the Piano in my map play songs.. And also I want to be able to make switches play music on speakers when pushed.... Thanks
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Three contra-questions :):
  • Is this for a sp or mp map?
  • Do you have the (custom) sound file for the song?
  • Is this for mohaa or spearhead?
Image
sHaRp_ShOoTa
Private
Posts: 3
Joined: Tue Apr 22, 2003 12:08 am

Post by sHaRp_ShOoTa »

Thanks for the reply.. Sorry I should of provided more info but I was gonna see if somone replyed first... Ok I'm making it for Spearhead with SDK.. I have some experience with Radiant and can follow the tuts.. Ok I wanted this for a MP map.. Like a custom clan training, or a bootcamp I want a switch to be in the leaders room, so that when he wants he can use different bugle calls.. Like one that means line up or wake up or go to the chow hall.. It would be really cool.. I want the switch to play a bugle wav outside on a speaker mounted on a pole.. I have all the wavs for all the stuff I want.. And for the Piano I could use the song from the SP mission or I could find another.. But thats the basic idea all of this in the bootcamp..
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Alright. To use your new sound files you'll have to make so-called 'aliases' for them. You can make these in plain text file. Add lines like the following:
alias dfr_T1L1_BS6001 sound/dialogue/Mission_1/Allies/dfr_T1L1_BS6001td25.mp3 soundparms 0.8 0.0 1.0 0.0 160 1600 dialog loaded subtitle "Say hello to France boys." maps "obj dm"

In this case, dfr_T1L1_BS6001 is the alias you can use in your script, followed by the sound file name, some sound parms which control pitch and volume, a channel (dialog, channel #8 - high priority), you must use 'loaded' if the sound file is in a pk3, after 'subtitle' you can set a subtitle to appear when the sound is played and maps 'obj dm' tells the game to load this sound for any objective and deathmatch map.

Then for the speakers I think it's best to use a script_model with key 'model' / value 'fx/dummy.tik'. Give it targetname 'speaker' or something.

Now when you want to play the sound, in your script type:

Code: Select all

$speaker playsound <alias>
e.g.

Code: Select all

$speaker playsound dfr_T1L1_BS6001
'dfr' indentifies this sound as a 'friendly' sound, not sure if it would make a difference though.
Image
Post Reply