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 Help Unexpected end to file
Southlaguna Offline
Member

Posts: 70
Threads: 21
Joined: Jan 2012
Reputation: 0
#1
Sad  Unexpected end to file

I have gotten my map all done and I have almost all scripting done with multiple tests done to see if if each step works and everystep has worked until now. I recently added a new script which has nothing wrong with it, but somehow it has corrupted the file into getting a "ERR. Unexpected end to file (224,1). I have not touched the end of the script and i have tried removing the recent update to the file to see if that solves the problem which it hasn't.
Can someone please look into what may be causing this because i've worked really hard to get this far then it just craps out on me, kinda sucks...


Attached Files
.log   LevelEditor.log (Size: 8.72 KB / Downloads: 195)

(This post was last modified: 02-10-2012, 07:57 AM by Your Computer.)
02-10-2012, 06:14 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
RE: Please check the troubleshooting guides before posting!

Show us the script file in question please.

02-10-2012, 07:18 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#3
RE: Please check the troubleshooting guides before posting!

It wouldn't give you that error if there was nothing wrong with it. Level editor has nothing to do with script errors. Unexpected end of file is a human-caused error.

BTW, i'm going to change the topic title (not sure why you decided on that title).

Tutorials: From Noob to Pro
02-10-2012, 07:57 AM
Website Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#4
RE: Unexpected end to file

I've found, typically, that the reason for the "Unexpected end of file" errors is due to my not closing off a string properly, due to missing the last set of quotation marks. Double check all of your lines requiring strings.

02-10-2012, 08:30 AM
Find
Southlaguna Offline
Member

Posts: 70
Threads: 21
Joined: Jan 2012
Reputation: 0
#5
RE: Unexpected end to file


////////////////////////////
// Run when entering map
void OnStart()
{
AddUseItemCallback("", "doorkey_1", "locked_door", "UnlockDoor", true);
AddEntityCollideCallback("Player", "onlight", "OnLightActivate", true, 1);
SetEntityPlayerInteractCallback("lantern_1", "OnPickup", true);
AddEntityCollideCallback("Player", "Time", "ActivateSequence", true, 1);
}
void UnlockDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("locked_door", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "locked_door", 0, false);
RemoveItem("doorkey_1");
}
void OnPickup(string &in asEntity)
{
SetEntityPlayerInteractCallback("latern_1", "Music", true);
PlayMusic("01_puzzle_passage.ogg", false, 3, 2, 1, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
SetEntityPlayerLookAtCallback("swing_door_1", "SwingDoor", true);
}
void SwingDoor(string &in asEntity, int alState)
{
SetSwingDoorDisableAutoClose("swing_door_1", true);
SetSwingDoorClosed("swing_door_1", false, true);
AddPropForce("swing_door_1", 0, 0, 2000, "world");
CreateParticleSystemAtEntity("", "ps_dust_whirl.ps", "swing_door_1", false);
PlaySoundAtEntity("", "general_wind_whirl.snt", "swing_door_1", 0, false);
PlaySoundAtEntity("", "door_mansion_open.snt", "Player", 0, false);
}
void ActivateSequence(string &in asParent, string &in asChild, int alState)
{
AddTimer("T8", 0, "Scare_1");
AddTimer("T9", 1, "Scare_1");
AddTimer("T10", 5, "Scare_1");
AddTimer("T11", 9, "Scare_1");
AddTimer("T12", 7, "Scare_1");
AddTimer("T13", 11, "Scare_1");
AddTimer("T14", 13, "Scare_1");
AddEntityCollideCallback("Player", "Area_1", "ScareShitless", true, 1);
AddEntityCollideCallback("Player", "Area_2", "ScareShitless", true, 1);
AddEntityCollideCallback("Player", "Area_3", "HolyShit", true, 1);
AddEntityCollideCallback("Player", "Area_4", "HolyShit", true, 1);
AddEntityCollideCallback("Player", "Area_5", "HolyShit", true, 1);
}
void Scare_1(string &in asTimer)
{
string x = asTimer;
if (x == "T8")
{
SetLampLit("shrine_candle_2", true, true);
SetLampLit("shrine_candle_1", true, true);
SetPlayerMoveSpeedMul(0.3);
StartPlayerLookAt("LookAt", 2, 2, "");
PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);
FadePlayerFOVMulTo(0.5, 1.5);
StopMusic(1, 1);
}
else if (x == "T9")
{
PlayMusic("15_the_big_scream3.ogg", false, 4, 1, 0, true);
StopPlayerLookAt();
FadePlayerFOVMulTo(1, 1.5);
}
else if (x == "T10")
{
StartPlayerLookAt("LookAt_2", 2, 2, "");
}
else if (x == "T12")
{
StopPlayerLookAt();
PlaySoundAtEntity("", "scare_wood_creak_walk.snt", "creak", 0, false);
}
else if (x == "T11")
{
SetEntityActive("brute_1", true);
PlaySoundAtEntity("", "24_iron_maiden.snt", "brute_1", 0, false);
PlaySoundAtEntity("", "24_iron_maiden.snt", "brute_1", 0, false);
StartPlayerLookAt("brute_1", 4, 4, "");
ShowEnemyPlayerPosition("brute_1");
}
else if (x == "T13")
{
SetPlayerMoveSpeedMul(1);
}
else if (x == "T14")
{
FadeEnemyToSmoke("brute_1", true);
StopPlayerLookAt();
}
void ScaredShitless(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("brute_2", true);
PlaySoundAtEntity("", "24_iron_maiden.snt", "brute_2", 0, false);
PlaySoundAtEntity("", "24_iron_maiden.snt", "brute_2", 0, false);
ShowEnemyPlayerPosition("brute_2");
AddTimer("T15", 1, "Scare_2");
AddTimer("T16", 5, "Scare_2");
}
void Scare_2(string &in asTimer)
{
string x = asTimer;
if (x == "T15")
{
StartPlayerLookAt("brute_2", 4, 4, "");
}
if (x == "T16")
{
FadeEnemyToSmoke("brute_2", true);
StopPlayerLookAt();
}
void ScaredShitless(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("brute_3", true);
PlaySoundAtEntity("", "24_iron_maiden.snt", "brute_3", 0, false);
PlaySoundAtEntity("", "24_iron_maiden.snt", "brute_3", 0, false);
ShowEnemyPlayerPosition("brute_3");
AddTimer("T117", 1, "Scare_3");
AddTimer("T18", 5, "Scare_3");
}
void Scare_3(string &in asTimer)
{
string x = asTimer;
if (x == "T17")
{
StartPlayerLookAt("brute_3", 4, 4, "");
}
if (x == "T18")
{
FadeEnemyToSmoke("brute_3", true);
StopPlayerLookAt();
}
}
////////////////////////////
// Run when entering map
void OnEnter()
{
PlaySoundAtEntity("", "notice.snt", "Player", 0, false);
SetPlayerActive(false);
SetPlayerCrouching(true);
FadeOut(0);
FadeIn(3);
AddTimer("T1", 3, "Intro");
AddTimer("T2", 6, "Intro");
AddTimer("T3", 8, "Intro");
AddTimer("T4", 10, "Intro");
AddTimer("T5", 12, "Intro");
AddTimer("T6", 20, "Intro");
AddTimer("T7", 23, "Intro");
SetLightVisible("onlight_1", false);
SetLightVisible("onlight_2", false);
SetLightVisible("onlight_3", false);
SetLightVisible("onlight_4", false);
SetLightVisible("onlight_5", false);
SetLightVisible("onlight_6", false);
AddEntityCollideCallback("Player", "scare_1", "ScareOne", true, 1);
}

void Intro(string &in asTimer)
{
string x = asTimer;
if (x == "T1")
{
PlayMusic("insanity_monster_roar02.ogg", false, 3, 1, 0, true);
FadeOut(3);
}
else if (x == "T2")
{
FadeIn(3);
PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);
StartPlayerLookAt("ScriptArea_1", 2, 2, "");
}
else if (x == "T3")
{
PlayMusic("insanity_monster_roar01.ogg", false, 3, 1, 0, true);
StopPlayerLookAt();
StartPlayerLookAt("ScriptArea_2", 2, 2, "");
}
else if (x == "T4")
{
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
StopPlayerLookAt();
}
else if (x == "T5")
{
SetPlayerCrouching(false);
SetPlayerActive(true);
}
else if (x == "T6")
{
StartScreenShake(0.1, 2, 1, 1);
PlayMusic("insanity_monster_roar03.ogg", false, 5, 1, 0, true);
}
else if (x == "T7")
{
PlayMusic("ambience_haunting.ogg", true, 2, 1, 1, true);
}
}

void OnLightActivate(string &in asParent, string &in asChild, int alState)
{
SetLightVisible("onlight_1", true);
SetLightVisible("onlight_2", true);
SetLightVisible("onlight_3", true);
SetLightVisible("onlight_4", true);
SetLightVisible("onlight_5", true);
SetLightVisible("onlight_6", true);
SetLampLit("ontorch_1", true, true);
SetLampLit("ontorch_2", true, true);
SetLampLit("ontorch_3", true, true);
SetLampLit("ontorch_4", true, true);
SetLampLit("ontorch_5", true, true);
SetLampLit("ontorch_6", true, true);
PlaySoundAtEntity("", "27_thump.snt", "onlight", 0, false);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}

I checked it over and i cant see anything, it says the errors on line 224 which is the last one on here, any advice?

02-10-2012, 09:37 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#6
RE: Unexpected end to file

On my first skim i see that Scare_1 wasn't properly closed (i.e. is missing a closing bracket).

Tutorials: From Noob to Pro
02-10-2012, 10:05 PM
Website Find
Southlaguna Offline
Member

Posts: 70
Threads: 21
Joined: Jan 2012
Reputation: 0
#7
RE: Unexpected end to file

Im still getting the error, on the pop up it says that the missing end is the final brack on the hps file.

02-10-2012, 10:29 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#8
RE: Unexpected end to file

Scare_2 seems to also be missing a closing bracket.

Tutorials: From Noob to Pro
02-10-2012, 10:31 PM
Website Find
Southlaguna Offline
Member

Posts: 70
Threads: 21
Joined: Jan 2012
Reputation: 0
#9
RE: Unexpected end to file

I must be honest i dont see what you are referring to. this is what i see and i cant find any missing closing brackets
void Scare_1(string &in asTimer)

AddTimer("T8", 0, "Scare_1");
AddTimer("T9", 1, "Scare_1");
AddTimer("T10", 5, "Scare_1");
AddTimer("T11", 9, "Scare_1");
AddTimer("T12", 7, "Scare_1");
AddTimer("T13", 11, "Scare_1");
AddTimer("T14", 13, "Scare_1");



AddTimer("T15", 1, "Scare_2");

AddTimer("T16", 5, "Scare_2");

void Scare_2(string &in asTimer)


02-10-2012, 10:38 PM
Find
Your Computer Offline
SCAN ME!

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

You're not going to find what's not there. You have to add it in.

Tutorials: From Noob to Pro
02-10-2012, 11:11 PM
Website Find




Users browsing this thread: 1 Guest(s)