How can I change the following weapon attributes?

I would really appreciate it if I got some help with doing these changes. I’ve tried by myself but so far I’ve been unsuccesful.

a) In the .dmx-files there are references to something called “WeaponParamsDef”, does anyone know where this file can be found or if it exists?

b) How do I change how much ammo the shotgun uses up when using the secondary fire?

c) How do I change a weapons fire mode, for example, full auto to semi-auto?

d) How do I change which animations a weapon uses?

Any help I can get I would be really greatful for.

A.) Likely just some basic setup line, doubt changing it would do anything good.

B.) Can’t to my knowledge, at least not with the dmx file. Maybe there’s a console command, but I doubt it.

C.) I think all (non throwing) weapons are technically full auto, where as you hold down the attack button and they keep shooting. To get them up to a full auto speed, you would need to replace the model with one that has sped up fire animations. For obvious reasons this wouldn’t work for multiplayer unless it’s installed on the server.

D.) Depending on what you mean, either:
View (first person) model: you would need to replace the weapon’s model, the different activity names (ACT_VM_IDLE, etc.) are the guide to the game for what sequences to use. You can use multiple different sequences on the same activity, and the game will randomly pick one based on the weight (the number after the activity name, higher weights are more likely to happen).
World (third person) model: In the weapon’s dmx file, edit the value of “anim_prefix” “string” “[WEAPON NAME HERE]”.

Thanks for your reply, I was only intending to use this in single-player or sp-maps, so multiplayer compability doesn’t have to be considered.

b) This was one of the most important changes I wanted to make. I wanted to replace the shotguns ridiculously unrealistic secondary fire-mode. Preferably I wanted to make it semi-automatic instead, otherwise make it a copy of the primary fire-mode and work from there. In worst case, remove it all together. Do you think any of these are possible?

c) I know most of the weapons are basically full-automatic already, I was wondering if this could be changed somewhere. It must be defined in some file somewhere.

d) Can you tell me where to find those files? Not the actual animations, but the files telling the games what animation to use. What file should I extract to find them?

Thanks in advance.

You could make its secondary fire fire faster, but it’ll still use two shots. The activity names are built into the models themselves, so you’ll be replacing “models/weapons/v_shotgun.mdl” (and its four other model files there). Like I said for C, if the replacement model has faster animations for its firing(either just a couple frames or a higher fps) it could easily reach full auto pace.

You won’t be able to do things like completely overhaul the way weapons work. The .dmx’s are just for basic values.

You can’t edit the basic weapon functionality without going into the game code. As our game code is not publicly available (yet), you will not be able to do these. None of them.

removing doubleblast from HL is a sin… since sven-coop changed most of it’s weapons in version 4.0, I don’t play it anymore. It’s just not Half-Life anymore… and that semi-automatic shotgun is just unbalanced like hell.

Is it possible to instead of changing a fire-mode, making it so that the primary fire-mode is used for both? To connect the use of secondary fire to the primary attack?

When will this code be avaliable? When will we be able to change these things freely?

I expected some people to react like this but no one is forcing you to play this kind of mod?

The game code won’t be of much use to you anyway unless you are a programmer and know how to code in C++.

I know our lead programmer would like to put out our code at some point in the future but there are a number of hurdles to cross first and I don’t believe we have tried yet. It may never happen, but if it does, it will not be for a long time.

Rather than altering the shotguns secondary fire-mode, is it possible to somehow tell the game to use the primary fire-mode instead, thus binding primary fire to both fire-modes? Otherwise, is it possible to make it do anything else than what it is currently doing? Thanks in advance for the replies.

Altering weapon functionality is not possible without altering the game code, it’s as simple as that. What you can do with the .dmx and weapon values is the limit to what you are able to customise without touching the game code. That’s just the way it is set up.

I understand then. One final thing though, where do I modify what animations a weapon would be using, and in what order and so on?

There seems to be things you can edit in the .mdl-files, but when I try to open it it’s unreadable, what kind of editor do I need for that?

I…don’t know what this question is asking.

You have to decompile a .mdl into a .smd using a decompiler. You then have to import the .smd into supported modelling software or convert it into a format which your program can read. What happens beyond that point is a process only understood by mythical beings known as animators or modellers. I have no idea what the heck the “order” of an animation could possibly be referring to, though.

It would help to read up on Source - what you want to do is fairly ambitious and there’s plenty of documentation around to help you learn how to get there, or if it’s possible at all.

I wish I could edit the viewmodel fov for them so the guns are less cramped up in my face but i dont see a value unfortunately :frowning:

Not to derail, but that’s the fov line in the dmx file. Looks something like this:

“fov_viewmodel” “float” “50”

where can i find these dmx files and can i play online with modified dmx files?

You cannot play online with modified .dmx files. That’s the whole purpose of a .dmx file. They’re an added layer of security for MP to prevent people from hacking values easily.

Alright, I can let my previous questions be for now, but I have also found two other things I wanted to ask about, if it’s okay to ask here instead of creating a new thread.

Where are the weapon sound files located? I have not been able to extract any sound files from the .vpk-files.

In the resource folder, there are many files containing various text related information, but altering text inside them does not seem to have any effect in-game ,even after I recompress them into .vpk-files and put them in the addons folder. What do I have to do to make this work?

Thanks again for all the replies, I appreciate it a lot.

I currently program in primarily C++ and C# (with JavaScript splashed in when C# is kicking my ass regarding a specific portion of functionality), and model utilizing Blender (cause it’s free and stuff), and although I have lately been spoiled by Unity’s UI and Mono Developer, from what I understand it seems like you’d need to dabble a little in both worlds to achieve what you’re attempting to do. First and foremost, you would need access to the actual script, as TextFAMGUY1 mentioned, to do things like adjust how much ammo is consumed during each fire. Changing the animation would do just that–change the animation. You could replace the shotgun model with a dancing banana, but that right click is still going to consume 2 ammo. As for customizing the animations, you would need to import the model assets into a 3D software tool like Blender (free) or 3DS Max (not so much) and recreate the animations; or create your own models and animations from scratch–then these animations could be called later via the script.

If you were able to completely de-compile the script, most of the things you are suggesting could be done with a bit of patience and creativity. However, unless you know most of the ins and outs of the programming language you’re using (in this case, C++), as well as the (hopefully) consistent methodology employed by the team, you might end up creating a mess of the rest of the game–calling variables and the sort without fully understanding what you’re doing (or, shudder, copy+pasting code willy-nilly) could mangle other portions of code, cause program flow issues, and generally create a bug-laden experience.

That said, there are some fantastic resources out there if you have the patience to teach yourself C++ (Old Faithful) or another, similar language. I’ve found Unity to be very accommodating in terms of the easy-to-use modeling and object-oriented interface and the option to use C#, JavaScript or Boo (P.S. My personal suggestion is to go with C# if you plan on doing this for a while). Just keep in mind that a UI like Unity will, eventually, make you lazy–calling and manipulating objects through the UI is great, but you’re not getting the scripting practice. Also, don’t get too bogged down with learning one language–programming is a bit like art, and it’s more a mindset than an actual rote implementation of variables and functions. In fact, we could know the exact same language, but my script might differ significantly from yours–yet the compiled scripts perform the same function. It’s just that yours might be 4 lines, tightly-written and majestic, while mine is a great galumphing beast of wasted space.

Anyhow, just my $.02.

Founded in 2004, Leakfree.org became one of the first online communities dedicated to Valve’s Source engine development. It is more famously known for the formation of Black Mesa: Source under the 'Leakfree Modification Team' handle in September 2004.