Pathnodes help!
Hi, im working on a custom story but im trying to do pathnodes but it never works. plz help and heres the code:
void OnStart()
{
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
SetEntityCallbackFunc("key1", "OnPickup");
AddUseItemCallback("", "key1", "mansion_1", "UsedKeyOnDoor", true);
SetEntityCallbackFunc("crowbar_1", "OnPickups");
AddEntityCollideCallback("Player", "ScriptArea_1", "MonsterFunction", true, 1);
{
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("monster_a", true);
AddEnemyPatrolNode("monster_a", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("monster_a", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("monster_a", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("monster_a", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("monster_a", "PathNodeArea_6", 4, "");
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("key1");
}
void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("servant_grunt_1", true);
ShowEnemyPlayerPosition("servant_grunt_1");
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("door1", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
void OnLeave()
{
}
|