Is There a Way to Disable Paint with Mods?

Discussion in 'Team Fortress 2 Talk' started by Jnaejnae, Sep 7, 2017.

  1. Jnaejnae

    Jnaejnae L1: Registered

    Messages:
    47
    Positive Ratings:
    4
    TF2 has a one of a kind 1960's inspired artstyle, but over time cosmetic items have basically destroyed the artstyle. One of the worst offenders is paint. For example the Ye Olde Baker Boy fits really well within TF2's artstlye and Scouts personality, but it looks attrocious when someone paints it neon pink. I constantly see ridiculous cosmetics like neon green banana hats and yellow Kanye shades.

    For this reason, I want to know if there is any way to remove paint colors from the game using mods. Or at least the disgusting colors like lime and pink. The only way I've found so far, is the no hats mod, which removes all hats entirely. Now I prefer this over vanilla, but there are many good cosmetics that I would love to see but are spoiled by awful color choice. Since removing cosmetics is possible even on sv_pure, removing paint colors doesnt seem impossible, but so far I haven't found anything. Any help?
     
  2. TheLoafLord

    TheLoafLord L1: Registered

    Messages:
    30
    Positive Ratings:
    16
    You'll just have to deal with it, sorry.
     
    • Respectfully Disagree Respectfully Disagree x 4
  3. Lampenpam

    aa Lampenpam

    Messages:
    994
    Positive Ratings:
    329
    You could mod every material. I think what alows a material to have colorable areas is the $blendtintbybasealpha 1 command. Setting it to 0 would disable the coloring and the texture would be white/gray. It would require you to mod all the materials of each colorable cosmetic, so it's a bit of work.
     
  4. Tumbolisu

    aa Tumbolisu  I ⌄ I 

    Messages:
    931
    Positive Ratings:
    894
    You are almost right with that, but there is actually no need to edit the textures. The materials always have a $color2 parameter which defines the default color. However, I don't think that $blendtintbybasealpha is the right parameter, as that only controls if the applied color should be masked or go over the entire thing evenly.
    Let's take a look at the material for the Texas Tin Gallon simply because I have a painted one.
    Code:
    "VertexLitGeneric"
    {
        "$basetexture"        "models/workshop/player/items/engineer/robo_engineer_texastingallon/robo_engineer_texastingallon_color"
        "$bumpmap"        "models/workshop/player/items/engineer/robo_engineer_texastingallon/robo_engineer_texastingallon_normal"
        "$lightwarptexture"        "models/player/pyro/pyro_lightwarp"
        "$phong"        "1"
        "$phongexponent"        "5.000000"
        "$phongboost"        "2.000000"
        "$phongfresnelranges"        "[.25 .5 1]"
        "$rimlight"        "1"
        "$rimlightexponent"        "4.000000"
        "$rimlightboost"        "1.000000"
        "$blendtintbybasealpha"        "1"
        "$blendtintcoloroverbase"        "1.000000"
        "$colortint_base"        "{ 239 236 200 }"
        "$color2"        "{ 239 236 200 }"
        "$colortint_tmp"        "[0 0 0]"
        "$bumpmapalphaphongmask"        "1"
        "$cloakPassEnabled"        "1"
        "$detail"        "effects/tiledfire/fireLayeredSlowTiled512"
        "$detailscale"        "5"
        "$detailblendfactor"        "0"
        "$detailblendmode"        "6"
        "$yellow"        "0"
        ">=DX90"
        {
            "$selfillum"        "0"
        }
        "Proxies"
        {
            "invis"
            {
            }
            "AnimatedTexture"
            {
                "animatedtexturevar" "$detail"
                "animatedtextureframenumvar" "$detailframe"
                "animatedtextureframerate" 30
            }
            "BurnLevel"
            {
                "resultVar" "$detailblendfactor"
            }
            "ItemTintColor"
            {
                "resultVar" "$colortint_tmp"
            }
            "SelectFirstIfNonZero"
            {
                "srcVar1"    "$colortint_tmp"
                "srcVar2"    "$colortint_base"
                "resultVar" "$color2"
            }
            "YellowLevel"
            {
                "resultVar" "$yellow"
            }
            "Multiply"
            {
                "srcVar1" "$color2"
                "srcVar2" "$yellow"
                "resultVar" "$color2"
            }
        }
    }
    Now let's filter out all the stuff that is important to us right now:

    Code:
        "$blendtintbybasealpha"        "1"
        "$blendtintcoloroverbase"        "1.000000"
        "$colortint_base"        "{ 239 236 200 }"
        "$color2"        "{ 239 236 200 }"
        "$colortint_tmp"        "[0 0 0]"
    
        "Proxies"
        {
            "ItemTintColor"
            {
                "resultVar" "$colortint_tmp"
            }
            "SelectFirstIfNonZero"
            {
                "srcVar1"    "$colortint_tmp"
                "srcVar2"    "$colortint_base"
                "resultVar" "$color2"
            }
        }
    My first assumptions for all these things:
    $blendtintbybasealpha [boolean?]
    As mentioned before, controlls if the color should be applied evenly or use a mask.
    $blendtintcoloroverbase [float?]
    Controlls how strong the color is applied
    $colortint_base
    A fake variable. This is the default color.
    $color2 [RGB]
    The applied color.
    $colortint_tmp
    A fake variable. We will get back to this in a moment.

    And for the proxies:
    ItemTintColor
    This allows the material to know what the current paint is. It is then stored in the $colortint_tmp variable.
    SelectFirstIfNonZero
    Selfexplanatory. If there is no paint applied, it uses the default color. The result is stored in $color2.

    From these assumptions I will make a simple mod where I copy the material and remove the SelectFirstIfNonZero proxy entirely. At first i wanted to remove the $colorint_tmp variable but I think I would have to remove everything that mentions it or else I might get errors. Anyways, this should visually remove the paint from my hat.

    20170907172643_1.jpg

    And it works!

    However, removing a proxy from every material in the game would be annoying. So what if I simply remove the $colortint_tmp variable? Will I get errors or will it work? The answere:

    20170907173309_1.jpg

    Code:
    No such variable "$colortint_tmp" for material "models/workshop/player/items/engineer/robo_engineer_texastingallon/robo_engineer_texastingallon"
    Error: Material "models/workshop/player/items/engineer/robo_engineer_texastingallon/robo_engineer_texastingallon" : proxy "ItemTintColor" unable to initialize!
    No such variable "$colortint_tmp" for material "models/workshop/player/items/engineer/robo_engineer_texastingallon/robo_engineer_texastingallon"
    Error: Material "models/workshop/player/items/engineer/robo_engineer_texastingallon/robo_engineer_texastingallon" : proxy "SelectFirstIfNonZero" unable to initialize!
    No such variable "$colortint_tmp" for material "models/workshop/player/items/engineer/robo_engineer_texastingallon/robo_engineer_texastingallon"
    Error: Material "models/workshop/player/items/engineer/robo_engineer_texastingallon/robo_engineer_texastingallon" : proxy "ItemTintColor" unable to initialize!
    No such variable "$colortint_tmp" for material "models/workshop/player/items/engineer/robo_engineer_texastingallon/robo_engineer_texastingallon"
    Error: Material "models/workshop/player/items/engineer/robo_engineer_texastingallon/robo_engineer_texastingallon" : proxy "SelectFirstIfNonZero" unable to initialize!
    
    So, it works, but we get nasty console spam.
     
    • Like Like x 2
    • Agree Agree x 1
  5. Jnaejnae

    Jnaejnae L1: Registered

    Messages:
    47
    Positive Ratings:
    4
    Wow thanks for the great response, its very well researched, and even well presented. I didn't expect someone to put so much time in a response. I just have 2 questions though, does this mod work in sv_pure like the no hat mod does? If it does work on Valve servers that would be even better.

    Also, I can't find the material files for the cosmetics. I opened TF2's textures with GFC SCAPE, and I went to the directory materials>models>player>items but here there are only .vtf textire files. From my bit of modding experience, I think material text files should be .vmt, but I cant find those vmt for the cosmetics. Where are the material files?
     
    Last edited: Sep 7, 2017
  6. Tumbolisu

    aa Tumbolisu  I ⌄ I 

    Messages:
    931
    Positive Ratings:
    894
    All materials ar ein the misc vpk, not the textures vpk for the simple reason that materials aren't textures.
    All mods that change materials and models work in equal environments. I don't see how one mod should work in more places than another.
     
  7. Jnaejnae

    Jnaejnae L1: Registered

    Messages:
    47
    Positive Ratings:
    4
    So I did what you did "deleted the SelectFirstIfNonZero proxy" for the Summer Shades. My shades are brown, the default color is yellow, but for some reason in game it showed up as white.

    [​IMG]
    [​IMG]

    I made sure it was in the proper model folder, but I put a duplicate in the textures folder just to make sure. Still just white.

    Also I checked this mod does not work with sv_pure 1 or on Valve servers. I think the no hats mod works past sv_pure because it doesnt actually have anything, it just has empty files with the name of the hats it gets rid of. Heres an example of this mod not working on a Valve server.

    [​IMG]
    [​IMG]

    So it doesnt seem to be working. However heres the mod I made : http://www.mediafire.com/file/8zob2zzujza8zm8/No+Paint+Shades.vpk Maybe you will be able to catch what I did wrong. However it seems deleting the proxy, defaults to no color (white) instead of the default one (yellow). Its possible it only appeared to work on your test, because the default color of your hat happens to be white. However its more possible that we simply missed something.
     
  8. Lampenpam

    aa Lampenpam

    Messages:
    994
    Positive Ratings:
    329
    Like I already said, the models will be white because the texure won't be painted. Even if cosmetics aren't painted, they still have the white texture being painted with red or blue (in the case of the glasses, yellow) so only a single texture for each cosmetic is required.
     
  9. Tumbolisu

    aa Tumbolisu  I ⌄ I 

    Messages:
    931
    Positive Ratings:
    894
    I see what is going on, and it's kinda dumb. The problem is that the material doesn't include a line that simply reads
    Code:
    "$color2" "{227 205 10}"
    while the Texas Tin Gallon does. The Texas Tin Gallon appears white in my screenshots but it's actually not all-the-way white, it is in fact using it's default color.

    Something else that should DEFINATELY work with ANY material is to delete the ItemTintColor Proxy and leave everything else untouched. Dunno why I didn't think of that sooner.

    BTW you don't need this stuff
    [​IMG]
    And for testing purposes, there is no reason to place the material inside a vpk. It's unneccessary work. Just make a folder with any name in your custom folder and then place everything inside that. The game won't tell the difference.
     
  10. Glubbable

    Glubbable L1: Registered

    Messages:
    46
    Positive Ratings:
    79
    I found a lot of older items, like the bills hat don't use the $color settings in the vmt and also have a black base texture for the paint. Which is really weird on how it's implemented or how no one at Valve had tried to convert them over to their current method of painting items.