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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Error: Unexpected End of File
IVSKIN Offline
Junior Member

Posts: 2
Threads: 1
Joined: Nov 2012
Reputation: 0
#1
Script Error: Unexpected End of File

main (275, 2) : ERR : Unexpected end of file

Please Help!

Ive been starring at this for a while now and i cant find a missing " or } anywhere
Should be somewhere towards the bottom
Thank you for your time!
Sorry for how long its is


void OnStart()
{
PreloadSound("react_breath.snt");
PreloadSound("enemy_hallucination_disappear.snt");
PreloadSound("pickaxe_charge.ogg");
PreloadSound("00_event_gallery.ogg");
PreloadSound("01_amb_darkness.ogg");

SetEntityActive("waterlurker_1", false);
AddEntityCollideCallback("Player", "ScriptArea_1", "StartTeleport", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "Vision", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "Intro", true, 1);
AddEntityCollideCallback("book", "servant_brute_1", "Headshot", true, 1);

SetEntityConnectionStateChangeCallback("lever1", "unlock_door1");
SetEntityConnectionStateChangeCallback("lever2", "unlock_door2");
SetEntityConnectionStateChangeCallback("lever3", "unlock_door3");
SetEntityPlayerInteractCallback("lever4", "UnlockLevelDoor", false);
SetEntityPlayerInteractCallback("book", "booktoss", false);
SetPlayerSanity(100);
SetPlayerHealth(100);

AddEntityCollideCallback("ScriptArea_1", "servant_brute_1", "Light1", true, 1);
AddEntityCollideCallback("monsterarea_1", "servant_brute_1", "Light2", true, 1);
AddEntityCollideCallback("monsterarea_2", "servant_brute_1", "Light3", true, 1);
AddEntityCollideCallback("monsterarea_3", "servant_brute_1", "Light4", true, 1);
AddEntityCollideCallback("monsterarea_4", "servant_brute_1", "Light5", true, 1);
AddEntityCollideCallback("monsterarea_5", "servant_brute_1", "Light6", true, 1);
}



/////////////////////////Intro////////////////////

void Intro(string &in asParent, string &in asChild, int alState)
{
PlayMusic("00_event_gallery.ogg", false, 1, 1, 7, true);
PlaySoundAtEntity("", "00_event_gallery.ogg", "Player", 0, false);
SetPlayerMoveSpeedMul(0.35f);
FadeRadialBlurTo(1, 5);
PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);
PlaySoundAtEntity("", "enemy_hallucination_disappear.snt", "Player", 0, false);
SetLanternDisabled(true);
}

void StartTeleport(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
AddTimer("", 2.5f, "StartPlayerLook");
PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);
SetMessage("Messages", "SoCold", 2);
}

void StartPlayerLook(string &in asTimer)
{
AddTimer("", 0.8f, "PlayerLook");
PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);
PlaySoundAtEntity("", "player_stand3.ogg", "Player", 0, false);
}

void PlayerLook(string &in asTimer)
{
StartPlayerLookAt("ritual_prisoner_1", 15, 2, "");
AddTimer("", 0.15f, "EndPlayerLook");
PlaySoundAtEntity("", "pickaxe_charge.ogg", "Player", 1, false);
SetLightVisible("PointLight_2", false);
SetLightVisible("PointLight_3", false);
SetLightVisible("PointLight_4", false);
SetLightVisible("PointLight_5", false);
SetLightVisible("SpotLight_1", true);
FadeLightTo("SpotLight_1", 1, 1, 1, 1, -1, 0.1f);
SetEntityActive("ritual_prisoner_1", true);
}

void EndPlayerLook(string &in asTimer)
{
StopPlayerLookAt();
GiveSanityDamage(95, true);
AddTimer("", 0.6f, "Teleport");
}

//////////////////Teleport/////////////

void Teleport(string &in asTimer)
{
PlaySoundAtEntity("", "enemy_hallucination_disappear.snt", "Player", 0, false);
PlayMusic("01_amb_darkness.ogg", false, 1, 1, 7, true);
FadeOut(0);
TeleportPlayer("PlayerStartArea_2");
PlaySoundAtEntity("", "01_amb_darkness.ogg", "Player", 0, true);
}

void Vision(string &in asParent, string &in asChild, int alState)
{

FadeRadialBlurTo(1, 1);
FadeIn(2);
FadeLightTo("PointLight_1", 255, 0, 0, 10, 0, 0.5);
SetPlayerActive(false);
SetPlayerMoveSpeedMul(0.35f);
FadePlayerRollTo(70, 2, 50);
FadePlayerFOVMulTo(1, 1);
SetPlayerCrouching(true);
SetLanternDisabled(true);
StartPlayerLookAt("ScriptArea_7", 2, 2, "");
AddTimer("", 5, "Look2");
}

void Look2(string &in asTimer)
{
StopPlayerLookAt();
StartPlayerLookAt("ScriptArea_8", 2, 2, "");
AddTimer("", 5, "ActivateMonster");
AddTimer("", 5.1f, "Look3");
}

void Look3(string &in asTimer)
{
StopPlayerLookAt();
StartPlayerLookAt("ScriptArea_5", 10, 2, "");
AddTimer("", 1, "Look4");
}

void Look4(string &in asTimer)
{
StopPlayerLookAt();
StartPlayerLookAt("ScriptArea_6", 2, 2, "");
FadePlayerRollTo(0, 13, 20);
AddTimer("", 5, "Teleport2");
}

////////////////////////Monster/////////////////

void ActivateMonster(string &in asTimer)
{
SetEntityActive("waterlurker_1", true);
AddEnemyPatrolNode("waterlurker_1", "PathNodeArea_1", 1, "idle");
AddEnemyPatrolNode("waterlurker_1", "PathNodeArea_2", 1, "idle");
AddEnemyPatrolNode("waterlurker_1", "PathNodeArea_3", 1, "idle");
}


/////////////////''''''//IntroEnd//////////////

void Teleport2(string &in asTimer)
{
TeleportPlayer("PlayerStartArea_1");
PlaySoundAtEntity("", "enemy_hallucination_disappear.snt", "Player", 0, false);
AddTimer("", 2, "EndVision");
SetLightVisible("SpotLight_1", false);
FadeLightTo("SpotLight_1", 0, 0, 0, 0, -1, 0.1f);
SetEntityActive("ritual_prisoner_1", false);
SetEntityActive("waterlurker_1", false);
SetEntityActive("noteA", true);
FadeOut(3);
}

void EndVision(string &in asTimer)
{
FadeIn(2);
FadeRadialBlurTo(0, 2);
StopPlayerLookAt();
SetPlayerActive(true);
SetPlayerHealth(100);
SetPlayerSanity(100);
SetLanternDisabled(false);
SetPlayerMoveSpeedMul(1);
}

///////////////////UnlockDoorPuzzle//////////////////
void unlock_door1(string &in asEntity, int alState)
{
if (alState == 1)
{
AddLocalVarInt("Var1", 1);
}
}

void unlock_door2(string &in asEntity, int alState)
{
if (alState == -1)
{
AddLocalVarInt("Var1", 1);
}
}

void unlock_door3(string &in asEntity, int alState)
{
if (alState == 1)
{
AddLocalVarInt("Var1", 1);
}
}

void UnlockLevelDoor(string &in asEntity)
{

if(GetLocalVarInt("Var1") == 3)
{
SetLevelDoorLocked("leveldoor1", false);
PlaySoundAtEntity("", "07_pick_lock.snt", "Player", 0, false);
SetMessage("Messages", "Lever1", 2);
AddTimer("", 5, "ServantBrute");
PlaySoundAtEntity("", "scare_1.snt", "Player", 0, false);
SetEntityActive("book", true);
}

else
{
SetMessage("Messages", "Lever", 2);
}

}

void ServantBrute(string &in asEntity)
{
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_7", 0, "Run");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_5", 0, "Run");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_4", 0, "Run");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_6", 0, "Run");
}

void booktoss(string &in asEntity)
{
SetMessage("Messages", "Book", 2);
}

void Headshot(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("servant_brute_1", true);
}

/////////////////Lights////////////////////////////////////////////////

void Light1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("torchA1", true);
SetEntityActive("torchA2", true);
PlaySoundAtEntity("", "scare_1.snt", "Player", 0, false);
}

void Light2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("torchB1", true);
SetEntityActive("torchB2", true);
{

void Light3(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("torchC1", true);
SetEntityActive("torchC2", true);
PlaySoundAtEntity("", "scare_1.snt", "Player", 0, false);
}

void Light4(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("torchD1", true);
SetEntityActive("torchD2", true);
}

void Light5(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("torchE1", true);
SetEntityActive("torchE2", true);
PlaySoundAtEntity("", "scare_1.snt", "Player", 0, false);
}

void Light6(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("torchF1", true);
SetEntityActive("torchF2", true);
PlaySoundAtEntity("", "scare_1.snt", "Player", 0, false);
}
11-04-2012, 03:11 AM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: Script Error: Unexpected End of File

Found you problem: after the function "Light2", you didn't close the function, instead you used another open bracket ("{")

Instead of:

Spoiler below!

void Light2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("torchB1", true);
SetEntityActive("torchB2", true);
{



try this:

Spoiler below!

void Light2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("torchB1", true);
SetEntityActive("torchB2", true);
}


Hope that helped!

I rate it 3 memes.
11-04-2012, 04:06 AM
Find
IVSKIN Offline
Junior Member

Posts: 2
Threads: 1
Joined: Nov 2012
Reputation: 0
#3
RE: Script Error: Unexpected End of File

Youre awesome man! I knew it would be something small like that. Thank you! XD
11-05-2012, 08:15 AM
Find




Users browsing this thread: 1 Guest(s)