AddTimer failure
Alright, so, I wanted the player to look at two things when he enters a script area (in this case, the script area is called lookatelevator). This is my code, however, things don't seem to work out too well.
void OnStart()
{
AddEntityCollideCallback("Player", "lookatelevator", "lookatelevatorandrodpipes", true, 1);
}
void lookatelevatorandrodpipes(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
AddTimer("lookatpipes1", 0.5, "lookatrodpuzzle");
AddTimer("lookatpipes2", 2.5, "lookatrodpuzzle");
AddTimer("lookatpipes3", 5.5, "lookatrodpuzzle");
}
void lookatrodpuzzle(string &in asTimer)
{
string x = asTimer;
if (x == "lookatpipes1")
{
StartPlayerLookAt("rodpipe1", 5, 4, "");
}
else if (x == "lookatpipes2")
{
StartPlayerLookAt("lookatthedamnpipe2daniel", 5, 4, "");
}
else if (x == "lookatpipes3")
{
StopPlayerLookAt();
SetPlayerActive(true);
}
}
The weird thing is, it totally ignores lookatpipes1 and lookatpipes2. How do I fix this? I think it has something to do with interfering with another AddTimer I already have in my .hps file... that is my only guess.
And yes, I have checked if the names of the entities are the same in the script.
(This post was last modified: 06-28-2012, 02:23 PM by ApeCake.)
|