Source Filmmaker

Source Filmmaker

Avatar Mania - SFM
Tips and tricks
Some suggestions on how you can improve your selection of Avatar parts. All this is pretty easy to figure out yourself through trial and error, but to those not as adapt with .qc coding here are some simple guides for you to follow.

By "you" I mean this is for anyone. Whenever Vicentico wants to improve the Compiler after these tricks is up to him.

Blank "Body" clothing
There doesn't appear to be an option to wear nothing over your body. One method is to just choose whatever item and in SFM simply override the material and float $alpha to make the object invisible but do you really have to do that every time you load your model into SFM?

Here's a simple fix.

Go to COMPILER\clothes\body folder and make a brand new file called
" ctp_body_000.qci "
That's it. Just leave it blank and empty and use that. The compiler will read it as nothing and will give you nothing.
Honestly dunno why Vic didn't add it to begin with, or maybe he forgot?

Regular gloves without grapple
So you want the regular gloves for your Avatar but dunno how to get rid of the grapple device? Again you can $alpha it but here's a more ideal solution.

Simply copy and paste both the .qci and .smd of ctp_glove_001 and rename it something like ctp_glove_001a or something that won't confuse it with the other files.

For the .SMD, open it and you'll notice a lot of rows and numbers that may look confusing. To simply put, delete all of these:

gloves_sec 0 numbers numbers numbers numbers numbers numbers numbers numbers numbers 0 numbers numbers numbers numbers numbers numbers numbers numbers numbers 0 numbers numbers numbers numbers numbers numbers numbers numbers numbers
May wanna use Notepad++ or WordPad. While it's possible to do it in regular Notepad will take ages to find the gloves_sec and delete them all.
Be careful not to delete any glove_main and careful not to delete the "end" at the bottom of the script. While it is a copy of an existing file, make sure to save it as ctp_glove_001a and not accidentally write over the original.

For the .QCI, change it to this:
$model guantes "clothes/glove/ctp_glove_001a.smd" $renamematerial "gloves_main" "ctp_cmn_glove_001a_main"

Save it and set it on your Avatar .qc and compile it. The grapple should be gone while the traditional gloves are still present.

Re-texturing existing clothing.
You will need VTFEdit for this one.

Choose an item you want to re-texture. For example 149, the green sanic T-shirt.
In COMPILER\clothes\body, copy and paste ctp_body_149 and rename it something like ctp_body_152a or, if you want it regarded as a separate shirt, ctp_body_210 or ctp_body_anything you can remember.

Open the .qci of that copied file and it will tell you the VTF file you're looking for. Now you need to search on the SFM files for the material for the green sanic shirt. It should be here:
SourceFilmmaker\game\usermod\materials\vicenticotd\SonicForcesAvatar\body

For the sake of example, we're looking for the green sanic shirt texture. In that folder, look for two files called:
ctp_cmn_body_053a_main.vmt
ctp_cmn_body_053a_main_abd.vtf
As expected, copy, paste and rename them. You may notice that there is already A to F of these files so either call them ctp_cmn_body_053g (or whatever filename you can remember).

Open ctp_cmn_body_053g_main.vmt and in $basetexture simply replace that a with a g after _053. Save it.
Next, open ctp_cmn_body_053g_main_abd.vtf where you will see the texture of the shirt itself. From VTFedit you can copy and paste it into an art program for you to use as a template,a guide, to edit and mess around with and once you're done import your texture back into VTFEDit and save over ctp_cmn_body_053g_main_abd.vtf

And we're done in this folder. Return to COMPILER\clothes\body to finish your T-shirt, (unless you kept the .qci open). Re-address the $renamematerial to ctp_cmn_body_053g_main so that the overall code it something like this and save it.
$model cuerpo "clothes/body/ctp_body_053.smd" $renamematerial "body_main" "ctp_cmn_body_053a_main"

Now your avatar is ready to put on the T-shirt. Go to your Avatar .qc on the COMPILE folder, put in it's filename in it's $include and compile it. Your avatar should be wearing the custom textured item now.

Body Groups
Currently there is no practical method for body groups, until I find a method I'll update this opening statement on this thread. It is possible to make body groups but these body groups can only have one "_main" for $renamematerial on account of most avatar items .smd have a _main addressed for their textures.

For the sake of example, I'll make a body group so that my avatar can have gloves (001a), gloves with grapple (001) and bare hands (000).

In the glove folder, make a new file and call it ctp_glove_bg.qci (bg for Body Group). Write it out like this:

$bodygroup guantes { studio "clothes/glove/ctp_glove_001.smd" studio "clothes/glove/ctp_glove_001a.smd" studio "clothes/glove/ctp_glove_000.smd" } $renamematerial "gloves_main" "ctp_cmn_glove_001a_main" $renamematerial "gloves_sec" "ctp_cmn_glove_001a_sec"

If you want to add more "guantes" to choose from simply open the .qci file of the glove you want and copy the $model address. On the bg.qci add another studio to the list and paste the $model address after it. (Don't forget the brackets!).
If the lothing you chosen have a variety of $renamematerial be sure to include them listed so the compiler knows where to look.

When your satisfied with your list, go to your Avatar's .qc and replace gloves with "ctp_glove_bg.qci" and the compiler should pack all your listed items into your Avatar.
When you place your Avatar in SFM and check the "guantes" body group youi'll find a list of the gloves you chosen.

It's not just for gloves, you can make ctp_body_bg.qc or ctp_gshoes_bg.qc to allow body groups for these items... just be sure to put them in their respected folder and choose items shared in the folder to be grouped.h
Last edited by Mystic Monkey; 1 Jun, 2021 @ 10:17am
< >
Showing 1-3 of 3 comments
Mystic Monkey 30 May, 2021 @ 10:39am 
I've noticed some issues that I'm currently trying to fix. Anyone who knows .qc is welcomed to help.
  • Bodygroup .qci can only have one $renamematerial "_main" and will try to apply that texture to all clothing in the group if you have more than one item. The problem is all the .smd files address their textures as "clothe_main" and their individual .qci files $renamematerial to their addressed textures, so when a body group .qci is referring to multiple .smd or .qci it doesn't know which _main it's addressing for. I'm trying to figure out how to address a $texturegroup to apply to grouped shoes.
  • Custom feet[www.deviantart.com], the toes appear to be crumpled. I dunno what other footwear or clothing will appear distorted.

While my body group method is not at all perfect, it's the closest I can figure out to allow body group for avatars, saving us from needing multiple avatars or using $alpha for wardrobe alterations.
Last edited by Mystic Monkey; 30 May, 2021 @ 12:25pm
Mystic Monkey 23 Sep, 2021 @ 6:50pm 
Quick and easy, but rather rough animations
Okay, so there is a severe lack of animations in SFM Workshop for us to bum walk animations off. But I found a simple yet effective solution.

For this you'll need the Animation Helper - Valve Biped and this Puppet script.

To sum it up, the dummy has every humanoid animation in Half-Life 2 compiled into his sequences. And through the puppet script you can apply your Avatars to mimic the dummy with the puppet_delta script.
Just don't bother to apply the sf_avatar_rig to your Avatar given the dummy will be doing the work.

Keep in mind due to some inconsistencies between Avatar and dummy that not every bone in your Avatar's body will copy the dummy and some of the limbs will be a bit off. The arms are a bit forwarded and the hand-gestures do not copy over. (It might help to rescale the dummy to around 0.05 to match your Avatar's size.) But if you adjust the dummy then the Avatar will copy.

As for things your dummy can't adjust like hands or viewpoint, then left-click on the Animation Set Editor and tick "Show Hidden Controls" which will reveal your Avatar's model. Through here you can adjust the Avatar's unique limbs and unknowns.
Very useful!!! Thx!!
< >
Showing 1-3 of 3 comments
Per page: 1530 50