lbrosious96
Junior Member
Posts: 4
Threads: 4
Joined: Jun 2012
Reputation:
0
|
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 |
|
Adny
Posting Freak
Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation:
173
|
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 |
|
Cruzore
Senior Member
Posts: 301
Threads: 2
Joined: Jun 2012
Reputation:
37
|
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 |
|
|