Physgun Coding error

  • Thread starter Thread starter badpigeon
  • Start date Start date
B

badpigeon

Guest
Hey, I was wondering if anyone could help me with this error. I have added the physgun code to both the client, and server portions of the Sourcecode for HL2DM, and I can get the weapon ingame. It works with primary fire, but secondary fire is nonexistant. When I type "give weapon_physgun" I get the following error in the console.

"
ERROR: Weapon (weapon_physgun) using undefined secondary ammo type (Gravity)
ERROR: Weapon (weapon_physgun) using undefined secondary ammo type (Gravity)
"
The secondary ammo is the welding blobs, and I think this error has something to do with the clientside code. If anyone can help me on this it would be great!
Thanks!
 
"Gravity" is the secondary ammo type as defined in the weapon_physgun.txt script. This script is parsed by weapon_parse.cpp which calls GetAmmoDef as defined in hl2_gamerules.cpp (line 1497). In the HL2SP SDK the type "Gravity" has been inited as:
Code:
def.AddAmmoType("Gravity",DMG_CLUB,TRACER_NONE,0,0,8,0,0 );

Apparently this type isn't defined in the hl2dm sdk, which causes this error. If you add that line to the hl2dm gamerules file it should work correctly.
 
Thank you SO MUCH. Ive been trying to get this to work for hours. Your the only one on any of the forums that has helped. THANK YOU!

btw. it works! I have little dolls as my weld spots :D
 
Im working on a quick tutorial showing how to add the Physgun to Halflife2 Deathmatch Mods. I have it working without any errors! I will post the tutorial as soon as I finish it (tonight sometime)
 
Back
Top