(Note: Second time re-write after I followed a link on this tab. Now i'm miffed).
Hey everyone. There's this problem which I've been stuck on for the last few hours and I REALLY need some help on it. I'm trying to put in a custom weapon in my mod (I haven't got the authors permission, but it's for my personal use at the moment) but when I followed this totorial ([url]http://developer.valvesoftware.com/wiki/Adding_weapons[/url]) it hasn't worked! Here's what I did:
In my C:\Half-Life - New Rise\hlnr\src\cl_dll\hl2_hud\c_weapon__stubs_hl2.cpp file, under line 27 (which should say: #ifndef HL2MP), I put:
STUB_WEAPON_CLASS( weapon_smg2, WeaponSMG2, CHLSelectFireMachineGun );
---------
In my C:\Program Files\Steam\steamapps\SourceMods\half-life-newrise\scripts\weapon_smg2.txt file, I renamed most things that were SMG1 to>> SMG2 (I also changed the v_model and w_model directorys as well).
---------
In my C:\Half-Life - New Rise\hlnr\src\game_shared\hl2\hl2_gamerules.cpp file, under line 1686 (there were tabs), I put:
def.AddAmmoType("SMG2",DMG_BULLET,TRACER_LINE_AND_WHIZ,"sk_plr_dmg_smg2","sk_npc_dmg_smg2","sk_max_smg2",BULLET_IMPULSE(200, 1225), 0 );
---------
In my C:\Half-Life - New Rise\hlnr\src\game_shared\hl2mp\weapon_smg2.cpp file, I rename EVERYTHING to SMG2 (APART from the animations).
---------
In my EP1 halflife2.fgd (I think anyone who understands me here will know where the fgd is...), under line 3565, I put:
@PointClass base(Weapon) studio("models/weapons/w_smg2.mdl") = weapon_SMG2 : "SMG2" []
---------
In my C:\Half-Life - New Rise\hlnr\src\game_shared\hl2mp\hl2mp_gamerules.cpp file, under line 922 (there were tabs), I put:
def.AddAmmoType("SMG2",DMG_BULLET,TRACER_LINE_AND_WHIZ,0,0,225,BULLET_IMPULSE(200, 1225),0 );
---------
In my C:\Program Files\Steam\steamapps\SourceMods\half-life-newrise\resource\hl2_english.txt file, under line 42 (there were tabs), I put:
"HL2_SMG2""SMG-SILENCED\n(SUBMACHINE GUN WITH SILENCER)"
---------
I put all my worldmodels (and viewmodels) in: mymod\models\weapons
I put all my VIEWmodel materials in: mymod\materials\models\weapons\v_smg2
I put all my WORLDmodel materials in: mymod\materials\models\weapons\w_smg2
I put all my sounds in: mymod\sound\weapons\smg2
Please help me. I'm actually quite upset about this. My mod weaponry is kinda becoming a fail and it's also a de-motivator to carry it on. :(
Link to weapon I'm using: [url]http://www.garrysmod.org/downloads/?a=view&id=72192[/url]
Thanks if you helped.
How does it not work?
Any errors in the console?
Compiling console? No. It dosen't even show up on the entities list.
[QUOTE=Firegod522;18701772]WHOA
Please wrap that in [code][ code] [/ code][/code] boxes without the space
[/QUOTE]
WHOA
Please wrap that in [noparse][noparse][/noparse][/noparse]
neat shit isnt it
so it would be [noparse][code][/code][/noparse]
[QUOTE=GaryNuman;18711443]WHOA
Please wrap that in [noparse][noparse][/noparse][/noparse]
neat shit isnt it
so it would be [noparse][code][/code][/noparse][/QUOTE]
ah... the joy's of wrapping noparse tags around noparse tags... [noparse][noparse][noparse][/noparse][/noparse][/noparse]
:smug:
Ok, It's meant to be wrapped. I get it.
Can my problem please be answered?
[editline]05:57PM[/editline]
[QUOTE=HiddenMyst;18710262]Did you add it to the FGD?[/QUOTE]
Yes, but when I added it to the fgd, and loaded hammer, it wasn't there. So I went back to look at the fgd, and the line of code I put in was gone!
Hammer disagrees with my scripting somehow...
You didn't add it to the FGD. Type in the weapon's name manually and it should work.
[QUOTE=SnakeFace;18715370]You didn't add it to the FGD. Type in the weapon's name manually and it should work.[/QUOTE]
I think I did, but it may not be in the FGD that I posted cause it was the reset one.
This is what I put under line 3564:
@PointClass base(Weapon) studio("models/weapons/w_smg2.mdl") = weapon_SMG2 : "SMG2" []
I have also tried:
@PointClass base(Weapon) studio("models/weapons/w_smg2.mdl") = weapon_smg2 : "SMG2" []
Thats what you mean by manually putting it in right?
Sorry, you need to Log In to post a reply to this thread.