NPC Scene

If you liked this item, please rate it up on Steam Workshop page.

Author: Xalalau

Last revision: 3 May, 2024 at 03:05 UTC

File size: 624.84 KB

On Steam Workshop

Description:

———————————————————–
BRASIL, Junte-se: https://discord.gg/ytkXGNU
GMBR, criadores BR de addons e vídeos e tudo.
———————————————————–

Introduction

You can play animations from .vcd files with NPC Scene, that’s it.

The addon started as a fix for the old v1.2[web.archive.org] but over time it became a new tool.

How to ensure that the scenes will play

Sometimes, the scene doesn’t play if the game fails to detect an actor with the right name. If you encounter this situation, inspect the console for missing names and use the tool to properly define them.

Another problem is playing TF2 scenes. If you can get the list, NPCs will only play sounds and change expressions, but won’t have lip sync or animate. Apparently TF2 uses a different phonemes table than that of hl2, and I don’t know much about the animations. But I remember that Model Manipulator can set a NPC like Father Grigori to a Standard TF2 ragdoll like Heavy and at least this new entity will move.

Games Support

Half-Life 2 scenes are always included.

These games will have the scenes available when mounted:

I won’t add support for:

  • Left 4 Dead, because it’s included in L4D2

I wasn’t able to get the scenes from:

  • Team Fortress 2
  • Portal 2
hlfaceposer.exe: Create your own scenes / Automatic lip sync

You can add scenes to the game by placing vcd files in "garrysmodscenes" (or "garrysmodaddonsmyaddonscenes") folder. They are created in hlfaceposer and you can read the "Choreography creation" guide to fully understand how they work.

However, running hlfaceposer nowadays is a problem, so I’m going to provide instructions on how to do that and get the automatic lip sync working.

The good news is that you can quickly get a good version of this program by installing Half-Life 2 and extracting this zip into it:
https://mega . nz/file/dNE2zD4a#Mg92cc7krQqPq49sjobX_9PL0NaOT1TQucJkrZ40E3E.
Open "Half-Life 2binhlfaceposer.exe" and you’re ready in this part.

But if you want a better explanation or to workaround the problem yourself (sometimes with newer file versions), follow these steps:

1 – Forget the current GMod’s hlfaceposer (21.07.13), it likes to crash more than expected;
2 – Download HL2 and Source Filmmaker;
3 – Copy "Half-Life 2hl2gameinfo.txt" to "Half-Life 2bin";
4 – Copy "SourceFilmmakergamebinlipsinc_data" to "Half-Life 2bin";
5 – Open "Half-Life 2binhlfaceposer.exe";
6 – You’re ready to create scenes.

Now you can also use the automatic lip sync without crashing:

1 – Load a model (File -> Load Model);
2 – Open the "Phoneme Editor" (a tab at the bottom). The next steps will be on it;
3 – Configure the lip sync API by right clicking on the empty space, selecting "Change Speech API" and checking "Lipsinc Speech API";
4 – Press CTRL + O to load a .wav file from your character
5 – Press CTRL + R to do the automatic phoneme detection;
6 – Right click on the empty space and select "Commit extraction" to apply the phonemes;
7 – Press CTRL + S to save the mouth animation in the .wav file;
8 – Copy the sound file to your game;
9 – Open the game to see it working.

I’m dubbing all Half-Lifes into my native language with a team and we’ve been using this method in HL2 for a while now. Take a look: https://www.moddb.com/mods/half-life-1-dublado-pt-br

There’re more ways to make hlfaceposer work but this one is my favorite. It’s reliable enough for us, good enough for a Windows XP program.

Extract vcd files from Source games

Valve has been compacting the vcd files into scenes.image for optimization, so, if you want to use "fresh" animations, you’ll have to convert then back first.

However, there is a catch here. The file names have been transformed into CRC, which is an irreversible checksum. As far as I understand, it’s only possible to retrieve these names by crossing the contents of scenes.image with maps, and in my experience many of the vcd files remain without a proper name even after that. I tried on my own to also get the names directly from scenes.image – from a location called "strings pool". I couldn’t get all the names either, and my attempts to read the vcds theirselves were crashing the game.

If you want to try anyway, use GCF Scape[nemesis.thewavelength.net] to extract scenes/scenes.image from the (probably) "misc" VPK of your game and use VSIF2VCD to extract the vcds. Note that VSIF2VCD asks for a maplist.txt file to be in the root folder of the game in order to obtain the original file names, so I usually create one myself. It’s like:

d1_canals_12
d1_canals_13
d1_eli_01
d1_eli_02
d1_town_01

At the end the extracted scenes will be inside the scenes folder.

Source code

If you want to check the code, here it is:
https://github.com/Xalalau/NPC-Scene

Special thanks

Testers: HomemCamisinhaCósmico and Pepeu.

Cool things

Enable "Apply Scenes Multiple Times" and…
– Try spamming "scenes/trainyard/cit_scan_id" on a citizen.
– Try using "scenes/trainyard/cit_breenagain" on Breen.
– Try spawning Alyx, naming her "Alyx", spawning GMan, naming him "gman" (case sensitive), and run "scenes/citadel/al_end" on Alyx. Spam it like hell (ALOT, FAST).
– (by y0ng $ack) scenes/eli_lab/attack04.vcd: Spawn DOG, name him "Dog" and spawn Alyx, name her "Alyx" then spam it like crazy. Enjoy.
– (by Herr Doktor von Nuremberg) If you spam cit_tooloud on a male citizen/rebel model (doesn’t work on female for some reason), you’ll get some interesting results.
– (by Fatmeatball) If you spam crowbar_intro on Barney, the scene just continues getting better.
– Here are some old, cool and broken addons:
Dance Animations[web.archive.org]
Npc Animation V4[web.archive.org]
Cremators animation pack[web.archive.org]
Cra0kalo’s Animations[web.archive.org]
/ / / DOWNLOAD BACKUP:
Mirror 1: https://mega . nz/#!ddkHFaQR!KO_TE3rcZ8nCDo0L0KK-KSmi2CntAHgJDFtghB7fyNw
Mirror 2: http://www. mediafire .com/download/kosy9wj09fjnu21/gmod+animation+stuff.zip
(How to make UMPA animations work: https://www.youtube.com/watch?v=C0gu9BFau4g)