scratch qc weapons?
scratch qc weapons?
can someone explain to me the main functions required for coding a weapon from scratch (no preexisting code?) please, thank you?
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...
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!