Entity/SetupPhonemeMappings

From Garry's Mod
Revision as of 17:03, 21 August 2019 by Jvs (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 Entity:SetupPhonemeMappings( )

Contents

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.

NOTE

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

string fileRoot

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

Examples

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


Personal tools
Navigation