Model hex
From GMod Wiki
This page has multiple issues. See the Page Details section for information. |
Scripted Weapons: Model hex
|
So you want to know how to hex models and put them in an SWEP!
Since I am getting lazy about making sweps, I’m going to teach you how to make your own. And I know when I was trying to learn to make sweps I could not find something like this. Trust me I know these may seem long, but hexing is just renaming things. When you know how to do this, it becomes fun.
1. You need this hexing program: XVI32 http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm
2. Then you need a skin, to make it easy I found one for you, I chose one for you. http://www.fpsbanana.com/skins/16280
3. Now put all model and material rar files into a folder
4. Here comes the easy part Now open up XVI32
You will see this (Don’t be scared! It’s very easy)
5. Now click open and go to the folder you put the stuff in. Then click "v_pist_deagle.mdl"
6. Now you are like holy crap! (Remember this is the easy part) Click on the letter (D)
in "v_pist_<d>eagle.mdl" and charnge it to: "v_pist_geagle.mdl" then save the file...
7. Then open up "w_pist_deagle.mdl" and do the same thing!
8.Now that you are done with that, go to your folder with the stuff in it. Go here (your folder)\models\weapons
and change it to this (Change all to geagle).
9. Now let’s add the script for the sound. Go back to your rar file and open it up.
Then open up the script.
10. Now change all of these parts to geagle "ALL OF THEM!"
11. Now when you do that, right click and select all. Then go to your Garry’s mod folder and go here... C:\Program Files\Steam\SteamApps\[your username here]\garrysmod\garrysmod\scripts\sounds_csweapons
12. Open this up, then go to the bottom and paste this...
13. If you notice this doesn’t have a script for the firing sound so let’s make one.
Find this
copy this then go to the bottom and paste it...
14. Change it to Weapon_OSHIT.Single
and do the same thing as step 10!
15. Lets talk lua... Go here in your gmod folder. \garrysmod\garrysmod\lua.. .then go to weapons. [[Image:11ru8.jpg]|none|thumb|300px|\Valve\Steam\SteamApps\SourceMods\lua\weapons] Then make a new folder, call it whatever the hell you want.
16.Go into counter strike and find deagle lua, then copy It.
17.Go Into your folder and paste it in your folder (then rename it). I renamed it "Gold Dragon DE" Then open it up.
18. Ok, first change this,
To this, Weapon_OSHIT.Single
Then go down to here and change these to
And change them to this v_pist_Geagle.mdl w_pist_Geagle.mdl
19. Then we go all the way back to the main part of the gmod folder garrysmod\garrysmod Then go to sound, then to weapons. If there are none there, make one... Then go to your rar file and then to sound then copy the deagle folder and paste this in the sound/weapons folder.
Then rename this "Geagle"!
20. Your old folder, where you had you model and materials, copy and paste them into your gmod folder. (Why copy and paste? well because if you want to release it as a pack you don't want to go back looking for these files trust me!)
That's it you're done.
Now here's the hard part. The hard part is finding css models that actually are good, and don’t suck to begin with. Also, they will be different almost every time.
READ THIS!
Here are some of the best tips, they will save you a lot of time! When you download a skin, check these things!
Models & materials: sometimes when you get a skin, it won't contain a world model. This isn’t a real problem but your model won't have a third person view relating to your skin. Then this is really important! (It happens a lot!) When you’re hexing on v and w models go down a look. (Not on our deagle we got lucky)
Where it is pointing at is sometimes where it will say the default name. Sometimes not only don’t we have to hex the model but the materials it self. So when this happens do this.
Change it to Geagle like we did before (With both v and w model)
Then in your own made folder go to the materials and then do this go here <your folder>\materials\models\weapons\v_models
This is were it would say the default name, just change it to geagle (if it was deagle) like we always do. Then open that folder up. Then you would see something like this.
Then you would change the 1kb sized files to open up in notepad so that it will open manually after that. When you open up these files they will look like this. (ONLY change the crap with the notepad files)
This is where the name should be, you want to change all of them to geagle. (If there are more, change all of them!)
Then do the same thing to everything with the world model stuff!
Sounds & scripts: When you download the skin, Look in the script. If it has the default sounds, they will not work (except the firing sound). But the default sounds should work. (In rare cases they don’t O: )
Oh and here are some question and answers for you.
Q: Can any skin have custom sounds?
A: "No only with the firing sound, unless the script doesn’t take over the default name."
Q: What does it mean when the sweps are black and pink?
A: "That means it can't find the textures."
Q: What does it mean when there is an error?
A: "It can't detect the model."
Q: Why won't the sound work?"
A: "Ok something dealing with the chain of lua to the cs_script and to the sound folder, check all these and see if the path is right."
Q: What if a certain part of my model is pink and black?
A: "Don’t panic, first this deals with what I just said above with models and materials, look close, observe that they say "bullet" or "scope". "Get It?"
Q: Were you up late doing this?
A: "Hell yes, if I spelled something wrong, I’m sorry, and don’t be a prick and say that my clock was saying something because it isn’t set right!"
Other tip you might want to know...
Any file dealing with a silencer, delete it. Well it's your choice but you can't use silencers in gmod... Not yet at least.
And also, remember that you can put these models in any type of lua script. It doesn’t have to be its own. (Example: mp5 can work for m4)
How to add a grenade launcher:
end function onSecondaryAttack() if (_PlayerInfo(Owner, "alive") == false) then return; end nade = _EntCreate("grenade_ar2") _EntSetPos(nade,_PlayerGetShootPos(Owner)) _EntSetAng(nade,_PlayerGetShootAng(Owner)) _EntSetKeyValue(nade,"damage",100) _EntSetOwner(nade,Owner) _EntSpawn(nade) _EntSetVelocity(nade,vecMul(vector3(2000,2000,2000),_PlayerGetShootAng(Owner))) _EntEmitSound(Owner,"weapons/grenade_launcher1.wav") _SWEPUseAmmo(MyIndex,1,1) lastnadefired = _CurTime() secOVR = 3 end
Put this after "_SWEPSetSound" and before "-- Weapon settings." (Thanks to "VtnmRbl" for this lua)
I hope that this helps! I would have killed to have something like this when I was trying to learn!
You should come up with a hell of a tight deagle!
"It's bound for you to run into a problem so keep on trying!"
Phatcat 19:49, 2 January 2007 (GMT Standard Time) Original instructions by SKULLY-V [1]
Page Details
This page needs reviewing. An expert needs to verify that all of the information in this page is correct. See more articles for review here. |
This page needs to be edited as it contains information that is unclear or incorrect. Improvement can be discussed on the talk page. Find more pages that need work here. Details: Incorrect Syntax |
This article might not be up to date as it uses Garry's Mod 9 syntax. |