Frictional Games Forum (read-only)

Full Version: Unexpected end of file...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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()
{
}

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.
Replace with:
Code:
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()
{
}
Thanks Roenlond and nemesis567 The script works. Big Grin
But nemesis567, What did you replaced??? Huh
He just closed the brackets on the function "Function10".

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