Make Enemy Explode On Death
Moderator: Inside3D Admins
15 posts
• Page 1 of 1
How can I make an enemy explode on death, like an explobox?
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Re: Make Enemy Explode On Death
replace the monsters death function with the death function of an explo box.
Looking in soldier.qc we see
you can replace its innards with the innards of the explo box death, or you can find where its called
and replace that with the explocode found in misc.qc
so
self.th_die = army_die;
is now
self.th_die = barrel_explode;
Looking in soldier.qc we see
- Code:
void() army_die =
{
// check for gib
if (self.health < -35)
{
sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
ThrowHead ("progs/h_guard.mdl", self.health);
ThrowGib ("progs/gib1.mdl", self.health);
ThrowGib ("progs/gib2.mdl", self.health);
ThrowGib ("progs/gib3.mdl", self.health);
return;
}
// regular death
sound (self, CHAN_VOICE, "soldier/death1.wav", 1, ATTN_NORM);
if (random() < 0.5)
army_die1 ();
else
army_cdie1 ();
};
you can replace its innards with the innards of the explo box death, or you can find where its called
and replace that with the explocode found in misc.qc
- Code:
void() barrel_explode =
{
self.takedamage = DAMAGE_NO;
self.classname = "explo_box";
// did say self.owner
T_RadiusDamage (self, self, 160, world);
sound (self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM);
particle (self.origin, '0 0 0', 75, 255);
self.origin_z = self.origin_z + 32;
BecomeExplosion ();
};
so
self.th_die = army_die;
is now
self.th_die = barrel_explode;
Re: Make Enemy Explode On Death
Thanks!
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Re: Make Enemy Explode On Death
Be aware that doing so the enemies will have a blast damage like the exploding boxes, too.
Also, could be fun to keep the gib throwing part from the original death function.
Also, could be fun to keep the gib throwing part from the original death function.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC
(LordHavoc)
Re: Make Enemy Explode On Death
BecomeExplosion ();
This is what actually makes them explode.
Will make the soldier explode. You could make your own exploding death function. Look at the tarbaby's.
New function
This is what actually makes them explode.
- Code:
void() army_die1 =[ $death1, army_die2 ] {};
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, army_die10 ] {BecomeExplosion ();};
Will make the soldier explode. You could make your own exploding death function. Look at the tarbaby's.
- Code:
void() tbaby_die1 =[ $exp, tbaby_die2 ] {
self.takedamage = DAMAGE_NO;
};
void() tbaby_die2 =[ $exp, tbaby_run1 ]
{
T_RadiusDamage (self, self, 120, world);
sound (self, CHAN_VOICE, "blob/death1.wav", 1, ATTN_NORM);
self.origin = self.origin - 8*normalize(self.velocity);
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_TAREXPLOSION);
WriteCoord (MSG_BROADCAST, self.origin_x);
WriteCoord (MSG_BROADCAST, self.origin_y);
WriteCoord (MSG_BROADCAST, self.origin_z);
BecomeExplosion ();
};
New function
- Code:
void() death_explode =
{
self.takedamage = DAMAGE_NO; //entity doesn't take any more damage
T_RadiusDamage (self, self, 120, world); //damage given by explosion
sound (self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM); //explosion sound
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); //create a temp entity
WriteByte (MSG_BROADCAST, TE_EXPLOSION); //create the explosion effect
WriteCoord (MSG_BROADCAST, self.origin_x); //where the explosion is
WriteCoord (MSG_BROADCAST, self.origin_y);
WriteCoord (MSG_BROADCAST, self.origin_z);
BecomeExplosion ();
};
Re: Make Enemy Explode On Death
Obviously I didn't think of spawns
Baker -1
Thanks for the QuakeC thoughts / example code.
Baker -1
Thanks for the QuakeC thoughts / example code.
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Re: Make Enemy Explode On Death
Hello Baker,
Interesting to see that you also have some of those ideas...
That is how I started with the additional death animations in the "small mod compilation",
which should scare/suprise/entertain the player.
I like frag.machine´s idea too.
In the meantime I went over to "burn" the corpses to ashes after some time.
Crazy ideas needs crazy minds
All the best for your project,
Seven
Interesting to see that you also have some of those ideas...
That is how I started with the additional death animations in the "small mod compilation",
which should scare/suprise/entertain the player.
I like frag.machine´s idea too.
In the meantime I went over to "burn" the corpses to ashes after some time.
Crazy ideas needs crazy minds
All the best for your project,
Seven
Re: Make Enemy Explode On Death
BecomeExplosion ();
This is what actually makes them explode.
BecomeExplosion just changes the model to the explosion sprite.
If you intend the explosion to do any damage, you'll need the call to t_radiusDamage() that you see in the tarbabies code as well.
The way I show includes the damage, which I assume was the desired effect.
The way I outlined has the added benefit of having exactly 1 line of code changed.
Its dead simple.
Re: Make Enemy Explode On Death
Please excuse me Baker.
But your death animation thread here and the new game "Legend of Grimrock", which is an amazing game and everybody should try/buy it,
made me try to bring the death animations into Quake.
It was a fun experience to fiddeling with qc and particle effects to get what Legend of Grimrock has.
Just to show you my actual progress:
These are the death animations of Legend of Grimrock
http://www.youtube.com/watch?v=G_-GjV1g ... ature=plcp
This is my trial to bring them into Quake:
http://www.youtube.com/watch?v=8KYbcURe ... ature=plcp
This is the very simple code I used:
It maybe inspires you to make your (of course much better) death animation.
Best wishes,
Seven
But your death animation thread here and the new game "Legend of Grimrock", which is an amazing game and everybody should try/buy it,
made me try to bring the death animations into Quake.
It was a fun experience to fiddeling with qc and particle effects to get what Legend of Grimrock has.
Just to show you my actual progress:
These are the death animations of Legend of Grimrock
http://www.youtube.com/watch?v=G_-GjV1g ... ature=plcp
This is my trial to bring them into Quake:
http://www.youtube.com/watch?v=8KYbcURe ... ature=plcp
This is the very simple code I used:
- Code:
void() army_die1 =[ $death1, army_die2 ] {
self.traileffectnum = particleeffectnum("grimrock_soldier");};
void() army_die2 =[ $death2, army_die3 ] {
self.alpha = 0.7;};
void() army_die3 =[ $death3, army_die4 ]
{self.solid = SOLID_NOT;self.ammo_shells = 5;DropBackpack();
self.alpha = 0.6;};
void() army_die4 =[ $death4, army_die5 ] {
self.alpha = 0.5;};
void() army_die5 =[ $death5, army_die6 ] {
self.alpha = 0.4;};
void() army_die6 =[ $death6, army_die7 ] {
self.alpha = 0.3;};
void() army_die7 =[ $death7, army_die8 ] {
self.alpha = 0.2;};
void() army_die8 =[ $death8, army_die9 ] {
self.alpha = 0.1;};
void() army_die9 =[ $death9, army_die10 ] {
self.alpha = -1;};
void() army_die10 =[ $death10, army_die10 ] {
remove(self);
};
It maybe inspires you to make your (of course much better) death animation.
Best wishes,
Seven
Re: Make Enemy Explode On Death
very nice effect in general, Seven! For this purpose I found it a little "weak", comparing it to the "original" I think you made a great job, but as an explosion effect per se imo it would be better to add some radius explosion
How do you create the particle? Did you use DP?
How do you create the particle? Did you use DP?
Re: Make Enemy Explode On Death
Seven wrote:This is my trial to bring them into Quake:
http://www.youtube.com/watch?v=8KYbcURe ... ature=plcp
Re: Make Enemy Explode On Death
Since you cant outline the model with particles as tightly as grimrock can, you could cheat a little and add a skin frame to your models
that has the red particles interspersed along its defining edges. That would probably help make the effect look much tighter.
Your current version looks very good though.
Good work.
that has the red particles interspersed along its defining edges. That would probably help make the effect look much tighter.
Your current version looks very good though.
Good work.
Re: Make Enemy Explode On Death
Thank you for your feedback.
toneddu2000,
yes, i use DP (please see the qc code with dpextensions i used to achieve it).
If you want to try it yourself, I added a download (with QC source and effectinfo) over at quakeone.com:
http://quakeone.com/forums/quake-mod-re ... post111594
The effect has no explosion, because I only wanted to "copy" the Legend of Grimrock effect.
I am sorry for the offtopic in Bakers thread.
qbism,
Yes you are right. The particles should stay a little longer on ground before they vanish.
Thank you for the tip.
gnounc,
I am not sure how to do that (adding a skinframe to a model with particles interspersed).
To be honest, I even dont fully understand your english meaning (my motzher tounge is german)
I will try to modify the spawning position of the particles a little more via effectinfo params.
Again, I am sorry for the offtopic talk Baker.
toneddu2000,
yes, i use DP (please see the qc code with dpextensions i used to achieve it).
If you want to try it yourself, I added a download (with QC source and effectinfo) over at quakeone.com:
http://quakeone.com/forums/quake-mod-re ... post111594
The effect has no explosion, because I only wanted to "copy" the Legend of Grimrock effect.
I am sorry for the offtopic in Bakers thread.
qbism,
Yes you are right. The particles should stay a little longer on ground before they vanish.
Thank you for the tip.
gnounc,
I am not sure how to do that (adding a skinframe to a model with particles interspersed).
To be honest, I even dont fully understand your english meaning (my motzher tounge is german)
I will try to modify the spawning position of the particles a little more via effectinfo params.
Again, I am sorry for the offtopic talk Baker.
Re: Make Enemy Explode On Death
SELF.HEALTH -= 500;
instant gib!
TE_ ... edit: nvm players should explode like a frog in a blender not like a fireball...
instant gib!
TE_ ... edit: nvm players should explode like a frog in a blender not like a fireball...
Re: Make Enemy Explode On Death
thanks Seven for the hint, I'll try it!
15 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
