Frictional Games Forum (read-only)

Full Version: [FIRST SCRIPT] unexpected end of file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys!

This is my first script ever, I am just playing around a little bit. Also took some help from tutorials.
However, when I added the Entity collision for the third room area, I started to get this error:

"Unexpected end of file". Any idea what's wrong? Confused

http://pastebin.com/fzi7bta2 Here's the code <-

PHP Code:
void OnStart()
{
    
AddEntityCollideCallback("Player""RoomTwoArea""CollideRoomTwo"true1);
    
AddEntityCollideCallBack("Player""RoomThreeArea""CollideRoomThree"true1");
    AddUseItemCallback("", "
key_study_1", "mansion_2", "UnlockDD", true);
    AddUseItemCallback("", "
ceremony_knife_1", "work_desk_door_1", "UnlockDD", true);
    GiveItemFromFile("
lantern", "lantern.ent");
    SetPlayerLampOil(100.0f);
}

void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
    SetSwingDoorClosed("
mansion_2", true, true);
    StartPlayerLookAt("
mansion_2", 10, 10, "");
    PlaySoundAtEntity("", "
00_laugh.snt", "mansion_2", 0, false);
    AddTimer("
close", 1, "stoplook");
}

void CollideRoomThree(string &in asParent, string &in asChild, int alState)
{
    SetEntityActive("
agrippa_head_1", true);
    StartPlayerLookAt("
agrippa_head_1", 10, 10, "");
    PlaySoundAtEntity("", "
00_laugh.snt", "graveyard_corpse_1", 0, false);
    AddTimer("
lolol", 1, "stoplook");
    SetPropHealth("
pot_explode", 0);
}

void UnlockDD(string &in item, string &in door)
{
    SetSwingDoorLocked(door, false, true);
    PlaySoundAtEntity("", "
scare_slam_door.snt", door, 0, false);
    RemoveItem(item);
}

void stoplook(string &in asTimer)
{
    StopPlayerLookAt();
}

void OnEnter()
{

}

void OnLeave()
{



EDIT: Finally found that little bastard Wink It was this:
PHP Code:
AddEntityCollideCallBack("Player""RoomThreeArea""CollideRoomThree"true1"); 
Looks like you have an extra " at the end of one of your AddEntityCollideCallbacks. Try this.
Code:
void OnStart()
{
    AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1);
    AddEntityCollideCallBack("Player", "RoomThreeArea", "CollideRoomThree", true, 1);
    AddUseItemCallback("", "key_study_1", "mansion_2", "UnlockDD", true);
    AddUseItemCallback("", "ceremony_knife_1", "work_desk_door_1", "UnlockDD", true);
    GiveItemFromFile("lantern", "lantern.ent");
    SetPlayerLampOil(100.0f);
}

(03-04-2012, 04:43 PM)Apjjm Wrote: [ -> ]Looks like you have an extra " at the end of one of your AddEntityCollideCallbacks. Try this.
-snip-
Yeah, I noticed that :p

Got another error now, lol. I remember solving this before on my own, but I don't remember how!

Error:
Quote: main(5,2) : ERR : No matching signatures to blablablabla AddEntityCollideCallBack


Any idea what's wrong? Nothing has changed in my previous code except the little ".
The areanames are correct..
Method names are case-sensitive. Try using "AddEntityCollideCallback" for the second one.
The "b" in AddEntityCollideCallback is not supposed to be capitalized

Edit: I dun got ninja'd >_>
Stupid of me.. Thank you!