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
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: No matching signature to AddTimer

When you use the if/else statement, you need to create additional brackets (both closed an open) to indicate what you want to have happen when the requirements for the if/else is met (or not):

void func()
{
if()
{
//do stuff
}
}

Also, you didn't captialize the first letter of AddTimer. Here's a full revision:


void OnStart()
{
if(ScriptDebugOn() == true)
{
GiveItemFromFile("lantern", "lantern.ent");
}
AddEntityCollideCallback("Player", "S_Trigger", "C_LanternOut", false, 1);
}


void C_LanternOut(string &in asParent, string &in asChild, int alState)
{
if(GetLanternActive() == true)
{
AddTimer("", 0.75f, "CR_LanternOut");
}
else
{
AddTimer("", 0.5f, "CF_LanternOut");
}
}


void CR_LanternOut(string &in asTimer)
{
if(GetLanternActive()==true)
{
AddTimer("", 0.75f, "CR_LanternOut");
}
else
{
AddTimer("", 0.5f, "CF_LanternOut");
}
}


void CF_LanternOut(string &in asTimer)
{
PlaySoundAtEntity("", "enabled.snt", "Player", 0, false);
}

Hope that helped.

I rate it 3 memes.
08-08-2012, 12:32 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)