Post tutorial Report RSS Coding Custom Weapons Part 3 Of 3 Finishing Up

Well this is the final part of the tutorial, there is no coding and it is really shot compared to the other two. This will go over the final files you need to get your weapon to work perfectly.

Posted by on - Basic Other

So we are at the end of the tutorial finally this will be very simple. Open up your mod folder, some people may have this, I think the premade folder I made for the Half-Life Modding Kit has it in it but if you don't add a folder called events if you do have it open it up

Now here we are going to add the event file for are gun, open up notepad (I think you can do this in word but most modding stuff you want the basic text editors such as notepad or wordpad) You can leave it blank though some mods put code in it, I don't know what this code does you would have to ask some one about it. Click Save As, change the save type to all files, and name it colt.sc (or what ever you named the event file in the code), this is very important to make sure it saves as a sc file, sometimes it will save as a colt.sc.txt which is just a text file. Back out of that folder and go into your sprites folder, most of you will have this if you don't just add a folder call sprites. Here add a new text file called weapon_colt It is important this time you save it as a .txt file and not a .sc file. Open it up and add this


10
weapon 320 320hud1 0 40 80 20
weapon_s 320 320hud1 0 60 80 20
ammo 320 320hud2 0 16 18 18
crosshair 320 crosshairs 24 0 24 24
autoaim 320 crosshairs 0 72 24 24
weapon 640 640hud1 0 45 170 45
weapon_s 640 640hud4 0 45 170 45
ammo 640 640hud7 0 72 24 24
crosshair 640 crosshairs 24 0 24 24
autoaim 640 crosshairs 0 72 24 24

This is all for the hud, for example crosshair 320 crosshairs 24 0 24 24 tells it to choose a certain cross hair, I think I will make a tutorial later explaining more about this and how to make a custom hud sprite. This file is not required like the event file was but without it it will display the whole default hud at once. These last to are obvious but very simple, go to your models folder and add ALL models you have referenced in the code, without them the player will be removed from the game if one tries to spawn, I have forgotten to do this on many of the weapons I coded even if I knew I had to do it I start the mod up to test it then remember I forgot to add them. Then open up the sound folder and add any sounds referenced in the code, without it your gun will be silent and boring.

There you go you have just finished your first weapon, fun right? Don't worry it gets easier as you do it, before I had all the files and what lines to code written down now I just know them by memory. I hoped it worked for you if not just message me and I am sure we can figure it out

Post comment Comments
Red_Fire_Gaming
Red_Fire_Gaming - - 35 comments

So i managed to create a weapon thanks to this guide, i called it the auto shotgun. But i have a problem; The autoshotgun doesn't deal damage to anything at all, even though everything else like the shooting effects and firing animations work just fine, it simply doesn't deal damage, not even blood comes out of the npc i'm shooting at, it's like the bullets dissapear. I made a pastebin for you to check out what i've done wrong in the code, any help would be highly appreciated! :)

Pastebin.com

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: