by Nahuel » Sun Apr 03, 2011 8:01 pm
this is an example to do that in the soldier, into this case I changed the model into that of the dog. I suppose that you might do it with a better model, for example a smoky soldier or something like that.
"-220 of the throw (gib and head) he is for the size of the explosion you you can put what occurs to you.
you have only to change the models and adapt it to your code, but I believe that this goes for good way.
erase the functions army_die1 to army_die10 and put this code in soldier.qc
do not forget the precache and know that the alone soldier will exploit sometimes, although it is easy to change army_cdie so that it is equal to this new code!!!!!!!!
enjoy!
void() explosoldier =
{
sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
BecomeExplosion ();
T_RadiusDamage (self, self.owner, 220, world);
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_EXPLOSION);
WriteCoord (MSG_BROADCAST, self.origin_x);
WriteCoord (MSG_BROADCAST, self.origin_y);
WriteCoord (MSG_BROADCAST, self.origin_z);
ThrowHead ("progs/h_guard.mdl", self.health - 220);//
ThrowGib ("progs/gib1.mdl", self.health - 220);
ThrowGib ("progs/gib2.mdl", self.health - 220);
ThrowGib ("progs/gib3.mdl", self.health - 220);
return;
};
void() army_die1 =[ $death1, army_die2 ] {setmodel (self, "progs/dog.mdl"); // death model
};
void() army_die2 =[ $death2, army_die3 ] {};
void() army_die3 =[ $death3, army_die4 ]
{self.solid = SOLID_NOT;self.ammo_shells = 5;DropBackpack();};
void() army_die4 =[ $death4, army_die5 ] {};
void() army_die5 =[ $death5, army_die6 ] {};
void() army_die6 =[ $death6, army_die7 ] {};
void() army_die7 =[ $death7, army_die8 ] {};
void() army_die8 =[ $death8, army_die9 ] {};
void() army_die9 =[ $death9, army_die10 ] {};
void() army_die10 =[ $death10, explosoldier] {self.nextthink = (time + random()*5 );};
{};
hi, I am nahuel, I love quake and qc.