Frictional Games Forum (read-only)
Problem with Unexpected end of file - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Problem with Unexpected end of file (/thread-14217.html)



Problem with Unexpected end of file - Shives - 03-24-2012

Hi
Problem:
main(102,5) : Error : Unexpected end of file

Ich searched for the problem for about 10 minutes and ich can't find it

Code:
AddEntityCollideCallback("Player", "ScriptArea_2", "ger", true, 1);
}
  void Windig(string &in asParent, string &in asChild, int alState)
{
  PlayMusic("01_event_critters.ogg", false, 0.7, 3, 0, false);
  SetLightVisible("PointLight_1", false);
  GiveSanityDamage(9.0f, true);
  SetLampLit("Kronleuchter", false, true);
  AddPropImpulse("Kronleuchter", -2, 0, -2, "world");
  CreateParticleSystemAtEntity("", "ps_dust_whirl.ps", "particle", false);
  StartPlayerLookAt("look", 2, 4, "StopPlayerLookAt");
  PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
  PlaySoundAtEntity("", "scare_wind_reverse.snt", "Player", 0, false);
}
  void Auge(string &in asParent, string &in asChild, int alState)
{
  PlaySoundAtEntity("", "00_creak.snt", "Player", 0, false);
  SetPlayerJumpDisabled(true);
  SetPlayerCrouchDisabled(true);
  SetPlayerMoveSpeedMul(0.6f);
  SetPlayerLookSpeedMul(0.6f);
  PlaySoundAtEntity("", "Horror.snt", "Player", 0, false);
  MovePlayerHeadPos(0.0, -1.3f, 0, 0.75, 0.5f);
  FadePlayerRollTo(-12, 0.3f, 0.8f);
  AddTimer("", 5, "Augezwei");
  SetLightVisible("PointLight_2", false);
}
  void Augezwei(string &in asTimer)
{
  FadePlayerRollTo(0, 1, 3);
  SetPlayerMoveSpeedMul(1.0f);
  SetPlayerLookSpeedMul(1.0f);
  SetPlayerJumpDisabled(false);
  SetPlayerCrouchDisabled(false);
  MovePlayerHeadPos(0.0f, 0.0f, 0.0f, 10.0f, 20.0f);
}
   void S(string &in asParent, string &in asChild, int alState)
{
  GiveSanityDamage(9.0f, true);
  PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
SetPropActiveAndFade("S_1", true, 1.0f);
CreateParticleSystemAtEntity("", "ps_guardian_appear_explosion.ps", "S_1", false);
SetPropActiveAndFade("S_2", true, 1.0f);
CreateParticleSystemAtEntity("", "ps_guardian_appear_explosion.ps", "S_2", false);
SetPropActiveAndFade("S_3", true, 1.0f);
CreateParticleSystemAtEntity("", "ps_guardian_appear_explosion.ps", "S_3", false);
SetPropActiveAndFade("S_4", true, 1.0f);
CreateParticleSystemAtEntity("", "ps_guardian_appear_explosion.ps", "S_4", false);
SetPropActiveAndFade("S_5", true, 1.0f);
CreateParticleSystemAtEntity("", "ps_guardian_appear_explosion.ps", "S_5", false);
  StartScreenShake(0.9f, 1, 0.9f, 1.0f);
}
  void Attic(string &in asParent, string &in asChild, int alState)
{
  FadePlayerRollTo(-12, 0.3f, 0.8f);
  SetPlayerMoveSpeedMul(0.6f);
  SetPlayerLookSpeedMul(0.6f);
  PlaySoundAtEntity("", "00_creak.snt", "Player", 0, false);
  AddTimer("", 5, "Noise);
}
  void Noise(string &in asTimer)
{
  FadePlayerRollTo(0, 1, 3);
  SetPlayerMoveSpeedMul(1.0f);
  SetPlayerLookSpeedMul(1.0f);
  PlaySoundAtEntity("", "03_no.snt", "Player", 0, false);
}
  void ger(string &in asParent, string &in asChild, int alState)
{
  StartScreenShake(0.9f, 1, 0.9f, 1.0f);
  GiveSanityDamage(9.0f, true);
  PlaySoundAtEntity("", "Insanitymonster.snt", "Player", 0, false);
CreateParticleSystemAtEntity("", "ps_dust_falling_door_quick.ps", "ScriptArea_3", false);
CreateParticleSystemAtEntity("", "ps_dust_falling_door_quick.ps", "ScriptArea_4", false);
CreateParticleSystemAtEntity("", "ps_dust_falling_door_quick.ps", "ScriptArea_5", false);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
  PlayMusic("16_amb.ogg", true, 0.7, 3, 0, true);
    FadeOut(0);
    FadeIn(8);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{
    SetupLoadScreen("", "", 1, "LoadAttic.jpg");
}



RE: Problem with Unexpected end of file - SilentStriker - 03-24-2012

Can you send the whole script?



RE: Problem with Unexpected end of file - Shives - 03-25-2012

Do you mean send as PM



RE: Problem with Unexpected end of file - SilentStriker - 03-25-2012

Nu just post your whole script here, because the one you put up is not the full script



RE: Problem with Unexpected end of file - Shives - 03-25-2012

////////////////////////////
// Run first time starting map
void OnStart()
{
SetLightVisible("PointLight_3", false);
AddEntityCollideCallback("Player", "Area_1", "Windig", true, 1);
AddEntityCollideCallback("Player", "Area_2", "Auge", true, 1);
AddEntityCollideCallback("Player", "Area_4", "S", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_1", "Attic", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "ger", true, 1);
}
void Windig(string &in asParent, string &in asChild, int alState)
{
PlayMusic("01_event_critters.ogg", false, 0.7, 3, 0, false);
SetLightVisible("PointLight_1", false);
GiveSanityDamage(9.0f, true);
SetLampLit("Kronleuchter", false, true);
AddPropImpulse("Kronleuchter", -2, 0, -2, "world");
CreateParticleSystemAtEntity("", "ps_dust_whirl.ps", "particle", false);
StartPlayerLookAt("look", 2, 4, "StopPlayerLookAt");
PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
PlaySoundAtEntity("", "scare_wind_reverse.snt", "Player", 0, false);
}
void Auge(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "00_creak.snt", "Player", 0, false);
SetPlayerJumpDisabled(true);
SetPlayerCrouchDisabled(true);
SetPlayerMoveSpeedMul(0.6f);
SetPlayerLookSpeedMul(0.6f);
PlaySoundAtEntity("", "Horror.snt", "Player", 0, false);
MovePlayerHeadPos(0.0, -1.3f, 0, 0.75, 0.5f);
FadePlayerRollTo(-12, 0.3f, 0.8f);
AddTimer("", 5, "Augezwei");
SetLightVisible("PointLight_2", false);
}
void Augezwei(string &in asTimer)
{
FadePlayerRollTo(0, 1, 3);
SetPlayerMoveSpeedMul(1.0f);
SetPlayerLookSpeedMul(1.0f);
SetPlayerJumpDisabled(false);
SetPlayerCrouchDisabled(false);
MovePlayerHeadPos(0.0f, 0.0f, 0.0f, 10.0f, 20.0f);
}
void S(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(9.0f, true);
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
SetPropActiveAndFade("S_1", true, 1.0f);
CreateParticleSystemAtEntity("", "ps_guardian_appear_explosion.ps", "S_1", false);
SetPropActiveAndFade("S_2", true, 1.0f);
CreateParticleSystemAtEntity("", "ps_guardian_appear_explosion.ps", "S_2", false);
SetPropActiveAndFade("S_3", true, 1.0f);
CreateParticleSystemAtEntity("", "ps_guardian_appear_explosion.ps", "S_3", false);
SetPropActiveAndFade("S_4", true, 1.0f);
CreateParticleSystemAtEntity("", "ps_guardian_appear_explosion.ps", "S_4", false);
SetPropActiveAndFade("S_5", true, 1.0f);
CreateParticleSystemAtEntity("", "ps_guardian_appear_explosion.ps", "S_5", false);
StartScreenShake(0.9f, 1, 0.9f, 1.0f);
}
void Attic(string &in asParent, string &in asChild, int alState)
{
FadePlayerRollTo(-12, 0.3f, 0.8f);
SetPlayerMoveSpeedMul(0.6f);
SetPlayerLookSpeedMul(0.6f);
PlaySoundAtEntity("", "00_creak.snt", "Player", 0, false);
AddTimer("", 5, "Noise);
}
void Noise(string &in asTimer)
{
FadePlayerRollTo(0, 1, 3);
SetPlayerMoveSpeedMul(1.0f);
SetPlayerLookSpeedMul(1.0f);
PlaySoundAtEntity("", "03_no.snt", "Player", 0, false);
}
void ger(string &in asParent, string &in asChild, int alState)
{
StartScreenShake(0.9f, 1, 0.9f, 1.0f);
GiveSanityDamage(9.0f, true);
PlaySoundAtEntity("", "Insanitymonster.snt", "Player", 0, false);
CreateParticleSystemAtEntity("", "ps_dust_falling_door_quick.ps", "ScriptArea_3", false);
CreateParticleSystemAtEntity("", "ps_dust_falling_door_quick.ps", "ScriptArea_4", false);
CreateParticleSystemAtEntity("", "ps_dust_falling_door_quick.ps", "ScriptArea_5", false);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
PlayMusic("16_amb.ogg", true, 0.7, 3, 0, true);
FadeOut(0);
FadeIn(8);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{
SetupLoadScreen("", "", 1, "LoadAttic.jpg");
}




RE: Problem with Unexpected end of file - Shives - 03-25-2012

another question
What means thos numbers in the Error message?
For example "main(102.2)"



RE: Problem with Unexpected end of file - stonecutter - 03-25-2012

main(102,2)

main = the file name
102 = the linenumber where the problem is located



RE: Problem with Unexpected end of file - Shives - 03-25-2012

I deleted line 102
The new Error is
main(100,2) : Error : Unexpected end of file



RE: Problem with Unexpected end of file - SilentStriker - 03-25-2012

As stonecutter said, the numbers are there to show you where the problem is the first number is for what row and the last number is for what thing in that row that is the problem.



RE: Problem with Unexpected end of file - Your Computer - 03-25-2012

The thing about unexpected end of file errors is the compiler will almost always state the last line in the script, which isn't where the error is. The error is really, in this case, in the Attic function at AddTimer.