Forum

Custom Sounds

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Custom Sounds

Postby Rikku2000 » Fri Mar 13, 2015 10:23 am

Here a small code i write to use custom sounds in Quake for.

sfx_generic.qc
Code: Select all
void() ambient_generic = {
   local float volume;

   precache_sound (self.noise1);

   if (self.sounds == 0)
      volume = 0;
   else if (self.sounds == 1)
      volume = 0.25;
   else if (self.sounds == 2)
      volume = 0.5;
   else if (self.sounds == 3)
      volume = 0.75;

   ambientsound (self.origin, self.noise1, volume, ATTN_STATIC);
};


quake.fgd add this code under: "@PointClass = ambient_thunder : "Thunder sound" []"
Code: Select all
@PointClass base(Targetname) = ambient_generic : "Generic sound" [
   noise1(string) : "Sound"
   sounds(choices) : "Volume" : 2 = [
      0: "None"
      1: "Low"
      2: "Mid"
      3: "High"
   ]
]


so you can add sounds by your own:
In WorldCraft or Hammer select enity: "ambient_generic"
Name: Can use for start Sound by a Trigger
Sound: Sound/XXX/mysound.wav
Volume: 0=0, 1=25, 2=50, 3=75
I am sorry for my English...
User avatar
Rikku2000
 
Posts: 49
Joined: Wed Oct 20, 2010 6:33 pm
Location: Germany

Return to QuakeC Programming

Who is online

Users browsing this forum: Dr. Shadowborg, Google [Bot] and 2 guests