scratch qc weapons?

Discuss programming in the QuakeC language.
Post Reply
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

scratch qc weapons?

Post by ceriux »

can someone explain to me the main functions required for coding a weapon from scratch (no preexisting code?) please, thank you?
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Re: scratch qc weapons?

Post by r00k »

Look in ITEMS.QC for 'void() weapon_foo =' , these are spawn functions when the map loads.
In WEAPONS.QC, is the code for changing weapons, and firing the weapon.

So you will need
a spawn function which creates the entity, and precaches it's model, sets up a touch function, then spawns the item.
an impulse use to select that weapon, (including cycling to that weapon via impulse 10/12)
addition to w_attack so u can update v_fooweapon anims via player.qc and handle what happens when u shoot the weapon.
plus if the weapon uses any ammo, you need to account for all that too!

Sorry i wrote this off the cuff and in a hurry, if you like i could make a simple weapon and document all required code...
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: scratch qc weapons?

Post by ceriux »

it would probably be helpful esp if you're good with comments. im going to attempt with out though. thanks for the post!
Post Reply