06-14-2012, 08:37 AM
I'm trying to make a script where a brute is approaching the player, and if the player chooses to close an unbreakable door on it, it will pound on the door for about ten seconds, and then give up and walk away. However, even though I've tried to disable all its triggers and clear its patrol route, it will never stop attacking the door. Here's the script:
The door locks and adds the callback so I know the function itself is working, but the brute still refuses to leave the door alone.
PHP Code:
void CheckDoor(string &in asParent, string &in asChild, int alState) //called by an area around the door
{
if(GetLocalVarInt("InTerror")==1 && GetSwingDoorClosed("prison_2")) //makes sure the player is inside the room with the door closed
{
SetEnemyDisableTriggers("servant_brute_1", true);
SetSwingDoorLocked("prison_2", true, true);
SetEntityPlayerInteractCallback("prison_2", "DoorJam", true);
AddTimer("", 10, "RerouteMongrel");
}
}
void RerouteMongrel(string &in asTimer)
{
ClearEnemyPatrolNodes("servant_brute_1"); //clears the node inside the room
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0.001f, ""); //adds the nodes leading down an adjacent hallway
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_3", 0.001f, "");
}
The door locks and adds the callback so I know the function itself is working, but the brute still refuses to leave the door alone.
!![[Image: 1W9Zo.png]](http://i.imgur.com/1W9Zo.png)