Changing BM weapon FOV

I want to import weapons from BM into HL2. However, the BM weapons have a different FOV than those in HL2.

The default viewmodel_fov in HL2 is 54. In order to display BM weapons properly, it needs to be changed to 90, but that makes the HL2 weapons display improperly.

There’s no way to change the viewmodel_fov per-weapon, so the model itself needs to be changed.

I tried decompiling the magnum with Cannonfodder’s StudioCompiler, changing the FOV angle in XSI, and then recompiling, but the model became invisible in HL2.

I’m completely new at this, so I have no idea what’s going on… any help would be appreciated :slight_smile:

Edit: apparently, viewmodel_fov isn’t even used in BM. It’s set to -1.

I was about to post a mini-tutorial, but I need to check if it really works (need to install HL2, again), before posting said tutorial (I made a backup of it) - don’t want to offend anyone by posting “BS”, again.

Note: I’ll edit this post to the one I’ve prepared, after I’ve confirmed for myself that it actually works.

Just need to wait for the installation to finish…


Excuse the rather ‘useless’ post, but I need to make sure that what I am about to submit, as a new reply to this thread, does actually work. :wink:


EDIT (01:29 AM): Ok, I tried to get it to work now, but it seems that HL2 does not even load the script files I added. So much about that, I guess…

Sorry about the useless post… :frowning:

Yeah, I noticed that too :frowning: I tried adding fov 90 to the weapon script file, but nothing changes.

I also just noticed that replacing files in hl2 doesn’t replace the same files in the episodes. Unless I’m missing something, there doesn’t seem to be a way to replace basic files that are shared between the HL2 games for all the HL2 games :frowning:

Edit: script files do work in the episodes though, so maybe you could try your solution with that and post it if it works?

Grr, it is kind of funny - just after editing the post I had found a thread in another forum, where someone asked how to edit or add script files to HL2 - I tried that and now it works (apparently). :rolleyes:

It appears that the FOV is a bit weird, though.

I tested with a value of 150 now and it seems that, the higher the value the closer / smaller the gun gets.

I’ll test another one and see if it actually does change / which value I need to increase the weapons fov (instead of decreasing it), then edit the reply I prepared and add it here.

Until then,

  • Jen :slight_smile:

Oh, I’d really like to know how add/edit script to HL2 as well, so if you could post that link, would be great :3 My searches didn’t turn up anything :frowning:

Thanks for the help, I hope it works :slight_smile:

if you dont want the animations, you can just port the crowbar textures over to hl2 (as the textures are the same sheet)

Hmm, this is kind of strange… The game does use the script, but it does not seem to apply the edited “fov” value.

I tried to change “fov” to “v_fov” and “viewmodel_fov”, as well - it does not seem to change or apply in-game, though.

To confirm that it does load the script file:

…/scripts/weapon_357.txt:

WeaponData 
{ 
	"printname"  "ISeeSpy!" 
	"viewmodel"  "models/weapons/v_357.mdl" 
	"playermodel"  "models/weapons/w_357.mdl" 
	"anim_prefix"  "python" 
	"bucket"  "1" 
	"bucket_position" "1" 
	"clip_size"  "6" 
	"default_clip"  "6" 
	"primary_ammo"  "357" 
	"secondary_ammo" "None" 
	"weight"  "7" 
	"item_flags"  "0" 
	"damage"  "75"
	"fov"	"90"
}

Note: There’s no icon for the weapon, since its location has not been specified in the script.

You’ll also notice that the weapon uses both its original HL2 model and textures - as I want to change the fov first / get it to work in-game.


I thought this’d be relatively easy, guess I thought wrong, again.

I’ll look and see if I can find any solution for this, then report back if I found anything useful…

I tried “fov” and “viewmodel_fov” without success, too :frowning: I’ve been messing around and searching all night. Really hope you find a solution!

And thanks for the script fix!

Going to bed now :tired:

Actually, I want only the animations. The models for the crowbar and the magnum are the same anyway, and I want to keep the HL2 textures.

This is somewhat tedious…

I’ve been googleing all kinds of different keywords, to somehow find something useful, but I didn’t find anything that works, yet.

It seems that, either I am using the wrong variables inside the script (“fov”, etc.) or that something has to be hardcoded, so the game actually recognizes the fov variable, inside the script.

For some reason, changing said variable inside a script for Black Mesa does have an effect in-game, while it does not for HL2 - which strengthens the assumption that it probably has to do with a missing hardcoded segment.


In the meantime - there are 3 articles and 2 categorys I found, which could be worth looking at:

Note: “v-” and “-v” are supposed to be arrows, pointing down.

v- The three (3) articles -v

Easy weapon model changing - developer.valvesoftware.com

Importing CSS Weapons Into HL2 - developer.valvesoftware.com

Weapon script - developer.valvesoftware.com

v- The two (2) categorys -v

Category :stuck_out_tongue: OV cleanup - developer.valvesoftware.com

Category:Weapons programming - developer.valvesoftware.com


A side-note:

The game does not need the “weapon_manifest.txt” file, this was a mistake on my part (I thought HL2 would need it, just as BM does), since the edited “printname” “ISeeSpy!” still loads in-game.


EDIT (04:18 AM): Just tried overwriting the HL2 client.dll and server.dll with the ones from BM - I expected a crash, but after closing the (working) game and looking inside the (bin) folder, where I had placed the .dll files, it seems that Half Life 2 checks the contents of said folder and replaces them with the original files (probably from inside one of the .gcf archives), on start-up.


EDIT (04:33 AM): Creating a script that only changes the command “viewmodel_fov”'s value for a specific slot, upon weapon switch is the only option / solution I can think of right now.

I’ll see if I can find one, then see if it works.

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.