Inside3D tutorials.
Created By: | Ivana Gibson |
eMail: | jkirklan@mines.edu |
Difficulty Scale: | Easy |
self.solid = SOLID_NOT;With:
self.solid = SOLID_TRIGGER; self.touch = kick_touch;4) Find the function ThrowGib()
new.solid = SOLID_NOT;With:
new.solid = SOLID_TRIGGER; // Set it up for a trigger event new.touch = kick_touch; // Call kick_touch when touched6) Open up world.qc
// sounds used from C physics code8) Below it, add:
precache_sound ("zombie/z_miss.wav"); precache_sound ("zombie/z_hit.wav");9) Now, find the fuction CopyToBodyQue().
bodyque_head.touch = ent.touch; bodyque_head.solid = ent.solid;11)Open up progs.src
KickGibs.qc13) Create a new file. Call it KickGibs.qc
//********************************************** //Kicking Gibs n Dead Heads by Ivana Gibson //********************************************** void() kick_touch; void() kick_touch = { local vector v; // only a player can kick it if (other.classname != "player") return; //randomize sound if (random()< 0.8) sound(other, CHAN_ITEM, "zombie/z_hit.wav", 1, ATTN_NORM); else sound(other, CHAN_ITEM, "zombie/z_miss.wav", 1, ATTN_NORM); //define velocity //you can play with these formulas to adjust //trajectory v_x = (other.velocity_x*2+50*random()); v_y = (other.velocity_y*2+50*random()); v_z =250 + 160 * random()+(other.velocity_y+other.velocity_x)*0.30; self.flags = self.flags - ( self.flags & FL_ONGROUND ); self.velocity = v; };15) Save everything, compile, and have fun kicking heads and gibs!