Author Topic: Edit sound in ttt_radio  (Read 3796 times)

0 Members and 2 Guests are viewing this topic.

Offline Vendaar

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Edit sound in ttt_radio
« on: January 20, 2014, 03:49:46 PM »
Hello,
I tried to edit the sounds of the traitors radio. I wanted to change the sound of the c4 beep button. So i opened gamemodes\terrortown\entities\entities\ttt_radio\shared.lua

This is my code on the "beeps" line

Code: [Select]
   beeps = {
      sound = { Sound("sound/sturm.wav") },
      delay = 0.75,
      times = {8, 16},
      ampl = 70
   }
};

I copied the soundfile to "steamapps/garrysmod/garrysmod\sound" and of course i added the sound to FastDownload and I can play it via playsound ulx command, but when I press the C4 Button on the Traitor-radio, nothing happens.

What do I have to do? Tried different delays and times but nothing helped so far.

Thanks for any advice


Regards


EDIT: Also tried .mp3 Format
« Last Edit: January 20, 2014, 03:55:37 PM by Vendaar »

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Edit sound in ttt_radio
« Reply #1 on: January 20, 2014, 05:14:39 PM »
The Sound() function already includes the sound/ directory.
Try Sound("sturm.wav")
bw81@ulysses-forums ~ % whoami
Homepage

Offline Vendaar

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: Edit sound in ttt_radio
« Reply #2 on: January 21, 2014, 12:07:42 AM »
+karma
Thank you very much!

And can somebody tell me what exactly "times= {9,17}; defines? Can I delete this line? I just want the sound to be played once per click. Its about 90 Seconds long

Thank you

Regards
« Last Edit: January 21, 2014, 12:13:51 AM by Vendaar »

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Edit sound in ttt_radio
« Reply #3 on: January 21, 2014, 05:39:55 AM »
+karma
Thank you very much!

And can somebody tell me what exactly "times= {9,17}; defines? Can I delete this line? I just want the sound to be played once per click. Its about 90 Seconds long

Thank you

Regards
Hmmm...
I'd have to dig around TTT's code to see what that does.
Try removing it and post any Lua errors you get.
bw81@ulysses-forums ~ % whoami
Homepage

Offline Vendaar

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: Edit sound in ttt_radio
« Reply #4 on: January 22, 2014, 02:58:16 AM »
Thank you. I got an error when I deleted it, because the c4-beep sound was meant to be played repeatedly.
So I just replaced the explosion-soundfile (will just play one sound per click, like the "scream"-sounds) with mine and it worked fine :)

One last question:
Does anybody know how I can "stick" the sound to the radio? When someone moves the radio (doesnt matter what sound it plays) the sound stays in place where the radio was, when the sound started playing. You can't roam around with the music playing.
The sound of the radio on several ttt_67way maps will synchronize with the radios location and I would like to know how to add this feature to the Traitor Radio.

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given