Frictional Games Forum (read-only)
"No matching signatures" scripting help - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: "No matching signatures" scripting help (/thread-13337.html)



"No matching signatures" scripting help - ThomJ - 02-14-2012

Hello

I am new to scripting and have been striving to understand the language in which these scripts are written. I understand the basics of how it works, but I am unable to pinpoint my errors. Here is the script for my Test story and the error associated whilst trying to load it:


////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "BSKey_1", "mansion_1", "UseKeyOnDoor", true);
AddEntityCollideCallback("Player", "BSRoom", "CollideBSRoom", true, 1);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "Lights", "SuddenLights", true, 1);
}

void UseKeyOnDoor(string &in item, string &in door)
{
SetSwingDoorLocked(door, false, true);
PlaySoundAtEntity("", "unlock_door", door, 0, false);
RemoveItem(item);
}

void CollideBSRoom(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_1", true, true);
SetSwingDoorLocked("mansion_1", true, true);
}

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
}

void SuddenLights(string& asLightName, bool abVisible)
{
SetLightVisible("BoxLight_2", 0);
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

And this is the error along with it:

main(43,1):INFO:Compiling void SuddenLights(string&inout, bool)
main(45,4):ERR:No matching signatures to 'SetLightVisable(string@&, const uint)'
main(45,4):INFO:Candidates are:
main(45,4):INFO:void SetLightVisable(string&in, bool)

Not too sure what to think of this..Everything works except for the light script =/


RE: "No matching signatures" scripting help - jens - 02-14-2012

SetLightVisible("BoxLight_2", 0); should be SetLightVisible("BoxLight_2", false); or SetLightVisible("BoxLight_2", true);



RE: "No matching signatures" scripting help - onv - 02-14-2012

(02-14-2012, 09:27 AM)jens Wrote: SetLightVisible("BoxLight_2", 0); should be SetLightVisible("BoxLight_2", false); or SetLightVisible("BoxLight_2", true);
Remplace SetLightVisible("BoxLight_2", 0); with SetLightVisible("BoxLight_2", false);

And the syntax of SuddenLights is wrong , should be SuddenLight(string &in asParent, string &in asChild, int alState)





RE: "No matching signatures" scripting help - ThomJ - 02-15-2012

@
[b]jens[/b] Ok that's kinda what I suspected after more thought today.@
[b]onv[/b] As for the syntax, I found the script on the wiki and simply copy and pasted it editing only the function name. Is (string &in asParent, string &in asChild, int alState) a universal syntax for every function?


RE: "No matching signatures" scripting help - Obliviator27 - 02-15-2012

(02-15-2012, 12:13 AM)ThomJ Wrote: @
[b]jens[/b] Ok that's kinda what I suspected after more thought today.@
[b]onv[/b] As for the syntax, I found the script on the wiki and simply copy and pasted it editing only the function name. Is (string &in asParent, string &in asChild, int alState) a universal syntax for every function?
No. It's the syntax for AddEntityCollideCallback.

The proper syntax for callbacks are listed on the wiki.