Frictional Games Forum (read-only)

Full Version: Script Fatal Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need some help with this, I'm new so I don't know what's wrong.
Whenever I start up my custom story I get this error message:

FATAL ERROR: Could not load script file 'custom_stories/Map Test 3/maps/test.hps'!
main (4,2) : ERR : No matching signatures to
'AddUseItemCallBack(string@&, string@&, string@&, string@&, const bool)'
main (5,2) : ERR : No matching signatures to
'AddUseItemCallBack(string@&, string@&, string@&, string@&, const bool)'
main(27,22) : ERR : Expected')' or ','

This is what I have gotten so far:


void OnStart()
{
SetLocalVarInt("DoorLocked", 1);
AddUseItemCallBack("", "key_laboratory_1", "level_wood_1", "UsedKeyOnDoor", true);
AddUseItemCallBack("", "key_tomb_1", "mansion_2", "UsedKeyOnDoor2", true);
SetEntityPlayerInteractCallback("mansion_2", "UsedKeyOnDoor3", false);
}

void OnEnter()
{

}

void OnLeave()
{

}

void UsedKeyOnDoor(string &in asitem, string &in asdoor)
{
SetLevelDoorLocked("level_wood_1", false);
PlayGuiSound("unlock_door.snt", 100);
RemoveItem("key_laboratory_1);
}
void UsedKeyOnDoor2(string &in asitem, string &in asdoor)
{
SetSwingDoorLocked("mansion_2", false, true);
PlayGuiSound("unlock_door.snt", 100")
RemoveItem("key_tomb_1");
SetLocalVarInt("DoorLocked", 0);
}
void UsedKeyOnDoor3(string &in asEntity)
{
if(GetLocalVarInt("DoorLocked") == 1)
{
SetMessage("Messages", "Doorlock2", 3);
}
}
Hello! In the line:

RemoveItem("key_laboratory_1);

You missed the closing quotation mark (the one on the right side of key_laboratory_1). Also, you misspelled the function: AddUseItemCallBack, the B should not be capitalized; Callback is one word.




Hope that helped
Thanks, that helped.

Though now I have another problem, on start up it does this:

FATAL ERROR: Could not load script file 'custom_stories/Map Test 3/maps/test.hps'!
main (38,2) : ERR : Unexpected end of file
Ah, got it:

PlayGuiSound("unlock_door.snt", 100") Remove the quotation after the 100.
Awesome, thanks for your help!

It's working now. Big Grin