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
Script Help No matching signature to AddTimer
Solipsist Offline
Junior Member

Posts: 29
Threads: 5
Joined: Aug 2012
Reputation: 0
#1
No matching signature to AddTimer

For the life of mine, I could not find a single thread which solves this issue. I am completely baffled about this error.

What I'm trying to do here, is to time the Callback-check-trigger whether the player is using his Lantern or not after stepping into an area. If the player's lantern is active, the script waits for the player to run out of oil or to deactivate it; then the event is initiated.
Yes, it's a cheap scare, but I'm experimenting here.
Quote:void OnStart()
{
if (ScriptDebugOn())
GiveItemFromFile("lantern", "lantern.ent");
//
AddEntityCollideCallback("Player", "S_Trigger", "C_LanternOut", false, 1);
}

void C_LanternOut(string &in asParent, string &in asChild, int alState) //Player has walked into the area.
{
if (GetLanternActive()==true) //Lantern on?
addTimer("", 0.75f, "CR_LanternOut"); //Proceed to a Recursion Function.
else //Lantern is Off.
addTimer("", 0.5f, "CF_LanternOut"); //Set the event
}

void CR_LanternOut(string &in asTimer) // A recursion function, as long as the player has his lantern on; this will be in a timed loop.
{
if (GetLanternActive()==true)
addTimer("", 0.75f, "CR_LanternOut"); //The recursion
else
addTimer("", 0.5f, "CF_LanternOut"); //Set the event
}

void CF_LanternOut(string &in asTimer) //The event, a grunt's awakening snort.
{
PlaySoundAtEntity("", "enabled.snt", "Player", 0, false);
}
This code is not even HALF of what I want it to do, but can you really blame me? Only when the timers will start working I'll be able to do improve it...I even went to the lengths of creating separate functions with asTimer arguments..Because, who knows! Not alot makes sense in this script.
P.S: Terribly sorry if this issue has been addressed already, I sincerely tried to find anything for a whole day.

(This post was last modified: 08-08-2012, 12:26 PM by Solipsist.)
08-08-2012, 12:19 PM
Find


Messages In This Thread
No matching signature to AddTimer - by Solipsist - 08-08-2012, 12:19 PM
RE: No matching signature to AddTimer - by Adny - 08-08-2012, 12:32 PM



Users browsing this thread: 1 Guest(s)