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
Problem with Unexpected end of file
Shives Offline
Member

Posts: 154
Threads: 41
Joined: Jan 2012
Reputation: 1
#1
Problem with Unexpected end of file

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

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");
}

My Custom Story
http://www.frictionalgames.com/forum/thread-12587.html

Sorry for bad English


03-24-2012, 10:07 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#2
RE: Problem with Unexpected end of file

Can you send the whole script?

03-24-2012, 10:50 PM
Find
Shives Offline
Member

Posts: 154
Threads: 41
Joined: Jan 2012
Reputation: 1
#3
RE: Problem with Unexpected end of file

Do you mean send as PM

My Custom Story
http://www.frictionalgames.com/forum/thread-12587.html

Sorry for bad English


(This post was last modified: 03-25-2012, 09:51 AM by Shives.)
03-25-2012, 09:51 AM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#4
RE: Problem with Unexpected end of file

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

03-25-2012, 10:05 AM
Find
Shives Offline
Member

Posts: 154
Threads: 41
Joined: Jan 2012
Reputation: 1
#5
RE: Problem with Unexpected end of file

////////////////////////////
// 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");
}


My Custom Story
http://www.frictionalgames.com/forum/thread-12587.html

Sorry for bad English


03-25-2012, 11:02 AM
Find
Shives Offline
Member

Posts: 154
Threads: 41
Joined: Jan 2012
Reputation: 1
#6
RE: Problem with Unexpected end of file

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

My Custom Story
http://www.frictionalgames.com/forum/thread-12587.html

Sorry for bad English


03-25-2012, 01:34 PM
Find
stonecutter Offline
Member

Posts: 140
Threads: 17
Joined: Feb 2011
Reputation: 4
#7
RE: Problem with Unexpected end of file

main(102,2)

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

We Shall Arise - Death / Grind from Bavaria
Musicvideo : http://goo.gl/HzxvLK
Facebook : http://goo.gl/9YfYCV
Free Album : http://goo.gl/sEBW2X
03-25-2012, 01:54 PM
Find
Shives Offline
Member

Posts: 154
Threads: 41
Joined: Jan 2012
Reputation: 1
#8
RE: Problem with Unexpected end of file

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

My Custom Story
http://www.frictionalgames.com/forum/thread-12587.html

Sorry for bad English


03-25-2012, 02:39 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#9
RE: Problem with Unexpected end of file

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.

03-25-2012, 04:02 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#10
RE: Problem with Unexpected end of file

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.

Tutorials: From Noob to Pro
(This post was last modified: 03-25-2012, 04:36 PM by Your Computer.)
03-25-2012, 04:34 PM
Website Find




Users browsing this thread: 1 Guest(s)