! loads (enables) expressions for a character @param pszFilename script-filename ("" to disable) */
| 4734 | @param pszFilename script-filename ("" to disable) |
| 4735 | */ |
| 4736 | int CScriptObjectEntity::DoRandomExpressions(IFunctionHandler *pH) |
| 4737 | { |
| 4738 | if (pH->GetParamCount()<1) |
| 4739 | CHECK_PARAMETERS(1); |
| 4740 | const char *pszFilename; |
| 4741 | bool bRaiseError=true; |
| 4742 | pH->GetParam(1, pszFilename); |
| 4743 | if (pH->GetParamCount()>=2) |
| 4744 | pH->GetParam(2, bRaiseError); |
| 4745 | if(m_pEntity && m_pEntity->GetCharInterface()) |
| 4746 | { |
| 4747 | ILipSync *pLipSync=m_pEntity->GetCharInterface()->GetLipSyncInterface(); |
| 4748 | if (!pLipSync) |
| 4749 | { |
| 4750 | m_pISystem->Warning( VALIDATOR_MODULE_SYSTEM,VALIDATOR_WARNING,0, |
| 4751 | 0,"Could not create lip-sync interface ! Does this entity %s have a character ?",m_pEntity->GetName() ); |
| 4752 | return pH->EndFunctionNull(); |
| 4753 | } |
| 4754 | if (!pLipSync->LoadRandomExpressions(pszFilename, bRaiseError)) |
| 4755 | { |
| 4756 | m_pISystem->Warning( VALIDATOR_MODULE_SYSTEM,VALIDATOR_WARNING,0, |
| 4757 | 0,"CLipSync::LoadDialog failed for Entity %s",m_pEntity->GetName() ); |
| 4758 | return pH->EndFunctionNull(); |
| 4759 | } |
| 4760 | } |
| 4761 | return pH->EndFunction((int)1); |
| 4762 | } |
| 4763 | |
| 4764 | /*! plays an expression for a character |
| 4765 | @param pszMorphTarget name of morph-target |
nothing calls this directly
no test coverage detected