View Full Version : [code] Adding a New Barrel for Weapons

06-11-2003, 03:45 PM
If I want to add a barrel (at the request of the weapon modeler I'm working with) to a weapon that currently does not have one (in this case WP_THERMAL), do I just need to add it in CG_RegisterWeapon (in cg_weaponinit.c)?

Are there other areas which I'll need to pay attention to the new barrel as far as animating is concerned, or will the engine just deal with it once I've added it in CG_RegisterWeapon?



06-11-2003, 03:51 PM
If you're talking about the 1st person barrel, just copying your new md3 file over the thermal.md3 file should be the easiest way.

In terms of animating it, if you want it to spin or something, you'll have to touch up some unused code in there.

06-11-2003, 04:08 PM
...just to narrow my search down, would that pretty much be all client-side code that I'll be working with?

06-11-2003, 04:30 PM
Yeah, except for adjusting the origin of the weapon's 'bullet' - that's serverside.

06-11-2003, 04:38 PM
Which, in this case, isn't going to be that big of a problem since I'm not changing the behavior of the thermal...

Salv just wants to add some better animation from the players perspective, so I think I'm good to go here.

Thanks for the help!


06-15-2003, 12:14 AM
Well, all the animations are controlled server side, but you could do a client side hack to make the animation for thermal tossing be something else. I wouldn't totally recommend that thou as the length of the toss animation probably isn't the same as the replacement animation.

As such, you'd probably have a problem with the player freezeing at the end of the animation, not finishing the animation, or partially repeating ithe animation before ending. To fix that sort of problem you'd have to make some changes to the PM code.

06-16-2003, 05:01 PM
Actually it looks like the edit that I did in CG_RegisterWeapon() did the trick, at least as far as I can tell with my preliminary tests...

However, I do have another related issue that I'm working on that I'll use another thread for...