Closer to getting the gurgle sound right. We also have a gurgle sound now :D
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 2 Sep 2010 17:27:58 +0000 (20:27 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 2 Sep 2010 17:27:58 +0000 (20:27 +0300)
Yes, I'm using a hard coded audio file length for looping. What can I do?

data/qcsrc/server/vore.qc
data/sound/player/gurgle.ogg [new file with mode: 0644]

index 4366fd10f621d46e0729569fa1fb53948c0ce527..2d6bcc8cabbb92141693437dcf50a9975a1dbe18 100644 (file)
@@ -214,21 +214,27 @@ void Vore_StomachKick()
        }\r
 }\r
 \r
-.float gurglesound_finished;\r
+.float gurglesound_finished, gurglesound_oldstomachload;\r
 void Vore_Gurglesound()\r
 {\r
-       if(time > self.gurglesound_finished)\r
+       if(time > self.gurglesound_finished || self.gurglesound_oldstomachload != self.stomach_load)\r
        {\r
                local float vol;\r
                vol = VOL_BASE * self.stomach_load / cvar("g_balance_vore_swallow_limit");\r
 \r
-               sound (self, CHAN_WEAPON2, "weapons/stomachkick.ogg", vol, ATTN_NORM);\r
-               self.gurglesound_finished = time + 1;\r
+               precache_sound("player/gurgle.ogg");\r
+               if(self.stomach_load)\r
+                       sound (self, CHAN_TRIGGER, "player/gurgle.ogg", vol, ATTN_NORM);\r
+               else\r
+                       stopsound(self, CHAN_TRIGGER);\r
+\r
+               self.gurglesound_finished = time + 11; // yes, hard coded sound length. I know it's bad but what can I do?\r
+               self.gurglesound_oldstomachload = self.stomach_load;\r
        }\r
 }\r
 \r
 void Vore()\r
-{Vore_Gurglesound();\r
+{\r
        // skip the vore system under some circumstances\r
        if(time < game_starttime)\r
        {\r
@@ -301,6 +307,8 @@ void Vore()
                }\r
        }\r
 \r
+       Vore_Gurglesound();\r
+\r
 // --------------------------------\r
 // Code that addresses the prey:\r
 // --------------------------------\r
diff --git a/data/sound/player/gurgle.ogg b/data/sound/player/gurgle.ogg
new file mode 100644 (file)
index 0000000..e1ee710
Binary files /dev/null and b/data/sound/player/gurgle.ogg differ