Frictional Games Forum (read-only)

Full Version: Unexpected error on my script.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I keep getting an unexpected error with my script... I have no idea what's wrong it says: main (51,2)
:ERR: Unexpected end of file.
Heres my script if you can help it would be much appreciated Smile


////////////////////////////
// Run when entering map
void OnEnter()

{
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("Door_1", true, true);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

GiveSanityDamage(5.0f, true);
}
void OnStart()

{
AddUseItemCallback("","crowbar_1", "cdoor", "FUNCTION", true);
}

void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "door1", 0, false);
RemoveItem("crowbar_1");
void OnStart()

{
SetEntityConnectionStateChangeCallback("booklever", "func_shelf");
}


void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("secret",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}
////////////////////////////
// Run when entering map
void OnEnter()

{
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("Door_1", true, true);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

GiveSanityDamage(5.0f, true);
}

void OnStart()
{
AddUseItemCallback("","crowbar_1", "cdoor", "FUNCTION", true);
}

void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "door1", 0, false);
RemoveItem("crowbar_1");
}

void OnStart()
{
SetEntityConnectionStateChangeCallback("booklever", "func_shelf");
}


void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("secret",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}



are you sure you are using c++ language or the configs recommended in wiki for notepad++ or whatever youre using? It makes spotting those bracket errors a lot easier
(12-02-2011, 07:23 PM)Khyrpa Wrote: [ -> ]////////////////////////////
// Run when entering map
void OnEnter()

{
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("Door_1", true, true);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

GiveSanityDamage(5.0f, true);
}

void OnStart()
{
AddUseItemCallback("","crowbar_1", "cdoor", "FUNCTION", true);
}

void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "door1", 0, false);
RemoveItem("crowbar_1");
}

void OnStart()
{
SetEntityConnectionStateChangeCallback("booklever", "func_shelf");
}


void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("secret",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}



are you sure you are using c++ language or the configs recommended in wiki for notepad++ or whatever youre using? It makes spotting those bracket errors a lot easier