exploding nails.
Moderator: InsideQC Admins
7 posts
• Page 1 of 1
exploding nails.
so iv been trying to implement my own version of exploding nails and iv been quite successful. the nails fire, hit the wall , stick for a few seconds, then explode. now the problem im coming to is with damage.
the spikes damage me as the explode i know this, they "might" damage the enemy's as they explode. (thats a little bit hard to test.) but when the nails strike the enemy's they explode. but the enemy's dont die.
so, here's my code someone please help me figure this out.
(iv more or less mixed the rocket code with the nail code)
i still have some code from me experimenting commented out. sorry.
the spikes damage me as the explode i know this, they "might" damage the enemy's as they explode. (thats a little bit hard to test.) but when the nails strike the enemy's they explode. but the enemy's dont die.
so, here's my code someone please help me figure this out.
(iv more or less mixed the rocket code with the nail code)
- Code: Select all
void() spike_boom =
{
sound (self, CHAN_BODY, "weapons/r_exp3.wav", 0.5, ATTN_NORM);
particle (self.origin, self.oldorigin*0.05, 235, 16);
BecomeExplosion();
T_RadiusDamage (self, self.owner, 30, other);
};
- Code: Select all
void() superspike_touch =
{
local float rand;
local float damg;
if (other == self.owner)
return;
if (other.solid == SOLID_TRIGGER)
return; // trigger field, do nothing
if (pointcontents(self.origin) == CONTENT_SKY)
{
remove(self);
return;
}
//T_RadiusDamage (self, self.owner, 120, other);
self.origin = self.origin - 8*normalize(self.velocity);
// hit something that bleeds
if (other.takedamage)
{
spawn_touchblood (18);
sound (self, CHAN_BODY, "weapons/r_exp3.wav", 0.5, ATTN_NORM);
particle (self.origin, self.oldorigin*0.05, 235, 16);
BecomeExplosion();
T_RadiusDamage (self, self.owner, 30, other);
return;
}
else
{
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
if (self.classname == "wizspike")
WriteByte (MSG_BROADCAST, TE_WIZSPIKE);
else if (self.classname == "knightspike")
WriteByte (MSG_BROADCAST, TE_KNIGHTSPIKE);
else
WriteByte (MSG_BROADCAST, TE_SPIKE);
WriteCoord (MSG_BROADCAST, self.origin_x);
WriteCoord (MSG_BROADCAST, self.origin_y);
WriteCoord (MSG_BROADCAST, self.origin_z);
}
self.velocity = '0 0 0'; //add this, it makes the nail stop
self.nextthink = time + 3;
self.think = spike_boom;
//particle (self.origin, self.oldorigin*0.05, 235, 16);
//sound (self, CHAN_BODY, "weapons/r_exp3.wav", 0.5, ATTN_NORM);
};
i still have some code from me experimenting commented out. sorry.
-

ceriux - Posts: 2223
- Joined: Sat Sep 06, 2008 3:30 pm
- Location: Indiana, USA
it seemed it only used t_damage on shamblers idk i really only wanted radius damage caused by the nails. although, what i could do is have it do t_damage to just simulate the damage from the explosion. but i want the explosion to push the enemy's away from the explosions. sorta like how other explosions work.
-

ceriux - Posts: 2223
- Joined: Sat Sep 06, 2008 3:30 pm
- Location: Indiana, USA
Your T_RadiusDamage() call on your spike won't do damage to the entity the spike is hitting.
Take a look:
T_RadiusDamage (self, self.owner, 30, other);
That's why the enemies won't die. Change that last other to world, so the radius damage won't ignore any entity unless the world.
Take a look:
T_RadiusDamage (self, self.owner, 30, other);
That's why the enemies won't die. Change that last other to world, so the radius damage won't ignore any entity unless the world.
-

Orion - Posts: 476
- Joined: Fri Jan 12, 2007 6:32 pm
- Location: Brazil
7 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest