Garry's Mod Wiki

Entity:SetupPhonemeMappings

  Entity:SetupPhonemeMappings( string fileRoot )

Description

Initializes the class names of an entity's phoneme mappings (mouth movement data). This is called by default with argument "phonemes" when a flex-based entity (such as an NPC) is created.

TF2 phonemes can be accessed by using a path such as "player/scout/phonemes/phonemes" , check TF2's "tf2_misc_dir.vpk" with GCFScape for other paths, however it seems that TF2 sounds don't contain phoneme definitions anymore after being converted to mp3 and only rely on VCD animations, this needs to be further investigated

Arguments

1 string fileRoot
The file prefix of the phoneme mappings (relative to "garrysmod/expressions/").

Example

Defines a function that can enable or disable phoneme mappings on an entity.

-- Turn phoneme mappings on or off function EnablePhonemes(ent, on) if(!IsValid(ent)) then return end if(!on) then -- Disable mouth movement ent:SetupPhonemeMappings("") else -- Enable mouth movement ent:SetupPhonemeMappings("phonemes") end end