Timer Not Working
I have a scare set up where your locked in a room with a grunt for a short period of time. Once the timer finishes the grunt is supposed to disappear in a flash of light and the door to the room unlocks. The only problem is that the timer is not responding and I have no idea why. Heres the code in question:
void RoomScare(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
AddPropImpulse("mansion_7", 0, 0, -50, "world");
SetSwingDoorLocked("mansion_7", true, true);
GiveSanityDamage(1, true);
SetPlayerActive(true);
AddTimer("roomscarefinish", 5.0f, "RoomScareFinish");
SetEntityActive("servant_grunt_3", true);
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_30", 1.0f, "idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_31", 1.0f, "idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_32", 1.0f, "idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_33", 1.0f, "idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_34", 1.0f, "idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_35", 1.0f, "idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_36", 1.0f, "idle");
}
void RoomScareFinish()
{
GiveSanityBoostSmall();
StartEffectFlash(0.3f, 1.0f, 1.0f);
SetSwingDoorLocked("mansion_7", false, true);
SetEntityActive("servant_grunt_3", false);
}
|