Forum

Problems with Melee impulse Attack...

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Problems with Melee impulse Attack...

Postby drm_wayne » Wed Oct 10, 2012 1:52 pm

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();
User avatar
drm_wayne
 
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm

Re: Problems with Melee impulse Attack...

Postby gnounc » Wed Oct 10, 2012 3:57 pm

if(self.attack_finished > time)
return;
User avatar
gnounc
 
Posts: 424
Joined: Mon Apr 06, 2009 6:26 am

Re: Problems with Melee impulse Attack...

Postby drm_wayne » Wed Oct 10, 2012 4:09 pm

sadly this doesnt work, i still get the same "firing fist weaponmodel" problem as before...
User avatar
drm_wayne
 
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm

Re: Problems with Melee impulse Attack...

Postby Nahuel » Wed Oct 10, 2012 9:16 pm

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.
User avatar
Nahuel
 
Posts: 492
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Re: Problems with Melee impulse Attack...

Postby drm_wayne » Wed Oct 10, 2012 10:17 pm

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 :)
User avatar
drm_wayne
 
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest