Change model when monster dies?
Moderator: InsideQC Admins
3 posts
• Page 1 of 1
Change model when monster dies?
There's a way in qc to change a model on the fly when a monster dies?
I make an example. Let's assume we have a robot monster, when it dies it would be cool to replace robot model with a wreck model that explodes.
I saw this technique in Steel Storm, but unfortunately no source code was released.
Thanks
I make an example. Let's assume we have a robot monster, when it dies it would be cool to replace robot model with a wreck model that explodes.
I saw this technique in Steel Storm, but unfortunately no source code was released.
Thanks
- toneddu2000
- Posts: 1352
- Joined: Tue Feb 24, 2009 4:39 pm
- Location: Italy
Re: Change model when monster dies?
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 );};
{};
"-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.
-

Nahuel - Posts: 492
- Joined: Wed Jan 12, 2011 8:42 pm
- Location: mar del plata
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest