Sticky Grenades
Moderator: InsideQC Admins
2 posts
• Page 1 of 1
Sticky Grenades
Im using the sticky grenades from the tutorials page but i did a little editing to get rid of the random and stuff. But now when the grenades stick the dont explode they just disappear. But when i kill the enemy the grenade appears on the dead body THEN explodes....
and my missile.touch = GlueTouch; in my grenade throwing function.
Also instead of sharing the enemies origin when it sticks, how would i make the origin on the spot of the enemy where it hits?
- Code: Select all
void () GlueStick =
{
if ( ((self.enemy != world) && (self.enemy.health > 1)) )
{
self.origin = self.enemy.origin;
if ( (self.velocity == VEC_ORIGIN) ) {
self.avelocity = VEC_ORIGIN;
}
}
self.think = GrenadeExplode;
self.nextthink = time + 2;
};
- Code: Select all
void () GlueTouch =
{
if ( (other == self.owner) ) {
return ;
}
sound (self,CHAN_WEAPON,"misc/outwater.wav",TRUE,ATTN_NORM); // sound to make when it stick
self.touch = GlueStick; // go to GlueStick when touching something
self.velocity = (self.velocity * 0);
self.avelocity = VEC_ORIGIN;
self.enemy = other;
};
and my missile.touch = GlueTouch; in my grenade throwing function.
Also instead of sharing the enemies origin when it sticks, how would i make the origin on the spot of the enemy where it hits?
- Ghost_Fang
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
