Forum

Adding iron sights?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Adding iron sights?

Postby Biodude » Sun Aug 23, 2009 8:58 pm

Hey everyone, I am making a game and I need help on making iron sights in it. Anyone know how?
User avatar
Biodude
 
Posts: 186
Joined: Wed Aug 27, 2008 7:17 pm

Postby ceriux » Sun Aug 23, 2009 10:11 pm

i was told good placement with animation XO
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Biodude » Sun Aug 23, 2009 11:37 pm

so it HAS to be animation?

not weapon position changing with a impulse?
User avatar
Biodude
 
Posts: 186
Joined: Wed Aug 27, 2008 7:17 pm

Postby ceriux » Mon Aug 24, 2009 12:03 am

dunno, thats just pretty much what i was told...
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby MeTcHsteekle » Mon Aug 24, 2009 12:43 am

..well you could make it another model and switch it to that and back..or err..something
bah
MeTcHsteekle
 
Posts: 399
Joined: Thu May 15, 2008 10:46 pm
Location: its a secret

Postby Biodude » Mon Aug 24, 2009 2:02 am

errm, its just changing the weapon position i think. Cmon guys, you are one of 2 reliable quake 1 sites!
User avatar
Biodude
 
Posts: 186
Joined: Wed Aug 27, 2008 7:17 pm

Postby Wazat » Mon Aug 24, 2009 4:47 am

Biodude wrote:errm, its just changing the weapon position i think. Cmon guys, you are one of 2 reliable quake 1 sites!

Not knowing what iron sights are, I fear my reply may have limited usefulness. I'm assuming you mean looking down the barrel of a gun or down a scope at the target.

To do this, you have several options. The most direct and compatible way is to change the player's .weaponmodel to the scope, or add the scope to the weapon model and have frames bringing it toward the player's face (and increasing its scale if necessary).

Another option is .viewmodelforclient, which is supported by many engines. It allows you to set any number of entities as the player's weapon models/hud/etc.

Other people here may know more options.
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Wazat
 
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA

Postby Biodude » Mon Aug 24, 2009 9:06 am

0k, Ill see if I can combine some ideas to make this

iron sights is: http://www.gamereplays.org/community/up ... 803085.jpg
User avatar
Biodude
 
Posts: 186
Joined: Wed Aug 27, 2008 7:17 pm

Postby GiffE » Mon Aug 24, 2009 1:36 pm

You CAN make it without an animation. You would have to code your view model using DP's "viewmodelforclient" as then you can re position the model on screen and re-angle it.
Similar to how i made my free floating weapon (notice how the weapon moves around as I look around)

As far as I know you cannot adjust the viewmodel's position without remaking it with viewmodelforclient.
It will likely be easier for you to use animations if your system is not already setup like that.
GiffE
 
Posts: 170
Joined: Sun Oct 08, 2006 3:39 pm
Location: USA, CT

Postby Biodude » Mon Aug 24, 2009 1:45 pm

thanks for the advice, the video says it is private?

:D
User avatar
Biodude
 
Posts: 186
Joined: Wed Aug 27, 2008 7:17 pm

Postby avirox » Mon Aug 24, 2009 1:59 pm

Biodude wrote:errm, its just changing the weapon position i think. Cmon guys, you are one of 2 reliable quake 1 sites!


Really? Which is the other one? :P

At any rate, what Wazat suggested, but also tweak the players' FOV by sending a stuffcmd. There's no way to get the DOF effect unless you do some engine hax0ry though.
avirox
 
Posts: 137
Joined: Wed Aug 16, 2006 3:25 pm

Postby GiffE » Mon Aug 24, 2009 3:04 pm

avirox wrote:
Biodude wrote:errm, its just changing the weapon position i think. Cmon guys, you are one of 2 reliable quake 1 sites!


Really? Which is the other one? :P

At any rate, what Wazat suggested, but also tweak the players' FOV by sending a stuffcmd. There's no way to get the DOF effect unless you do some engine hax0ry though.


sorry forgot the video was private (its an old one) its public now.
Yay we are reliable :lol:
GiffE
 
Posts: 170
Joined: Sun Oct 08, 2006 3:39 pm
Location: USA, CT

Postby Downsider » Mon Aug 24, 2009 6:43 pm

You could modify your engine to offset your weapons based on a few convars. Kurok's engine has this in for the weapons to slide up and down when you draw a weapon out, and I'm assuming you're working on the PSP.
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Postby Biodude » Mon Aug 24, 2009 9:05 pm

Yeah, I got a hud coder(no thanks to you downsider XD) and I am working with a modifiyed version of weapon crowbar's dquake so that I can run hl1 maps and models flawlessly. Ill find a way i guess :)
User avatar
Biodude
 
Posts: 186
Joined: Wed Aug 27, 2008 7:17 pm

Postby Error » Tue Aug 25, 2009 5:31 am

I'll start coding one tonight!
User avatar
Error
InsideQC Staff
 
Posts: 865
Joined: Fri Nov 05, 2004 5:15 am
Location: VA, USA

Next

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest