Frictional Games Forum (read-only)

Full Version: Whats wrong with my script?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Im getting an unexpected ending at line 42,2, and i have tried everything! please help

Code:
void OnStart()
{
AddUseItemCallback("", "monsterdoorkey_1", "monsterdoor", "UsedKeyOnDoor", true);
AddUseItemCallback("", "irondoor_key", "irondoor", "UsedKeyOnDoor", true);
AddUseItemCallback("", "monstercontain_key", "monstercontain", "UsedKeyOnDoor", true);
AddUseItemCallback("", "deskdoor_lib_key", "deskdoor_lib", "UsedKeyOnDoor", true);
AddUseItemCallback("", "basement_key", "basement_door", "UsedKeyOnDoor", true);
AddUseItemCallback("", "lib_key", "lib_door", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "PlayerCollide_1", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "PlayerCollide_2", "MonsterFunction_2", true, 1);
AddEntityCollideCallback("Player", "door_shut_1", "door_shut_collide", string& asFunction, true, 1);
AddEntityCollideCallback("Player", "closetdoor", "closetopen", string& asFunction, true, 1);
SetEntityPlayerInteractCallback("monstercontain_key", "ActivateMonster", true)
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
RemoveItem(asItem);
}

void closetopen(string &in asParent, string &in asChild, int alState)
{
    SetSwingDoorOpen("closet_1", true, true);
}

void door_shut_collide(string &in asParent, string &in asChild, int alState)
{
    SetSwingDoorClosed("irondoor", true, true);
}

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

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

void ActivateMonster(string &in item)
{
    SetEntityActive("corpse_male_4", true);
}
You left the function blank for two of your callbacks:


AddEntityCollideCallback("Player", "door_shut_1", "door_shut_collide", string& asFunction, true, 1);
AddEntityCollideCallback("Player", "closetdoor", "closetopen", string& asFunction, true, 1);

Also, the syntax for the function "ActivateMonster" should be asEntity, not item.
as long as "string &in" is there, it doesn't matter what you name it. it can be asEntity, item or anything. I tried it out by replacing it with "lolz" and it worked.
It's just good to name it asEntity or entity, to remember what it stands for so you don't have to look at the script functions page again.