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
Unexpected end of file...
waqas12346 Offline
Senior Member

Posts: 352
Threads: 38
Joined: Nov 2010
Reputation: 1
#1
Sad  Unexpected end of file...

Hello guys, Have been busy in making CS. Now got an error Sad

Is there something Wrong with the script Cuz it's keep saying:-

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

Please tell me if there is something wrong, Thanks in Advance. Smile

Spoiler below!

void OnStart()
{
AddEntityCollideCallback("enemy_suitor_basile_1", "look1", "Function01", true, 1);
AddEntityCollideCallback("enemy_suitor_basile_1", "look2", "Function02", true, 1);
AddEntityCollideCallback("enemy_suitor_basile_1", "look3", "Function03", true, 1);
AddEntityCollideCallback("enemy_suitor_basile_1", "lookatmonster", "Function04", true, 1);
AddEntityCollideCallback("enemy_suitor_basile_1", "mosteropenedthedoor", "Function05", true, 1);
AddEntityCollideCallback("enemy_suitor_basile_1", "mosterlockedthedoor", "Function06", true, 1);
AddEntityCollideCallback("enemy_suitor_basile_1", "doorvisible", "Function07", true, 1);
AddEntityCollideCallback("Player", "chandelier3unlit", "Function08", true, 1);
AddEntityCollideCallback("Player", "castledoor", "Function09", true, 1);
AddEntityCollideCallback("Player", "slimeapprear", "Function10", true, 1);
}

void Function01(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("arealook1", 1.0f, 1.0f, "");
GiveSanityBoostSmall();
}

void Function02(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("arealook2", 1.0f, 1.0f, "");
GiveSanityBoostSmall();
}

void Function03(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("arealook3", 1.0f, 1.0f, "");
GiveSanityBoostSmall();
}

void Function04(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(10, true);
StartPlayerLookAt("look4", 1.0f, 1.0f, "");
PlayGuiSound("locked_door.snt",1.0f);
}

void Function05(string &in asParent, string &in asChild, int alState)
{
PlayGuiSound("door_level_wood_open.snt",1.0f);
}

void Function06(string &in asParent, string &in asChild, int alState)
{
StopPlayerLookAt();
SetPlayerActive(true);
PlayGuiSound("door_level_wood_close.snt",1.0f);
}

void Function07(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("level_hub_3", true);
}

void Function08(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(10, true);
SetLampLit("chandelier_large_2", false, false);
SetLampLit("chandelier_large_3", false, false);
StartPlayerLookAt("lookatchandelier1", 1.0f, 1.0f, "");
AddTimer("lookatchandelier1", 2.5f, "TimerDoneLookAt");
StartPlayerLookAt("lookatchandelier2", 1.0f, 1.0f, "");
AddTimer("lookatchandelier2", 2.5f, "TimerDoneLookAt");
StopPlayerLookAt();
PlayGuiSound("guardian_distant.snt",1.0f);
}

void Function09(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("lookatdoor", 1.0f, 1.0f, "");
AddTimer("lookatdoor", 2.5f, "TimerDoneLookAt");
StopPlayerLookAt();
PlayMusic("09_amb_safe", true, 1.0f, 0, 0, true);
}

void Function10(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(1000, true);
SetEntityActive("slime_egg_1", true);
SetEntityActive("slime_anim_wall_1", true);
SetEntityActive("slime_pile_large_1", true);
SetEntityActive("slime_anim_ceiling_3", true);
SetEntityActive("slime_anim_ceiling_4", true);
SetEntityActive("slime_6way_1", true);
SetEntityActive("SlimeDamageArea_1", true);
SetEntityActive("SlimeDamageArea_2", true);
SetEntityActive("SlimeDamageArea_3", true);
CreateParticleSystemAtEntity("GuardianSlimeAppearEffect","ps_guardian_appear_explosion.ps", asArea, true);
PlayGuiSound("25_guardian_slime_appear.snt",1.0f);

void OnEnter()
{
GiveSanityDamage(1000, true);
SetPlayerCrouchDisabled(false);
PlayMusic("25_amb", true, 1.0f, 0, 0, true);
SetPlayerActive(false);
SetPlayerMoveSpeedMul(0.5f);
FadeIn(20);
PlayGuiSound("player_bodyfall.snt",1.0f);
FadeRadialBlurTo(0.09, 0.025f);
AddEnemyPatrolNode("enemy_suitor_basile_1", "PathNodeArea_5", 3, "");
AddEnemyPatrolNode("enemy_suitor_basile_1", "PathNodeArea_4", 4, "");
AddEnemyPatrolNode("enemy_suitor_basile_1", "PathNodeArea_3", 2, "");
AddEnemyPatrolNode("enemy_suitor_basile_1", "PathNodeArea_2", 0, "");
}

void OnLeave()
{
}

07-04-2011, 07:05 PM
Website Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#2
RE: Unexpected end of file...

Spoiler below!

void OnStart()
{
AddEntityCollideCallback("enemy_suitor_basile_1", "look1", "Function01", true, 1);
AddEntityCollideCallback("enemy_suitor_basile_1", "look2", "Function02", true, 1);
AddEntityCollideCallback("enemy_suitor_basile_1", "look3", "Function03", true, 1);
AddEntityCollideCallback("enemy_suitor_basile_1", "lookatmonster", "Function04", true, 1);
AddEntityCollideCallback("enemy_suitor_basile_1", "mosteropenedthedoor", "Function05", true, 1);
AddEntityCollideCallback("enemy_suitor_basile_1", "mosterlockedthedoor", "Function06", true, 1);
AddEntityCollideCallback("enemy_suitor_basile_1", "doorvisible", "Function07", true, 1);
AddEntityCollideCallback("Player", "chandelier3unlit", "Function08", true, 1);
AddEntityCollideCallback("Player", "castledoor", "Function09", true, 1);
AddEntityCollideCallback("Player", "slimeapprear", "Function10", true, 1);
}

void Function01(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("arealook1", 1.0f, 1.0f, "");
GiveSanityBoostSmall();
}

void Function02(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("arealook2", 1.0f, 1.0f, "");
GiveSanityBoostSmall();
}

void Function03(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("arealook3", 1.0f, 1.0f, "");
GiveSanityBoostSmall();
}

void Function04(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(10, true);
StartPlayerLookAt("look4", 1.0f, 1.0f, "");
PlayGuiSound("locked_door.snt",1.0f);
}

void Function05(string &in asParent, string &in asChild, int alState)
{
PlayGuiSound("door_level_wood_open.snt",1.0f);
}

void Function06(string &in asParent, string &in asChild, int alState)
{
StopPlayerLookAt();
SetPlayerActive(true);
PlayGuiSound("door_level_wood_close.snt",1.0f);
}

void Function07(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("level_hub_3", true);
}

void Function08(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(10, true);
SetLampLit("chandelier_large_2", false, false);
SetLampLit("chandelier_large_3", false, false);
StartPlayerLookAt("lookatchandelier1", 1.0f, 1.0f, "");
AddTimer("lookatchandelier1", 2.5f, "TimerDoneLookAt");
StartPlayerLookAt("lookatchandelier2", 1.0f, 1.0f, "");
AddTimer("lookatchandelier2", 2.5f, "TimerDoneLookAt");
StopPlayerLookAt();
PlayGuiSound("guardian_distant.snt",1.0f);
}

void Function09(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("lookatdoor", 1.0f, 1.0f, "");
AddTimer("lookatdoor", 2.5f, "TimerDoneLookAt");
StopPlayerLookAt();
PlayMusic("09_amb_safe", true, 1.0f, 0, 0, true);
}

void Function10(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(1000, true);
SetEntityActive("slime_egg_1", true);
SetEntityActive("slime_anim_wall_1", true);
SetEntityActive("slime_pile_large_1", true);
SetEntityActive("slime_anim_ceiling_3", true);
SetEntityActive("slime_anim_ceiling_4", true);
SetEntityActive("slime_6way_1", true);
SetEntityActive("SlimeDamageArea_1", true);
SetEntityActive("SlimeDamageArea_2", true);
SetEntityActive("SlimeDamageArea_3", true);
CreateParticleSystemAtEntity("GuardianSlimeAppearEffect","ps_guardian_appear_explosion.ps", asArea, true);
PlayGuiSound("25_guardian_slime_appear.snt",1.0f);

void OnEnter()
{
GiveSanityDamage(1000, true);
SetPlayerCrouchDisabled(false);
PlayMusic("25_amb", true, 1.0f, 0, 0, true);
SetPlayerActive(false);
SetPlayerMoveSpeedMul(0.5f);
FadeIn(20);
PlayGuiSound("player_bodyfall.snt",1.0f);
FadeRadialBlurTo(0.09f, 0.025f);
AddEnemyPatrolNode("enemy_suitor_basile_1", "PathNodeArea_5", 3, "");
AddEnemyPatrolNode("enemy_suitor_basile_1", "PathNodeArea_4", 4, "");
AddEnemyPatrolNode("enemy_suitor_basile_1", "PathNodeArea_3", 2, "");
AddEnemyPatrolNode("enemy_suitor_basile_1", "PathNodeArea_2", 0, "");
}

void OnLeave()
{
}

Try that. You had 0.09 instead of 0.09f.
07-04-2011, 07:16 PM
Find
nemesis567 Offline
Posting Freak

Posts: 874
Threads: 65
Joined: May 2011
Reputation: 10
#3
RE: Unexpected end of file...

Replace with:
void OnStart()
{
AddEntityCollideCallback("enemy_suitor_basile_1", "look1", "Function01", true, 1);
AddEntityCollideCallback("enemy_suitor_basile_1", "look2", "Function02", true, 1);
AddEntityCollideCallback("enemy_suitor_basile_1", "look3", "Function03", true, 1);
AddEntityCollideCallback("enemy_suitor_basile_1", "lookatmonster", "Function04", true, 1);
AddEntityCollideCallback("enemy_suitor_basile_1", "mosteropenedthedoor", "Function05", true, 1);
AddEntityCollideCallback("enemy_suitor_basile_1", "mosterlockedthedoor", "Function06", true, 1);
AddEntityCollideCallback("enemy_suitor_basile_1", "doorvisible", "Function07", true, 1);
AddEntityCollideCallback("Player", "chandelier3unlit", "Function08", true, 1);
AddEntityCollideCallback("Player", "castledoor", "Function09", true, 1);
AddEntityCollideCallback("Player", "slimeapprear", "Function10", true, 1);
}

void Function01(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("arealook1", 1.0f, 1.0f, "");
GiveSanityBoostSmall();
}

void Function02(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("arealook2", 1.0f, 1.0f, "");
GiveSanityBoostSmall();
}

void Function03(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("arealook3", 1.0f, 1.0f, "");
GiveSanityBoostSmall();
}

void Function04(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(10, true);
StartPlayerLookAt("look4", 1.0f, 1.0f, "");
PlayGuiSound("locked_door.snt",1.0f);
}

void Function05(string &in asParent, string &in asChild, int alState)
{
PlayGuiSound("door_level_wood_open.snt",1.0f);
}

void Function06(string &in asParent, string &in asChild, int alState)
{
StopPlayerLookAt();
SetPlayerActive(true);
PlayGuiSound("door_level_wood_close.snt",1.0f);
}

void Function07(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("level_hub_3", true);
}

void Function08(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(10, true);
SetLampLit("chandelier_large_2", false, false);
SetLampLit("chandelier_large_3", false, false);
StartPlayerLookAt("lookatchandelier1", 1.0f, 1.0f, "");
AddTimer("lookatchandelier1", 2.5f, "TimerDoneLookAt");
StartPlayerLookAt("lookatchandelier2", 1.0f, 1.0f, "");
AddTimer("lookatchandelier2", 2.5f, "TimerDoneLookAt");
StopPlayerLookAt();
PlayGuiSound("guardian_distant.snt",1.0f);
}

void Function09(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("lookatdoor", 1.0f, 1.0f, "");
AddTimer("lookatdoor", 2.5f, "TimerDoneLookAt");
StopPlayerLookAt();
PlayMusic("09_amb_safe", true, 1.0f, 0, 0, true);
}

void Function10(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(1000, true);
SetEntityActive("slime_egg_1", true);
SetEntityActive("slime_anim_wall_1", true);
SetEntityActive("slime_pile_large_1", true);
SetEntityActive("slime_anim_ceiling_3", true);
SetEntityActive("slime_anim_ceiling_4", true);
SetEntityActive("slime_6way_1", true);
SetEntityActive("SlimeDamageArea_1", true);
SetEntityActive("SlimeDamageArea_2", true);
SetEntityActive("SlimeDamageArea_3", true);
CreateParticleSystemAtEntity("GuardianSlimeAppearEffect","ps_guardian_appear_explosion.ps", asArea, true);
PlayGuiSound("25_guardian_slime_appear.snt",1.0f);
}
void OnEnter()
{
GiveSanityDamage(1000, true);
SetPlayerCrouchDisabled(false);
PlayMusic("25_amb", true, 1.0f, 0, 0, true);
SetPlayerActive(false);
SetPlayerMoveSpeedMul(0.5f);
FadeIn(20);
PlayGuiSound("player_bodyfall.snt",1.0f);
FadeRadialBlurTo(0.09, 0.025f);
AddEnemyPatrolNode("enemy_suitor_basile_1", "PathNodeArea_5", 3, "");
AddEnemyPatrolNode("enemy_suitor_basile_1", "PathNodeArea_4", 4, "");
AddEnemyPatrolNode("enemy_suitor_basile_1", "PathNodeArea_3", 2, "");
AddEnemyPatrolNode("enemy_suitor_basile_1", "PathNodeArea_2", 0, "");
}

void OnLeave()
{
}

Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
07-04-2011, 07:17 PM
Find
waqas12346 Offline
Senior Member

Posts: 352
Threads: 38
Joined: Nov 2010
Reputation: 1
#4
RE: Unexpected end of file...

Thanks Roenlond and nemesis567 The script works. Big Grin
But nemesis567, What did you replaced??? Huh
07-04-2011, 08:04 PM
Website Find
xiphirx Offline
Senior Member

Posts: 662
Threads: 16
Joined: Nov 2010
Reputation: 5
#5
RE: Unexpected end of file...

He just closed the brackets on the function "Function10".

Unexpected EOF typically means you forgot a closing bracket or semi colon.

07-04-2011, 09:47 PM
Find




Users browsing this thread: 1 Guest(s)