The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AddTimer failure
ApeCake Offline
Member

Posts: 116
Threads: 20
Joined: Jun 2012
Reputation: 4
#1
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.)
06-27-2012, 10:34 PM
Find


Messages In This Thread
AddTimer failure - by ApeCake - 06-27-2012, 10:34 PM
RE: AddTimer failure - by Cruzore - 06-27-2012, 11:43 PM
RE: AddTimer failure - by ApeCake - 06-28-2012, 02:23 PM



Users browsing this thread: 1 Guest(s)