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
#3
RE: No matching signature to AddTimer

You've got to be %*(#% kidding me, I jacked up the spelling? I swear the errors in this scripting language are way too misleading.. (Had odd issues with deciding if the script accepts 0-1 or true-false as boolean, apparently..It accepts both, but as "1" / "0" or true / false. Goddamnit.)


Btw, The "Brackets" tip is irrelevant to me, as you can see; I did just that. if(ScriptDebugOn() == true)
Also, the "== true" sign Is redundant. You can write
"if(ScriptDebugOn())" and it would mean the same thing..Same goes to my AddTimer line, which should be better without the '==true' sign anyway.

Anyhoo; Cheers for correcting my idiotic error. The script works now.

Edit: QUESTION!
I rewrote the script to make it simpler, I got it down to this ;
Quote:C_LanternOut(string &in asParent...Etc)
{
if (GetLanternActive() )
AddTimer("", 0.45f, "C_LanternOut"); //Recurse until False.
else
PlaySoundAtEntity("", "enabled.snt", "Player", 0, false);
}

The problem is that Timer is not able to trigger C_LanternOut. Do I need an argument "String &in asTimer" in order to allow it to callback to a function? The script worked with what I started with...

EDIT : The answer would be ; yes.
Quote:OnStart()
{
SetLocalVarInt("Flag_LanternOut", 0);
}
void C_LanternOut(string &in asParent, string &in asChild, int alState) //Player has walked into the area.
{
if (GetLanternActive()){
AddTimer("", 0.2f, "CT_LanternOut");
SetLocalVarInt("Flag_LanternOut", 0);
}
else PlaySoundAtEntity("", "enabled.snt", "Player", 0, false);
}
void CT_LanternOut(string &in asTimer)
{
if (GetLanternActive()){
AddTimer("", 0.2f, "CT_LanternOut");
SetLocalVarInt("Flag_LanternOut", 0);
}
else
{
if (GetLocalVarInt("Flag_LanternOut")!=0)
PlaySoundAtEntity("", "enabled.snt", "Player", 0, false);
else{
SetLocalVarInt("Flag_LanternOut", 1);
AddTimer("", 0.85, "CT_LanternOut");
}}}
If anyone ever, for any reason, resonates with this idea. That's an example.

(This post was last modified: 08-08-2012, 03:34 PM by Solipsist.)
08-08-2012, 01:52 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
RE: No matching signature to AddTimer - by Solipsist - 08-08-2012, 01:52 PM



Users browsing this thread: 1 Guest(s)