Need help with custom weapon (sawed-off) Created 5 months ago2022-03-07 16:28:18 UTC by 512DXII 512DXII

Created 5 months ago2022-03-07 16:28:18 UTC by 512DXII 512DXII

Posted 5 months ago2022-03-07 16:28:18 UTC Post #346330
Hello TWHL community! I got stuck on making sawed off shotgun, i tried to modify vanilla one but it has different mechanics so i decided to make it from scratch.
I have a model (view, world, player) with few animations (idle, draw, holster, reload, shoot&reload combined (unused now)).

the model itself

I think i already 'imported' it to the game, i can place it on a map and it has place in hud, it has its own class, MAX_CLIP/CARRY, DEFAULT_GIVE, but it has broken animations, its almost a copy of vanilla shotgun, i want to change its mechanics to simpler, to write it from scratch in few words =)

with my knowledge i can probably make a joke version of it with infinite bullets to place it as secret, but thats silly, i want to learn how to make weapons =--)

i want it to simply shoot using two barrels and then reload two shells using shoot&reload animation
also how do code interact with model animations?

help me please

(my english is a bit clumsy btw, sorry =)
Posted 5 months ago2022-03-08 15:49:10 UTC Post #346333
Hi there! You could take a look at how other mods have done this. This site has a list of open source mods: It looks like Half-Rats Parasomnia has a double-barrelled shotgun.

You might find the article Weapons Programming - High-Level Overview helpful. A lot of other articles on weapons programming for Half-Life are outdated.

As for the model I would again suggest taking a look at existing work.

Come to think of it, Deathmatch Classic has a double-barrelled shotgun you could take a look at
You must be logged in to post a response.