How to import guns from other GoldSource Created 8 years ago2016-01-22 20:47:25 UTC by KB90 KB90

Created 8 years ago2016-01-22 20:47:25 UTC by KB90 KB90

Posted 8 years ago2016-01-22 20:47:25 UTC Post #328442
Hello. So for example what is the easiest way to import two pistols from Counter-Strike and sniper rifle from Day of Defeat in my mod, and make them behave like in games they came from, with all animations etc.

Thank you!
Posted 8 years ago2016-01-22 20:58:03 UTC Post #328443
You can just copy the model files. But it's not proper modding etiquette without the author's permission.
Posted 8 years ago2016-01-22 21:05:12 UTC Post #328444
So copying models will came with all specifications of weapon (zoom, number of bullets, damage etc.)? If I take these models from official valve mods (CS, DoD etc.) reskin them and use in my own imagine universe? - is that cool for non profit mod?
Posted 8 years ago2016-01-22 21:35:14 UTC Post #328445
So copying models will came with all specifications of weapon (zoom, number of bullets, damage etc.)?
No. You'll need to write code and compile new DLLs. Do you know any programming?
If I take these models from official valve mods (CS, DoD etc.) reskin them and use in my own imagine universe? - is that cool for non profit mod?
Depends on who you ask and how much you take. There's no common etiquette - different people will have different opinions on what's acceptable. It's illegal in most places, but I doubt Valve cares, they're probably just happy people are still making mods, potentially giving people more reasons to buy their old game.
Oskar Potatis Oskar Potatis🦔
Posted 8 years ago2016-01-22 22:26:46 UTC Post #328446
No. I don't know much programming. I was hoping I could copy everything.
Posted 8 years ago2016-01-22 22:43:50 UTC Post #328447
Unfortunately adding new weapons requires them to be custom coded. If you wanted to change an existing weapon, you could replace the sounds and models with the files of a different gun, but it would still behave like the original HL gun.
Penguinboy PenguinboyHaha, I died again!
Posted 8 years ago2016-01-23 13:31:18 UTC Post #328448
Just done that, and it is not so smooth. I have used five-seven model from Couter-Strike, and player holds in in left side, also some animations missing for example there is no animation if I want to reload gun, however animation appears when I ran out of bullets, then it reloads.
Is there any tutorials you could point me to about all this?
Posted 8 years ago2016-01-23 14:44:33 UTC Post #328449
I indeed would not recommend this for a mod, but you can get a decompile tool here:
http://www.moddb.com/games/counter-strike/downloads/kratistos-goldsource-mdl-decompilier-2003
The .qc can by opened with the windows editor and you might want to think yourself a bit in there. Its not very difficult to adjust the animations for a different game.
I did the same thing for a 1.5 deagle which I use in hldm:
https://www.youtube.com/watch?v=ZXt7FJCsWyk //In the video it's a glock replacement which is a little pointless, now it replaces the .357 for me.
I think in cs 1.5 there were different models for right handed and left handed models.
Posted 8 years ago2016-01-23 17:41:18 UTC Post #328450
Thinking about i, i probably used another tool to decompile it because the one that I linked above can't recompile the model. So you need a tool that can decompile a model and compile it again (after you made your changes)
Posted 8 years ago2016-01-23 19:07:08 UTC Post #328451
HLMV has options for decompiling and recompiling models. You need Studiomdl and mdldec programs however. Which are the compilers and decompilers respectively.

you can find both here: http://www.wunderboy.org/apps/jhlmv.php and http://www.wunderboy.org/goldsourceapps.php
Tetsu0 Tetsu0Positive Chaos
Posted 8 years ago2016-01-23 19:08:03 UTC Post #328452
Thanks I'm using Jed's Half Life Model Viewer. I have opened that .qc file. And I don't really understand what changes I need to make...
Posted 8 years ago2016-01-23 19:58:30 UTC Post #328453
Alright you still need to code the new weapons into the old game. The QC file is a compiler script that tells the tools how to create the model. It references animations, base meshes and textures to create a .mdl file.

Unfortunately, that's all i know.
Tetsu0 Tetsu0Positive Chaos
Posted 8 years ago2016-01-26 11:52:58 UTC Post #328500
There is a tool called GFlip that allow you to switch between left/right handed for view models, you can use that for CS models.

As for the QC file modifications, you need to decompile the MDL of the original weapon (I'm going to assume HL's Colt Python .357) and look at the order of the animations. The goal is to match the animations order of the replacement (I'm going to assume CS's Five Seven) with the original.

For example : if the animation order of the Colt Python .357 is :

idle1
idle2
idle3
shoot
reload

Then in your CS's Five Seven replacement, it has to be :

idle1
idle2
idle3
shoot
reload
Posted 8 years ago2016-01-27 09:30:58 UTC Post #328511
Shepard62700FR , Thank you. I will try it today!

Just checked it out. So colt has 10 animations:
// 10 animation sequence(s)
$sequence "idle1" "idle1" fps 16 loop
$sequence "idle2" "idle2" fps 16 loop
$sequence "idle3" "idle3" fps 14 loop
$sequence "shoot" "shoot" fps 25 { event 5001 0 "11" }
$sequence "shoot_empty" "shoot_empty" fps 25 { event 5001 0 "11" }
$sequence "reload" "reload" fps 18 { event 5004 4 "items/9mmclip2.wav" } { event 5004 23 "items/9mmclip1.wav" }
$sequence "reload_noshot" "reload_noshot" fps 18 { event 5004 4 "items/9mmclip2.wav" } { event 5004 23 "items/9mmclip1.wav" }
$sequence "draw" "draw" fps 16
$sequence "holster" "holster" fps 16
$sequence "add_silencer" "add_silencer" fps 18

And Five Seven only has 6:

// 6 animation sequence(s)
$sequence "idle1" "idle1" fps 16
$sequence "shoot1" "shoot1" fps 36 { event 5001 0 "11" }
$sequence "shoot2" "shoot2" fps 36 { event 5001 0 "11" }
$sequence "shoot_empty" "shoot_empty" fps 36 { event 5001 0 "11" }
$sequence "reload" "reload" fps 30 {
{ event 5004 15 "weapons/fiveseven_clipout.wav" }
{ event 5004 41 "weapons/fiveseven_clipin.wav" }
{ event 5004 75 "weapons/fiveseven_sliderelease.wav" }
}
$sequence "draw" "draw" fps 30 { event 5004 13 "weapons/fiveseven_slidepull.wav" }

What should I do?
Posted 8 years ago2016-01-27 14:44:05 UTC Post #328512
The original weapon you decompiled is not the Colt Python .357, it's the Glock 17 9mm, not a big deal, it's the same.

As you can see, there is a difference of animation count, something you can do is duplicate existing animations of the same kind or if you have the skills and the courage : create new animations.

I'm going to assume you have chosen the first option which is "duplicating the existing animations". All you have to do is copy/paste lines, the final QC file should look like this :

$sequence "idle1" "idle1" fps 16
$sequence "idle2" "idle1" fps 16
$sequence "idle3" "idle1" fps 16
$sequence "shoot1" "shoot1" fps 36 { event 5001 0 "11" }
$sequence "shoot_empty" "shoot_empty" fps 36 { event 5001 0 "11" }
$sequence "reload" "reload" fps 30 {
{ event 5004 15 "weapons/fiveseven_clipout.wav" }
{ event 5004 41 "weapons/fiveseven_clipin.wav" }
{ event 5004 75 "weapons/fiveseven_sliderelease.wav" }
}
$sequence "reload_empty" "reload" fps 30 {
{ event 5004 15 "weapons/fiveseven_clipout.wav" }
{ event 5004 41 "weapons/fiveseven_clipin.wav" }
{ event 5004 75 "weapons/fiveseven_sliderelease.wav" }
}
$sequence "draw" "draw" fps 30 { event 5004 13 "weapons/fiveseven_slidepull.wav" }

You can remove the "shoot2.smd" file in the folder of the decompiled Five Seven since you will no longer need it.

First thing to notice is that I haven't included the "holster" and "add_silencer" animations. The reason of why I have done that is because those animations are never played on vanilla HL and they are last. However, if the "holster" animation wasn't last in the original, then I would be forced to add it in order to match the animations order.

Second thing to note : it's not very important that names matches between the original and the replacement. The animation is chosen based on their index, in other words : Half-Life says : "Can you play the 5th animation ?", "Can you play the 3rd animation ?". It doesn't say : "Can you play the animation called 'reload' ?".
Posted 8 years ago2016-01-28 10:28:02 UTC Post #328522
Ok. Thank you very much.
You must be logged in to post a response.