The game you are trying to view has ceased development and consequently been archived. If you are a member of this game, can demonstrate that it is being actively developed and will be able to keep this profile up to date with the latest news, images, videos and downloads, please contact us with all details and we will consider its re-activation.

An adaptation of Dead Space for psp completely new story line. using a heavily modified quake engine if you have nothing good to say don't say it at all

Report RSS Adding Multiple Sounds to a monster

I know this is a noob tutorial but so what im helping noobs like me :P

Posted by on - Basic Client Side Coding

Okay start off my opening the hknight.qc

scroll down to this

// set missile speed<br />	vec = normalize (v_forward);<br />	vec_z = 0 - vec_z + (random() - 0.5)*0.1;<br />	<br />	launch_spike (org, vec);<br />	newmis.classname = "knightspike";<br />	setmodel (newmis, "progs/k_spike.mdl");<br />	setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);		<br />	newmis.velocity = vec*300;<br />	sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM);

now

infront of this:

sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM);

Add:

local float r;<br />	\r = rint(random() * 4);

so it looks like this:

local float r;
     r = rint(random() * 4);
      
       sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM);

now for the simple if statements:

add before of sound (self etc

if (r == 1)

no now it looks like:

local float r;
     r = rint(random() * 4);

     if (r == 1)      
       sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM);

cool so now you have 1 but you have set the random for 4 not 1 so do this:

local float r;
     r = rint(random() * 4);

     if (r == 1)      
       sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM);

     if (r == 2)      
       sound (self, CHAN_WEAPON, "hknight/attack2.wav", 1, ATTN_NORM);

     if (r == 3)      
       sound (self, CHAN_WEAPON, "hknight/attack3.wav", 1, ATTN_NORM);

     if (r == 4)      
       sound (self, CHAN_WEAPON, "hknight/attack4.wav", 1, ATTN_NORM);

now open world.qc and under

	precache_sound ("misc/water1.wav");			// swimming
	precache_sound ("misc/water2.wav");			// swimming

add

     
precache_sound ("hknight/attack1.wav");
precache_sound ("hknight/attack2.wav");
precache_sound ("hknight/attack3.wav");
precache_sound ("hknight/attack4.wav");

now place your sounds into the hknight folder compile and run

and there you have it the hellknight will play 4 sounds randomly instead of 1

Post comment Comments
ceriux
ceriux - - 1,514 comments

it seems you have html in your qc..

Reply Good karma Bad karma+2 votes
dr_mabuse1981
dr_mabuse1981 - - 1,253 comments

FAIL!

Reply Good karma Bad karma0 votes
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: