Problems with Melee impulse Attack...

Discuss programming in the QuakeC language.
Post Reply
drm_wayne
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm

Problems with Melee impulse Attack...

Post by drm_wayne »

i hae currently added a melee function, it works like it should but
sadly i cant figure out how to disable it when you shoot..
because it uses a own mdl for the melee aniamtion, and when you shoot
AND press the melee button your weapon turns into a "firing fist :lol: ",
and want to avoid this xD

currently it looks like this:

player.qc:

Code: Select all

    void()   player_fist =  [$fist1, player_fist1] {self.weaponframe=1; };
    void()   player_fist1 = [$fist2, player_fist2] {self.weaponframe=2;};
    void()   player_fist2 = [$fist3, player_fist3] {self.weaponframe=3; W_FireDatFist();};
    void()   player_fist3=  [$fist4, player_run  ] {self.weaponframe=4; W_SetCurrentAmmo(); };
weapons.qc

Code: Select all

void ()player_fist;
void() FistFight =
{
self.weaponmodel = "progs/weapons/v_fist.mdl";

self.attack_finished = time + 0.88;
player_fist ();
};
and impulse command is:

Code: Select all

	if (self.impulse == 15)
    		  FistFight();
gnounc
Posts: 428
Joined: Mon Apr 06, 2009 6:26 am

Re: Problems with Melee impulse Attack...

Post by gnounc »

if(self.attack_finished > time)
return;
drm_wayne
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm

Re: Problems with Melee impulse Attack...

Post by drm_wayne »

sadly this doesnt work, i still get the same "firing fist weaponmodel" problem as before...
Nahuel
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Re: Problems with Melee impulse Attack...

Post by Nahuel »

drm_wayne wrote:sadly this doesnt work, i still get the same "firing fist weaponmodel" problem as before...
add some dummy flag to the animation shoots !! and you can write something like

Code: Select all

if (self.impulse == 15) 
{ if (self.shooting)
return;
            FistFight(); .........

hi, I am nahuel, I love quake and qc.
drm_wayne
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm

Re: Problems with Melee impulse Attack...

Post by drm_wayne »

ahh thx, i already hat the float thing in mind but i did not tested it xD
Thx for the help, it works like a charm now :)
Post Reply