kywi 
peasant

注册日期: Jul 2002
来 自:
发贴数量: 4 |
先修改onSpawn script,让他处理NW_FLAG_PERCEIVE_EVENT
再修改userEvent method
#include “NW_IO_GENERIC”
void main()
{
int nUser=GetUserDefinedEventNumber();
if (nUser == NW_FLAG_PERCEIVE_EVENT)
{
object oCreature=GetLastPerceived();
int iWave=GetLocalInt(OBJECT_SELF,Wave_Once); //取标志
if ((TRUE == GetLastPerceptionSeen()) && (GetIsPC(oCreature)) && (iWave == 0))
{
SetLocalInt(OBJECT_SELF,Wave_Once,1);//定义一个标志
ActionDoCommand(SetFacingPoint(GetPosition(oCreature));
ActionPlayAnimation(ANIMATION_FIREFORGET_GREET);
SpeakString(“Hello!”);
}
}
}
向版主报告此贴 | IP地址: 已记录
|