MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / DoExpression

Method DoExpression

CrySystem/ScriptObjectEntity.cpp:4771–4799  ·  view source on GitHub ↗

! plays an expression for a character @param pszMorphTarget name of morph-target @param fAmplitude amplitude-scale @param fBlendIn blend-in time in seconds @param fLength hold time in seconds @param fBlendOut blend-out time in seconds */

Source from the content-addressed store, hash-verified

4769 @param fBlendOut blend-out time in seconds
4770*/
4771int CScriptObjectEntity::DoExpression(IFunctionHandler *pH)
4772{
4773 CHECK_PARAMETERS(5);
4774 const char *pszMorphTarget;
4775 CryCharMorphParams MorphParams;
4776 pH->GetParam(1, pszMorphTarget);
4777 pH->GetParam(2, MorphParams.fAmplitude);
4778 pH->GetParam(3, MorphParams.fBlendIn);
4779 pH->GetParam(4, MorphParams.fLength);
4780 pH->GetParam(5, MorphParams.fBlendOut);
4781 MorphParams.fStartTime=0.0f;
4782 if(m_pEntity && m_pEntity->GetCharInterface())
4783 {
4784 ILipSync *pLipSync=m_pEntity->GetCharInterface()->GetLipSyncInterface();
4785 if (!pLipSync)
4786 {
4787 m_pISystem->Warning( VALIDATOR_MODULE_SYSTEM,VALIDATOR_WARNING,0,
4788 0,"Could not create lip-sync interface ! Does this entity %s have a character ?",m_pEntity->GetName() );
4789 return pH->EndFunctionNull();
4790 }
4791 if (!pLipSync->DoExpression(pszMorphTarget, MorphParams))
4792 {
4793 m_pISystem->Warning( VALIDATOR_MODULE_SYSTEM,VALIDATOR_WARNING,0,
4794 0,"CLipSync::DoExpression failed, Entity: %s",m_pEntity->GetName() );
4795 return pH->EndFunctionNull();
4796 }
4797 }
4798 return pH->EndFunction((int)1);
4799}
4800
4801/*! says dialog (lip-synced); must be a character
4802 @param pszFilename name of dialog-filename (*.lsf is expected in the same folder)

Callers

nothing calls this directly

Calls 7

GetCharInterfaceMethod · 0.80
GetLipSyncInterfaceMethod · 0.80
EndFunctionNullMethod · 0.80
EndFunctionMethod · 0.80
GetParamMethod · 0.45
WarningMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected