kickheads on & off?
Moderator: InsideQC Admins
9 posts
• Page 1 of 1
kickheads on & off?
i've tried out the kickheads tutorial from Ivana Gibson and it works great.
but i only want to kick these heads when i press the MOUSE2 button, so i have added the command
.float kickgibs; into the defs.qc
then
if (self.impulse == 25)
self.kickgibs = TRUE;
if (self.impulse == 26)
self.kickgibs = FALSE;
into weapons.qc
and this
alias +kickgibs_on "impulse 25"
alias -kickgibs_on "impulse 26"
bind MOUSE2 +kickgibs_on
into my autoexec.cfg
and finally
//**********************************************
//Kicking Gibs n Dead Heads
//**********************************************
void() kick_touch;
void() kick_touch =
{
local vector v;
if (self.kickgibs != TRUE)
return;
// only a player can kick it
if (other.classname != "player")
return;
//randomize sound
if (random()< 0.6)
sound(other, CHAN_ITEM, "zombie/z_hit.wav", 1, ATTN_NORM);
else
sound(other, CHAN_ITEM, "zombie/z_miss.wav", 1, ATTN_NORM);
//define velocity
//you can play with these formulas to adjust
//trajectory
v_x = (other.velocity_x*2+50*random());
v_y = (other.velocity_y*2+50*random());
v_z =250 + 160 * random()+(other.velocity_y+other.velocity_x)*0.30;
self.flags = self.flags - ( self.flags & FL_ONGROUND );
self.velocity = v;
};
but it doesnt work!!!
i hope someone knows whats wrong...
but i only want to kick these heads when i press the MOUSE2 button, so i have added the command
.float kickgibs; into the defs.qc
then
if (self.impulse == 25)
self.kickgibs = TRUE;
if (self.impulse == 26)
self.kickgibs = FALSE;
into weapons.qc
and this
alias +kickgibs_on "impulse 25"
alias -kickgibs_on "impulse 26"
bind MOUSE2 +kickgibs_on
into my autoexec.cfg
and finally
//**********************************************
//Kicking Gibs n Dead Heads
//**********************************************
void() kick_touch;
void() kick_touch =
{
local vector v;
if (self.kickgibs != TRUE)
return;
// only a player can kick it
if (other.classname != "player")
return;
//randomize sound
if (random()< 0.6)
sound(other, CHAN_ITEM, "zombie/z_hit.wav", 1, ATTN_NORM);
else
sound(other, CHAN_ITEM, "zombie/z_miss.wav", 1, ATTN_NORM);
//define velocity
//you can play with these formulas to adjust
//trajectory
v_x = (other.velocity_x*2+50*random());
v_y = (other.velocity_y*2+50*random());
v_z =250 + 160 * random()+(other.velocity_y+other.velocity_x)*0.30;
self.flags = self.flags - ( self.flags & FL_ONGROUND );
self.velocity = v;
};
but it doesnt work!!!
i hope someone knows whats wrong...
- smd
- Posts: 26
- Joined: Sun Sep 23, 2007 2:58 pm
You might get head kicking mode stuck on if you release the button while firing a weapon, then press another impulse before it finishes firing.
Using impulses for on/off things is dangerous at best. You'll have to check for those impulses before the attack_finished check, wherever that is.
Using impulses for on/off things is dangerous at best. You'll have to check for those impulses before the attack_finished check, wherever that is.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
- Sajt
- Posts: 1215
- Joined: Sat Oct 16, 2004 3:39 am
I'd ditch all the code
and at the top of kick_touch
put
done.
and at the top of kick_touch
put
- Code: Select all
if (!other.button2)
return;
done.
Benjamin Darling
http://www.bendarling.net/
Reflex - In development competitive arena fps combining modern tech with the speed, precision and freedom of 90's shooters.
http://www.reflexfps.net/
http://www.bendarling.net/
Reflex - In development competitive arena fps combining modern tech with the speed, precision and freedom of 90's shooters.
http://www.reflexfps.net/
- Electro
- Posts: 312
- Joined: Wed Dec 29, 2004 11:25 pm
- Location: Brisbane, Australia
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest

