Inside3D!
     

Problem with SolidMonster-Patch (J.Epler) + KickGibs

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
skite2001



Joined: 17 Nov 2008
Posts: 17

PostPosted: Mon Nov 24, 2008 6:12 pm    Post subject: Problem with SolidMonster-Patch (J.Epler) + KickGibs Reply with quote

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
Quote:

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
Quote:

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.Cool // 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
Quote:

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:
Quote:

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';
};
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group