08-29-2012, 06:55 PM
This function won't call.
No errors. No alerts.
What should happen is easy:
Door collides with area -> Monster gets active -> Monster follows pathnode -> Monster disappear
Script:
void OnStart()
{
AddEntityCollideCallback("castle_arched01_1", "AreaOpenDoorGrunt", "OpenDoorGrunt", true, 0);
AddEntityCollideCallback("servant_grunt_3", "AreaMonsterDisappear_1", "MonsterDisappear_1", true, 0);
}
void OpenDoorGrunt(string &in asParent, string &in asChild, int alState)
{
AddDebugMessage("CALLING SCRIPT", false);
if(GetLocalVarInt("MonsterIsActive") == 1)
{
return;
}
if(GetLocalVarInt("StopMonster") == 1)
{
return;
}
AddDebugMessage("MONSTER ACTIVE", false);
SetEntityActive("servant_grunt_3", true);
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_100", 0, "");
SetLocalVarInt("MonsterIsActive", 1);
SetEntityActive("AreaOpenDoorGrunt", false);
}
void MonsterDisappear_1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_3", false);
PlaySoundAtEntity("", "Enabled.snt", "AreaStopMonster", 0, false);
}
None of the 2 debug messages get called. What am I missing?
No errors. No alerts.
What should happen is easy:
Door collides with area -> Monster gets active -> Monster follows pathnode -> Monster disappear
Script:
void OnStart()
{
AddEntityCollideCallback("castle_arched01_1", "AreaOpenDoorGrunt", "OpenDoorGrunt", true, 0);
AddEntityCollideCallback("servant_grunt_3", "AreaMonsterDisappear_1", "MonsterDisappear_1", true, 0);
}
void OpenDoorGrunt(string &in asParent, string &in asChild, int alState)
{
AddDebugMessage("CALLING SCRIPT", false);
if(GetLocalVarInt("MonsterIsActive") == 1)
{
return;
}
if(GetLocalVarInt("StopMonster") == 1)
{
return;
}
AddDebugMessage("MONSTER ACTIVE", false);
SetEntityActive("servant_grunt_3", true);
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_100", 0, "");
SetLocalVarInt("MonsterIsActive", 1);
SetEntityActive("AreaOpenDoorGrunt", false);
}
void MonsterDisappear_1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_3", false);
PlaySoundAtEntity("", "Enabled.snt", "AreaStopMonster", 0, false);
}
None of the 2 debug messages get called. What am I missing?