scratch qc weapons?
Moderator: InsideQC Admins
3 posts
• Page 1 of 1
scratch qc weapons?
can someone explain to me the main functions required for coding a weapon from scratch (no preexisting code?) please, thank you?
-

ceriux - Posts: 2223
- Joined: Sat Sep 06, 2008 3:30 pm
- Location: Indiana, USA
Re: scratch qc weapons?
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...
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...
- r00k
- Posts: 1110
- Joined: Sat Nov 13, 2004 10:39 pm
Re: scratch qc weapons?
it would probably be helpful esp if you're good with comments. im going to attempt with out though. thanks for the post!
-

ceriux - Posts: 2223
- Joined: Sat Sep 06, 2008 3:30 pm
- Location: Indiana, USA
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest