danielmm8888 / TF2Classic

A repo containing the source code for Team Fortress 2 Classic
Other
40 stars 15 forks source link

How do you implement the player colorization system for the mercenary? #282

Open FriskTheFallenHuman opened 7 years ago

FriskTheFallenHuman commented 7 years ago

i'm curious how do you implement this feature and how could implement in other source base's mod? i will give credits to you :D

danielmm8888 commented 7 years ago

The tinting itself is achieved by simply setting the color in the code(of course our implementation has a lot more to it considering we have color sliders and other things, which is why we send a color vector from the client to the server). But to simply color the model, all you need to do is use the SetColor function.

You also need a texture with a VMT that supports $blendtintbybasealpha, otherwise the entire model will be colored, instead of specific parts.

FriskTheFallenHuman commented 7 years ago

Ah I thought it was something difficult but since you say so I was interested in the related commits and I see that it is much simpler than I can imagine

thank you very much: D But something worries me the .vmt has to be VertexGeneric or another different?

FriskTheFallenHuman commented 7 years ago

Hey @danielmm8888 I Am Me Again, I would like to know what are the commits that I must look to be able to implement the colorization :(?