Upvote Upvoted 23 Downvote Downvoted
Viewmodel Offset Customizer
posted in Customization
1
#1
0 Frags +

Do you wish tf_viewmodel_offset_override actually worked without sv_cheats? Well I have a solution.

You can edit a viewmodel's position by using the "$Origin" command in the animation's .qc file. This lets you position it pretty much anywhere on the screen. Wanna make them small so they don't get in the way but still easily see what weapon you're using? No problem. Do you want them to get in the way even more? Done. Maybe fancy something more exotic? Smg? Do you think all of these are really dumb? You can make your own exactly how you want them. And since this is entirely animation based, you can use them anywhere regardless of sv_pure by preloading

So I made this mod to make it easier. You can edit the viewmodel offset on a per-class basis relatively easily. Here's how you use it:

  1. Download the mod from here: https://drive.google.com/file/d/1qvLAjkPL2H9lXXho-cSe5J0PpjV1lIYE/view?usp=sharing
  2. Open the zip and extract the 0ffsetGenerator folder to your tf/custom folder. It's important not to change the name. Now enter the 0ffsetGenerator folder itself.
  3. Open 1.Settings.txt and adjust the offset values for each class to your liking.
    There is information about how the values work in that file, I'm gonna put it here too:
    Show Content
    // $Origin 0 0 0 = $Origin X Y Z
    // Edit the $Origin X Y and Z values to move your viewmodel for the class.
    // There is also the optional [z rotation] value that you can add, like this: $Origin <x> <y> <-z> [z rotation]
    // You can use negative values of course
    // The Z value is reversed
    // Go here for a good explanation of how it works: https://developer.valvesoftware.com/wiki/$origin
    // Example: I used "$Origin 0 20 15" to get some very small viewmodels.
    // Leave the values at 0 0 0 for stock offsets
    Once you changed all the values to your liking, save.
  4. Now run GENERATE.bat and hope there are no errors. It should recompile the stock animation files with the changes you made and create 0ffsetViewmodels.vpk in your custom folder.
  5. Boot up the game and take a look. If you're not happy with what you got, just edit the offset values and run GENERATE.bat again. If you are happy with what you got, remove the 0ffsetGenerator folder from custom, it's no longer needed and just increases loading times. Also remember to check with minimal viewmodels on and off.


Preloading:
Most of you are aware of what preloading is and are probably using it already. It lets you use certain mods, mostly animations, in any sv_pure setting by first loading into a sv_pure 0 server and leaving. If you're not already using a config that does that, I included Yttrium's method in the vpk file that gets generated. Simply add the line "exec preloading.cfg" to your autoexec if you want to use it.

What about custom animations?
It is possible to use this with other viewmodel animation mods and move them however.
As long as they follow the same folder structure as default tf2 animations and don't use separated c_model animations.
Unfortunately, you'll have to decompile them yourself using something like crowbar.
It's pretty easy really:

  1. If the mod comes into a vpk file, unpack that somewhere so you get the loose files. If not, skip to step 2.
  2. Now you should have the raw .mdl files. Decompile all of those in the same folder using Crowbar.
  3. Copy all the decompiled files (should be 9 c_CLASS_animations_anims folders and one matching .qc file for each) into the decompiled_animations folder inside 0ffsetGenerator. Let them override everything.


Now it should edit your chosen mod's animations instead of the default tf2 ones.
I'd really like to include the fixed viewmodels mod by default. It fixes a lot of issues, like extra arms on high fov (yes, that includes the original left hand) but I'm not sure about just adding someone else's mod like that.

Keep in mind:
This could be done better, the batch file is very basic. Hopefully, if people are interested in this, they'll find ways to improve on it.
The vpk it generates works on linux but the generator itself doesn't because it uses the studiomdl.exe bundled with tf2 and because I haven't included a bash generate file. Someone in the comments mentioned they got it working on linux via WINE so maybe look into that.
Let me know if you have any issues or have any ideas on how to improve this, I'm open to suggestions.

Also, more screenshots of small viewmodels, I really like them for some reason.

Do you wish tf_viewmodel_offset_override actually worked without sv_cheats? Well I have a solution.

You can edit a viewmodel's position by using the "$Origin" command in the animation's .qc file. This lets you position it pretty much anywhere on the screen. Wanna make them small so they don't get in the way but still easily see what weapon you're using? [url=https://i.imgur.com/iSVKind.jpg]No problem.[/url] Do you want them to get in the way even more? [url=https://i.imgur.com/GL0MclV.jpg]Done.[/url] Maybe fancy something [url=https://i.imgur.com/0Nlv1Gl.jpg]more exotic[/url]? [url=https://i.imgur.com/IcsEZvo.jpg]Smg?[/url] Do you think all of these are really dumb? You can make your own exactly how you want them. And since this is entirely animation based, you can use them anywhere regardless of sv_pure by preloading

So I made this mod to make it easier. You can edit the viewmodel offset on a per-class basis relatively easily. Here's how you use it:
[olist]
[*] Download the mod from here: https://drive.google.com/file/d/1qvLAjkPL2H9lXXho-cSe5J0PpjV1lIYE/view?usp=sharing
[*] Open the zip and extract the 0ffsetGenerator folder to your tf/custom folder. It's important not to change the name. Now enter the 0ffsetGenerator folder itself.
[*] Open 1.Settings.txt and adjust the offset values for each class to your liking.
There is information about how the values work in that file, I'm gonna put it here too:
[spoiler]// $Origin 0 0 0 = $Origin X Y Z
// Edit the $Origin X Y and Z values to move your viewmodel for the class.
// There is also the optional [z rotation] value that you can add, like this: $Origin <x> <y> <-z> [z rotation]
// You can use negative values of course
// The Z value is reversed
// Go here for a good explanation of how it works: https://developer.valvesoftware.com/wiki/$origin
// Example: I used "$Origin 0 20 15" to get some very small viewmodels.
// Leave the values at 0 0 0 for stock offsets[/spoiler]
Once you changed all the values to your liking, save.
[*] Now run GENERATE.bat and hope there are no errors. It should recompile the stock animation files with the changes you made and create 0ffsetViewmodels.vpk in your custom folder.
[*] Boot up the game and take a look. If you're not happy with what you got, just edit the offset values and run GENERATE.bat again. If you are happy with what you got, remove the 0ffsetGenerator folder from custom, it's no longer needed and just increases loading times. Also remember to check with minimal viewmodels on and off.
[/olist]
[u]Preloading[/u]:
Most of you are aware of what preloading is and are probably using it already. It lets you use certain mods, mostly animations, in any sv_pure setting by first loading into a sv_pure 0 server and leaving. If you're not already using a config that does that, I included Yttrium's method in the vpk file that gets generated. Simply add the line "exec preloading.cfg" to your autoexec if you want to use it.

[u]What about custom animations?[/u]
It is possible to use this with other viewmodel animation mods and move them however.
As long as they follow the same folder structure as default tf2 animations and don't use separated c_model animations.
Unfortunately, you'll have to decompile them yourself using something like [url=https://developer.valvesoftware.com/wiki/Crowbar]crowbar[/url].
It's pretty easy really:
[olist]
[*] If the mod comes into a vpk file, unpack that somewhere so you get the loose files. If not, skip to step 2.
[*] Now you should have the raw .mdl files. Decompile all of those in the same folder using Crowbar.
[*] Copy all the decompiled files (should be 9 c_CLASS_animations_anims folders and one matching .qc file for each) into the decompiled_animations folder inside 0ffsetGenerator. Let them override everything.
[/olist]
Now it should edit your chosen mod's animations instead of the default tf2 ones.[s][/s]
I'd really like to include the [url=https://gamebanana.com/mods/206440]fixed viewmodels[/url] mod by default. It fixes a lot of issues, like extra arms on high fov (yes, that includes the original left hand) but I'm not sure about just adding someone else's mod like that.

[u]Keep in mind:[/u]
This could be done better, the batch file is very basic. Hopefully, if people are interested in this, they'll find ways to improve on it.
The vpk it generates works on linux but the generator itself doesn't because it uses the studiomdl.exe bundled with tf2 and because I haven't included a bash generate file. [url=https://www.teamfortress.tv/59655/viewmodel-offset-customizer#6]Someone in the comments[/url] mentioned they got it working on linux via WINE so maybe look into that.
Let me know if you have any issues or have any ideas on how to improve this, I'm open to suggestions.

Also, [url=https://imgur.com/a/P87DQ1q]more screenshots of small viewmodels[/url], I really like them for some reason.
2
#2
7 Frags +

this is actually huge

this is actually huge
3
#3
Spaceship Servers
1 Frags +

this is awesome!!

this is awesome!!
4
#4
2 Frags +

Just updated download and instructions. Now it's a bit easier to use, you no longer have to edit the .qc files directly. It keeps the original files intact so it's easier to use with other custom animations mods.

Just updated download and instructions. Now it's a bit easier to use, you no longer have to edit the .qc files directly. It keeps the original files intact so it's easier to use with other custom animations mods.
5
#5
-12 Frags +

Can you make a BASH version of the generate script? It would be nice if Linux users could also use this tool, and from what I saw of the BATCH script, it shouldn't be too difficult.

Can you make a BASH version of the generate script? It would be nice if Linux users could also use this tool, and from what I saw of the BATCH script, it shouldn't be too difficult.
6
#6
6 Frags +
AimIsADickCan you make a BASH version of the generate script? It would be nice if Linux users could also use this tool, and from what I saw of the BATCH script, it shouldn't be too difficult.

You'll need to get MDL working on Linux to do that. The bundled with TF2 studiomdl.exe is why Yttrium's viewmodel hider wasn't expected to play nice on Linux either.

I can say, however, that this works via WINE although I'm not sure what specific requirements there are because I used the accursed hellscape of a wineprefix I have for running literally anything that will run that doesn't require hyperspecific requirements. I couldn't get the yttrium viewmodel hider to work, so that does make this interestingly different. It's probably because yttrium has a program separate from just using a simple batch file.

https://cdn.discordapp.com/attachments/192083556300750848/853655254927540234/2021-06-13-101834.png

Edit: forgot to mention that to get MDL I just force proton on tf2 and then switch back to no compatibility layer after I am done with MDL.

[quote=AimIsADick]Can you make a BASH version of the generate script? It would be nice if Linux users could also use this tool, and from what I saw of the BATCH script, it shouldn't be too difficult.[/quote]
You'll need to get MDL working on Linux to do that. The bundled with TF2 studiomdl.exe is why Yttrium's viewmodel hider wasn't expected to play nice on Linux either.

I can say, however, that this works via WINE although I'm not sure what specific requirements there are because I used the accursed hellscape of a wineprefix I have for running literally anything that will run that doesn't require hyperspecific requirements. I couldn't get the yttrium viewmodel hider to work, so that does make this interestingly different. It's probably because yttrium has a program separate from just using a simple batch file.
[img]https://cdn.discordapp.com/attachments/192083556300750848/853655254927540234/2021-06-13-101834.png[/img]

Edit: forgot to mention that to get MDL I just force proton on tf2 and then switch back to no compatibility layer after I am done with MDL.
7
#7
1 Frags +

really cool

really cool
8
#8
0 Frags +
sunderkeeninAimIsADickCan you make a BASH version of the generate script? It would be nice if Linux users could also use this tool, and from what I saw of the BATCH script, it shouldn't be too difficult.You'll need to get MDL working on Linux to do that. The bundled with TF2 studiomdl.exe is why Yttrium's viewmodel hider wasn't expected to play nice on Linux either.

I can say, however, that this works via WINE although I'm not sure what specific requirements there are because I used the accursed hellscape of a wineprefix I have for running literally anything that will run that doesn't require hyperspecific requirements. I couldn't get the yttrium viewmodel hider to work, so that does make this interestingly different. It's probably because yttrium has a program separate from just using a simple batch file.
https://cdn.discordapp.com/attachments/192083556300750848/853655254927540234/2021-06-13-101834.png

Edit: forgot to mention that to get MDL I just force proton on tf2 and then switch back to no compatibility layer after I am done with MDL.

good sir do you mind posting your hellscape wineprefix

[quote=sunderkeenin][quote=AimIsADick]Can you make a BASH version of the generate script? It would be nice if Linux users could also use this tool, and from what I saw of the BATCH script, it shouldn't be too difficult.[/quote]
You'll need to get MDL working on Linux to do that. The bundled with TF2 studiomdl.exe is why Yttrium's viewmodel hider wasn't expected to play nice on Linux either.

I can say, however, that this works via WINE although I'm not sure what specific requirements there are because I used the accursed hellscape of a wineprefix I have for running literally anything that will run that doesn't require hyperspecific requirements. I couldn't get the yttrium viewmodel hider to work, so that does make this interestingly different. It's probably because yttrium has a program separate from just using a simple batch file.
[img]https://cdn.discordapp.com/attachments/192083556300750848/853655254927540234/2021-06-13-101834.png[/img]

Edit: forgot to mention that to get MDL I just force proton on tf2 and then switch back to no compatibility layer after I am done with MDL.[/quote]

good sir do you mind posting your hellscape wineprefix
9
#9
1 Frags +
scarysunderkeeninAimIsADickCan you make a BASH version of the generate script? It would be nice if Linux users could also use this tool, and from what I saw of the BATCH script, it shouldn't be too difficult.You'll need to get MDL working on Linux to do that. The bundled with TF2 studiomdl.exe is why Yttrium's viewmodel hider wasn't expected to play nice on Linux either.

I can say, however, that this works via WINE although I'm not sure what specific requirements there are because I used the accursed hellscape of a wineprefix I have for running literally anything that will run that doesn't require hyperspecific requirements. I couldn't get the yttrium viewmodel hider to work, so that does make this interestingly different. It's probably because yttrium has a program separate from just using a simple batch file.
https://cdn.discordapp.com/attachments/192083556300750848/853655254927540234/2021-06-13-101834.png

Edit: forgot to mention that to get MDL I just force proton on tf2 and then switch back to no compatibility layer after I am done with MDL.

good sir do you mind posting your hellscape wineprefix

I, uh, have done so many things to that poor wineprefix that I don't even know anymore, but a quick list of things was I installed every version of vcrun in sequence, every dotnet starting from the oldest to minimize conflicts and just left it as it was after that finished, and a bunch of completely random shit I don't even remember why I installed or what I installed as far as winetricks goes like xact and quartz(which was needed for cutscenes or some garbage in rpgmaker or something), but chances are you go no further than dotnet and vcrun and things work. I think it's also still in japanese locale and has every single font that winetricks can provide installed.

[quote=scary][quote=sunderkeenin][quote=AimIsADick]Can you make a BASH version of the generate script? It would be nice if Linux users could also use this tool, and from what I saw of the BATCH script, it shouldn't be too difficult.[/quote]
You'll need to get MDL working on Linux to do that. The bundled with TF2 studiomdl.exe is why Yttrium's viewmodel hider wasn't expected to play nice on Linux either.

I can say, however, that this works via WINE although I'm not sure what specific requirements there are because I used the accursed hellscape of a wineprefix I have for running literally anything that will run that doesn't require hyperspecific requirements. I couldn't get the yttrium viewmodel hider to work, so that does make this interestingly different. It's probably because yttrium has a program separate from just using a simple batch file.
[img]https://cdn.discordapp.com/attachments/192083556300750848/853655254927540234/2021-06-13-101834.png[/img]

Edit: forgot to mention that to get MDL I just force proton on tf2 and then switch back to no compatibility layer after I am done with MDL.[/quote]

good sir do you mind posting your hellscape wineprefix[/quote]
I, uh, have done so many things to that poor wineprefix that I don't even know anymore, but a quick list of things was I installed every version of vcrun in sequence, every dotnet starting from the oldest to minimize conflicts and just left it as it was after that finished, and a bunch of completely random shit I don't even remember why I installed or what I installed as far as winetricks goes like xact and quartz(which was needed for cutscenes or some garbage in rpgmaker or something), but chances are you go no further than dotnet and vcrun and things work. I think it's also still in japanese locale and has every single font that winetricks can provide installed.
10
#10
1 Frags +

wtf lmao

wtf lmao
Please sign in through STEAM to post a comment.