Stupid question.


(h0nd) #1

Hi, I never actually tried to add a new weapon, in this case it’s a grenade. How do I add a weapon? What steps do I have to follow? Or is there a decent tutorial for how to add a weapon?

Thanks in advance.


(nUllSkillZ) #2

I’ve added a poison syringe as new weapon.
In the post Deadly Syringes you will find a link to a zip-file for download.

I made a “zip”-File containing the changed source-files.
Just search for the word “PSy” to find the changes.
In addition the following files have to be unzipped from “pak0.pk3” to the mod-directory:
“\icons\iconw_syringe_1_select.tga”
rename this to “\icons\iconw_p_syringe_1_select.tga”

“\weapons\syringe.weap”
rename this to “\weapons\p_syringe.weap”

All files of the directory:
“\models\multiplayer\syringe*.*”
rename this directory to “\models\multiplayer\p_syringe”

If you have tested this mini-mod please give me some feed-back.
Because I’ve modified the “Weapon_Knife”-damage-code I’m not sure if syringe hurts.
It should take all the health (but opponent should be revivabel) if Cov Op is up to level3 (instagib for level 4).

Source I haven’t touched is:

  • Calculating and displaying the stats at end of game (may be this works already)
  • The change of uniform skin if covert ops get / or loose disguise for the used arm-model.

Things I want to add:

  • Damage should be some kind of Flame-Thrower effect.

This zip contains the files that I changed. If you have MSVC++6 then you can search for the word “PSy” in all the source files.

EDIT:
Suggestion:
Try to search the source code for the terms “WP_GRENADE_LAUNCHER” or “WP_GRENADE_PINEAPPLE” to find the places of source that should be changed.


(h0nd) #3

Thanks, I’m sure it’ll work out now :slight_smile:


(h0nd) #4

NOTE: On line 308 in cg_event.c it displays the word “poisened”, but the word should be “poisoned” :slight_smile:


(nUllSkillZ) #5

Thanks for correcting me :slight_smile:


(telefase) #6

Hey null, I’ve got a question for you. You say that you added a new weapon. Does the number key work? For example, pressing ‘9’ will select the syringe. I’ve added a new pistol and everything works except when I press ‘2’ it dosen’t switch to the pistol. Any ideas?

-tf


(Spark) #7

Search for “weapBanksMultiPlayer” in bg_misc.c. There you can set which weapon appears in which weaponbank.


(telefase) #8

Ah, I put it in the wrong spot. Thanks for the info Spark. It works great now. :slight_smile:

-tf


(h0nd) #9

Ah I love u :stuck_out_tongue:
I got my new grenade to work, and I’m gonna turn it into a flashbang (Flash + Explosive sound)