Forum

How to make an aim command?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Postby Karall » Mon Feb 28, 2011 10:18 pm

Well, i didn't understand jack of that.
Karall
 
Posts: 128
Joined: Thu Jul 15, 2010 5:23 pm

Postby behind_you » Mon Feb 28, 2011 11:09 pm

Karall wrote:Well, i didn't understand jack of that.



:D

But seriously, theplasticbing, make an animation where u pulled the gun to the center of the screen (like in medal of honor) and add a small zoom command.
User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby Karall » Sat Mar 05, 2011 12:51 am

I almost got it working now! Just one small problem, when I click my right mouse button (the one i bound impulse 123 to) nothing happens, ALTHO when i switch weapon and then switch back the the gun it goes into aim down sights mode. How do I fix it so that it plays the animation instantly?
Last edited by Karall on Sat Mar 05, 2011 5:13 pm, edited 1 time in total.
Karall
 
Posts: 128
Joined: Thu Jul 15, 2010 5:23 pm

Postby Karall » Sat Mar 05, 2011 5:12 pm

Oh, and also I actully have another problem. This might be more of a model problem though. The animation doesn't actully stay in aim down sights mode, it plays the two frames I made and then goes back to normal. How would I make it so that the animation stays at the last frame of my animation until i press impulse 123 again?
Karall
 
Posts: 128
Joined: Thu Jul 15, 2010 5:23 pm

Postby behind_you » Mon Apr 25, 2011 8:31 am

Karall wrote:Oh, and also I actully have another problem. This might be more of a model problem though. The animation doesn't actully stay in aim down sights mode, it plays the two frames I made and then goes back to normal. How would I make it so that the animation stays at the last frame of my animation until i press impulse 123 again?


Code: Select all
void()  weaponaim1     =[      $animation1,        weaponaim2     ] {self.weaponframe = 0;};
void()  weaponaim2     =[      $animation2,       weaponaim2     ] {self.weaponframe = 1; self.aimmode = TRUE;};
//notice after $animation2, i said weaponaim2 again, which tells the engine to keep repeating the same frame. i also added a float that sets your aim mode to true


if (self.impulse == 123) //--put in weapons.qc, impulsecommands
if (self.aimmode == TRUE)
weaponunaim1();
else
weaponaim1();


void() weaponunaim1 =[ $unanimation1, weaponunaim2 ] {self.weaponframe = 2;};
void() weaponunaim2 =[ $unanimation2, weaponunaim2 ] {self.weaponframe = 3; self.aimmode = FALSE;};

oh and make sure you add .float aimmode; to the bottom of defs.qc

bon appetite!
User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Previous

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest