So I have a huge scare here, and I have been trying to troubleshoot it for hours. I have added debug messages to all the timers, and everything is firing off. Yet, they are not taking the action they should be in game. The whole script for the map is 230 lines of code, so I dont want to post it all, but if it helps, here is the scare part of it. Tell me if you can spot anything. I am willing to upload the script somewhere if need be.
The Collide Scripts at the top look like:
AddEntityCollideCallback("Player", "DogAttackArea", "DogAttack", true, 1);
AddEntityCollideCallback("Player", "Stopdawalk", "StopWalking", true, 1);
And the functions down below look like:
//------------------------------------------------------------------------------------------------//
void DogAttack(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "wolf1.snt", "GrowlTarget1", 0, false);
SetEntityActive("Stopdawalk", true);
SetPlayerActive(false);
AddTimer("", 2.0f, "NextGrowl");
AddDebugMessage("Start Script Fired.", false);
}
//------------------------------------------------------------------------------------------------//
void NextGrowl(string &in asTimer)
{
PlaySoundAtEntity("", "wolf2.snt", "GrowlTarget2", 0, false);
AddTimer("", 2.0f, "ThridGrowl");
AddDebugMessage("Sound and Start Timer Fired", false);
}
//------------------------------------------------------------------------------------------------//
void ThridGrowl(string &in asTimer)
{
PlaySoundAtEntity("", "wolf2.snt", "Lookat", 0, false);
AddTimer("", 0.5f, "TheLook");
AddDebugMessage("Next Timer Fired", false);
}
//------------------------------------------------------------------------------------------------//
void TheLook(string &in asTimer)
{
StartPlayerLookAt("Lookat", 1, 1, "");
AddTimer("", 4.0f, "TheWalk");
AddDebugMessage("Look at Timer Fired", false);
}
//------------------------------------------------------------------------------------------------//
void TheWalk(string &in asTimer)
{
SetPlayerMoveSpeedMul(0.2);
AddTimer("", 2.3f, "Walk");
PlaySoundAtEntity("", "Heartbeatslow.snt", "Player", 0, false);
AddDebugMessage("Walk Timer Fired", false);
}
//------------------------------------------------------------------------------------------------//
void Walk(string &in asTimer)
{
MovePlayerForward(5.0f);
AddTimer("", 0.1f, "restart_walk");
AddDebugMessage("You're walking", false);
}
//------------------------------------------------------------------------------------------------//
void restart_walk(string &in asTimer)
{
AddTimer("restarter", 0, "atwalkto");
}
//------------------------------------------------------------------------------------------------//
void atwalkto(string &in asTimer)
{
MovePlayerForward(10.0f);
AddTimer("looper", 0.1f, "restart_walk");
}
//------------------------------------------------------------------------------------------------//
void StopWalking(string &in asParent, string &in asChild, int alState)
{
RemoveTimer("looper");
RemoveTimer("restarter");
MovePlayerForward(0.0f);
SetPlayerMoveSpeedMul(1);
AddTimer("", 2.0, "Attack");
AddDebugMessage("You Stopped Walking", false);
}
//------------------------------------------------------------------------------------------------//
void Attack(string &in asTimer)
{
StartPlayerLookAt("DogAttack", 10, 10, "");
PlaySoundAtEntity("", "barkgrowl.snt", "Player", 0, false);
SetEntityActive("DogAttack", false);
AddDebugMessage("Dog Attacking Now.", false);
}
//------------------------------------------------------------------------------------------------//