PDA

View Full Version : SMG1 and AR2 not firing at all...


Maxunit
01-23-2008, 11:02 AM
Hi there guys,

I modding Half-Life 2 since yesterday using the HL2 DM SDK Part.
I found this link Adding Firing Modes to your weapons (http://developer.valvesoftware.com/wiki/Adding_Firing_Modes_to_your_weapons) but my SMG1 and AR2 wont really shoot at all. Sounds play, animations play, sprites there etc..but no bullets flying, no damage causing. Can anyone help me and tell me what I did wrong?

Greetz,

Maxunit

Maxunit
01-23-2008, 04:10 PM
20 views, noone who can help me? I don't expect people to reply directly with a uber leet hax solution but maybe gimme a hint, what i did wrong or what to do different compared to the tut to remove the bugs i have so far :P

buckmeister
01-23-2008, 11:19 PM
If both SMG and AR2 are affected, your problem's probably in weapon_hl2mpbase_machinegun.cpp or weapon_hl2mpbase_machinegun.h

whack the code for them up :)

www.pastebin.ca

Maxunit
01-24-2008, 07:27 AM
whack the code for them up? I mean, it is in the tutorial :P When i put in the original weapon_hl2mpbase_machinegun.h and weapon_hl2mpbase_machinegun.cpp then all works again...but i will upload both codes for you :)

btw, are you german? pastebin.ca = german site, your nickname = contains german word :P (Deutsch/German: Falls ja, hast du MSN oder ICQ?)

Codes from pastebin:

weapon_hl2mpbase_machinegun.h (http://www.pastebin.ca/870947)
weapon_hl2mpbase_machinegun.cpp (http://www.pastebin.ca/870948)
weapon_smg1.cpp (http://www.pastebin.ca/870949)

Those 3 pastebin codes are the original code parts, nothing modded. Maybe you can help me what I have to re-code correctly and send me the pastebins here in the topic or via pm.

Greetz,

Maxunit

Maxunit
01-24-2008, 12:18 PM
First problems solved, now I want to modify the code from the AR2, so that my new AR2 weapon acts like the airboat gun. I found a tutorial, but following it causes many problems. Here's a link to it:

3 state rechargeable ammo (http://hl2coding.planethalflife.gamespy.com/wordpress/?p=41)

And here the code from my modified AR2(just changed the name from the weapon to Pulse Rifle and uses a different model)

Code from my Pulse Rifle (http://www.pastebin.ca/871200)

Maybe someone can point me into the right direction :)

Greetz,

Maxunit

Winston
01-24-2008, 02:41 PM
it causes many problems

Such as? .

Maxunit
01-24-2008, 02:46 PM
such as, unknown classes like the private: thing and i cant compile the code
but a mate of mine helped me a bit...i need to learn more about classes first...

Maxunit
01-24-2008, 10:55 PM
all fixed...got some help from a mate of mine :)