Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Whats wrong with my script?
lbrosious96 Offline
Junior Member

Posts: 4
Threads: 4
Joined: Jun 2012
Reputation: 0
#1
Whats wrong with my script?

Im getting an unexpected ending at line 42,2, and i have tried everything! please help

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);
}
07-01-2012, 05:46 PM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: Whats wrong with my script?

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.

I rate it 3 memes.
07-01-2012, 05:52 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#3
RE: Whats wrong with my script?

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.

Think, before you speak Google, before you post
(This post was last modified: 07-01-2012, 06:05 PM by Cruzore.)
07-01-2012, 06:01 PM
Find




Users browsing this thread: 1 Guest(s)