the kicking gibs and heads one this time :o

Need help with a tutorial found on InsideQC.com? Post here.
Post Reply
MeTcHsteekle
Posts: 399
Joined: Thu May 15, 2008 10:46 pm
Location: its a secret

the kicking gibs and heads one this time :o

Post by MeTcHsteekle »

ok i did the ...well the title..and all... and i cant get it to work,

it compiles and all but the gibs and heads dont do anything, they jut sit therre and its making me mad?

has anyone done this toutorial before?

and if so does it work or am i dong it worng?

:?
bah
MeTcHsteekle
Posts: 399
Joined: Thu May 15, 2008 10:46 pm
Location: its a secret

Post by MeTcHsteekle »

never mind, i forgot to save progs.src :oops: :oops: :oops:

it works well
bah
skite2001
Posts: 17
Joined: Mon Nov 17, 2008 5:40 pm

Post by skite2001 »

well, but i got some problems:

Using the Kicking Gibs with SolidMonsterPatch. I can Kick the Gibs, but the head stay at the dropped position and i cant touch/kick it.

here some changes from the solid monster patch, maybe it helps:

monster.qc
void() monster_dead_push =
{
local float dir;
dir = vectoyaw(other.velocity);
self.origin = self.origin + '0 0 1'; // Now we can be lifted, pushed off ledges, &c
walkmove(dir, 7);
};

void(string headmdl) monster_gib =
{
if (self.classname == "monster_demon1" || self.classname == "monster_dog" || self.classname == "monster_ogre" || self.classname == "monster_wizard")
{
ThrowGib ("progs/gib3.mdl", self.health);
ThrowGib ("progs/gib3.mdl", self.health);
ThrowGib ("progs/gib3.mdl", self.health);
ThrowHead (headmdl, self.health);
}
else
{
ThrowGib ("progs/gib1.mdl", self.health);
ThrowGib ("progs/gib2.mdl", self.health);
ThrowGib ("progs/gib3.mdl", self.health);
ThrowHead (headmdl, self.health);
}

};

void() monster_corpse_gib =
{
monster_gib(self.weaponmodel);
};

void(vector bb1, vector bb2, string headmdl) monster_corpse_setup =
{
setsize(self, bb1, bb2);
self.weaponmodel=headmdl; // This should be unused in monsters
//self.health=35;
self.health=60;
self.th_stand = SUB_Null;
self.th_walk = SUB_Null;
self.th_run = SUB_Null;
self.th_pain = SUB_Gib;
self.th_die = monster_corpse_gib;
self.th_melee = SUB_Null;
self.th_missile = SUB_Null;
//self.touch = monster_dead_push; // This does funny things
self.takedamage= DAMAGE_AIM; // grenades explode
self.flags = self.flags &! FL_MONSTER; // Next "death" isn't counted
};
jsubs.qc
void(string gibname, float dm) ThrowGib;
float() random;

void() SUB_Gib =
{
local vector x,y,v;
x='1 0 0';
y='0 1 0';
v=x*(50-random()*100)+y*(50-random()*100);
if (random() < 0.8) // Meat spray only, most of the time
SpawnMeatSpray(self.origin, v);
else if (random() < 0.3)
ThrowGib("progs/gib1.mdl", self.health);
else if (random() < 0.5)
ThrowGib("progs/gib2.mdl", self.health);
else
ThrowGib("progs/gib3.mdl", self.health);
};
and at the monster file, for example soldier.qc
void() army_die =
{
// check for gib
if (self.health < -35)
{
sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
monster_gib("progs/h_guard.mdl");
return;
}

// regular death
sound (self, CHAN_VOICE, "soldier/death1.wav", 1, ATTN_NORM);
if (random() < 0.5)
army_die1 ();
else
army_cdie1 ();

// We want a corpse: No actions, a little health, and a new .th_die
// Frob some flags so we're damagable as well

monster_corpse_setup('-16 -16 -24', '16 16 -10', "progs/h_guard.mdl");
};
and the kicking calls at player.qc:
void(string gibname, float dm) ThrowGib =
{
local entity new;

new = spawn();
new.origin = self.origin;
setmodel (new, gibname);
setsize (new, '0 0 0', '0 0 0');
new.velocity = VelocityForDamage (dm);
new.movetype = MOVETYPE_BOUNCE;
//new.solid = SOLID_NOT;
new.solid = SOLID_TRIGGER; // Set it up for a trigger event
new.touch = kick_touch; // Call kick_touch when touched
new.avelocity_x = random()*600;
new.avelocity_y = random()*600;
new.avelocity_z = random()*600;
new.think = SUB_Remove;
new.ltime = time;
new.nextthink = time + 10 + random()*10;
new.frame = 0;
new.flags = 0;
};

void(string gibname, float dm) ThrowHead =
{
setmodel (self, gibname);
self.frame = 0;
self.nextthink = -1;
self.movetype = MOVETYPE_BOUNCE;
self.takedamage = DAMAGE_NO;
// self.solid = SOLID_NOT;
self.solid = SOLID_TRIGGER;
self.touch = kick_touch;
self.view_ofs = '0 0 8';
setsize (self, '-16 -16 0', '16 16 56');
self.velocity = VelocityForDamage (dm);
self.origin_z = self.origin_z - 24;
self.flags = self.flags - (self.flags & FL_ONGROUND);
self.avelocity = crandom() * '0 600 0';
};
Post Reply