switching primary & secondary fire

slicer

Newbie
Joined
Jul 18, 2004
Messages
39
Reaction score
0
Ok i have close to none previus coding experience and is playing around with the HL2DM code.

here is what i want to do:

make a grenate-launcher bu taking the secondary fire from the smg.

i have managed to disable normal SMG fire, change the moddle og the gun and change the ammo capacety, but how do i make trowing launching granates primary fire insted of secondary?
 
does this launcher launch chunks of granite lol sorry i cant help you but is there really any point in doing that?
 
crackhead said:
does this launcher launch chunks of granite lol sorry i cant help you but is there really any point in doing that?

Was there any point in posting that either? didn't think so.
If you can't help, dont reply.
 
Same could be said for ^
kidding :)

Could you post us the code you modified? You might be able to get away with it by calling the "smg grenade launcher" function in the rocket launcher gun code. So you'd have your rocket launcher, then secondary fire would call smggrenade();. (btw, that's an example of the function, I have no clue if it even works this way)
 
all i done so far is modefying weapon_smg.txt:

// granate launcher

WeaponData
{
// Weapon data is loaded by both the Game and Client DLLs.
"printname" "#granate launcher"
"viewmodel" "models/weapons/v_shotgun.mdl"
"playermodel" "models/weapons/w_shotgun.mdl" //FIXME:
"anim_prefix" "smg2"
"bucket" "2"
"bucket_position" "0"

"clip_size" "0"
"clip2_size" "-1"

"default_clip" "0"
"default_clip2" "-1"

"primary_ammo" "SMG_granate"
"secondary_ammo" "SMG1"

"weight" "5"
"item_flags" "0"
"damage" "5"
 
Erm... You could just override Secondaryattack in the .h file to return 0, and then override Primaryattack in the .h, then rename SecondaryAttack in weapon_smg1.cpp to PrimaryAttack.cpp.

Or something.

-Angry Lawyer
 
yeah just copy the code from secondaryattack into primaryattack. Should only need minor changes, if any.
 
Back
Top