Frictional Games Forum (read-only)

Full Version: "No matching signatures" scripting help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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 =/
SetLightVisible("BoxLight_2", 0); should be SetLightVisible("BoxLight_2", false); or SetLightVisible("BoxLight_2", true);
(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)


@
[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?
(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.