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
Help
7thProductions Offline
Junior Member

Posts: 42
Threads: 17
Joined: Mar 2012
Reputation: 0
#1
Help

I keep getting this error whenever I attempt to launch my map:

'Unexpected end of file.'

And I cannot find the cause of this error no matter how times I review my script:

void OnStart()
{
SetPlayerActive(false);
SetPlayerCrouching(true);
ShowPlayerCrossHairIcons(false);
SetSanityDrainDisabled(true);
FadeOut(9.5f);
CreateParticleSystemAtEntity("", "ps_light_dust_large.ps", "PSArea_1", false);
CreateParticleSystemAtEntity("", "ps_light_dust_large.ps", "PSArea_2", false);
CreateParticleSystemAtEntity("", "ps_light_dust.ps", "PSArea_3", false);
CreateParticleSystemAtEntity("", "ps_light_dust.ps", "PSArea_4", false);
CreateParticleSystemAtEntity("", "ps_light_dust_large.ps", "PSArea_5", false);
AddTimer("T1", 10.0f, "StartIntro1");
}

void StartIntro1(string &in asTimer)
{
string x = asTimer;
if (x == "T1")
{
TeleportPlayer("PlayerStartArea_2");
AddTimer("T2", 2.0f, "IntroEvent1");
AddTimer("T3", 2.5f, "IntroEvent1");
AddTimer("T4", 4.0f, "IntroEvent1");
AddTimer("T5", 9.0f, "IntroEvent1");
AddTimer("T6", 20.5f, "IntroEvent1");
AddTimer("T7", 21.5f, "IntroEvent1");
AddTimer("T8", 22.5f, "IntroEvent1");
}
}

void IntroEvent1(string &in asTimer)
{
string x = asTimer;
if (x == "T2")
{
FadeIn(3.0f);
StartPlayerLookAt("ScriptArea_1", 1.5f, 5.0f, "");
}

else if (x == "T3")
{
FadePlayerFOVMulTo(0.01f, 0.1f);
}

else if (x == "T4")
{
SetMessage("Messages", "Intro1", 4.5f);
}

else if (x == "T5")
{
SetMessage("Messages", "Intro2", 0);
}

else if (x == "T6")
{
FadeOut(5.0f);
StartScreenShake(0.1f, 4.8f, 0.5f, 0.01f);
StartEffectFlash(0.5f, 1.0f, 2.0f);
}

else if (x == "T7")
{
PlaySoundAtEntity("", "grunt/notice.snt", "ScriptArea_1", 0.0f, false);
PlaySoundAtEntity("", "grunt/enabled.snt", "ScriptArea_1", 1.0f, false);
}

else if (x == "T8")
{
SetEntityActive("painting_portrait_insane_1", true);
StopPlayerLookAt();
AddTimer("T9", 2.5f, "IntroText1");
AddTimer("T10", 7.5f, "IntroText1");
}
}

void IntroText1(string &in asTimer)
{
string x = asTimer;
if (x == "T9")
{
TeleportPlayer("PlayerStartArea_1");
FadePlayerFOVMulTo(1.0f, 5.0f);
FadeIn(6.0f);
}

else if (x == "T10")
{
SetMessage("Messages", "IntroText1", 5.0f);
FadeOut(6.0f);
AddTimer("T11", 7.0f, "IntroEvent2");
AddTimer("T12", 8.0f, "IntroEvent2");
AddTimer("T13", 11.5f, "IntroEvent2");
AddTimer("T14", 15.0f, "IntroEvent2");
AddTimer("T15", 20.0f, "IntroEvent2");
AddTimer("T16", 21.0f, "IntroEvent2");
AddTimer("T17", 24.0f, "IntroEvent2");
}
}

void IntroEvent2(string &in asTimer)
{
string x = asTimer;
if (x == "T11")
{
TeleportPlayer("PlayerStartArea_3");
SetLampLit("altar_lamp_1", true, false);
StartPlayerLookAt("ScriptArea_2", 0.08f, 5.0f, "");
}

else if (x == "T12")
{
FadeIn(5.0f);
}

else if (x == "T13")
{
SetMessage("Messages", "Intro3", 0.0f);
}

else if (x == "T14")
{
GiveSanityDamage(1.0f, true);
SetEntityActive("slime_pile_large_1", true);
SetEntityActive("slime_3way_1", true);
SetEntityActive("slime_6way_1", true);
SetEntityActive("slime_3way_2", true);
CreateParticleSystemAtEntity("", "ps_guardian_appear_explosion.ps", "ScriptArea_3", false);
PlaySoundAtEntity("", "guardian_activated.snt", "ScriptArea_3", 0.5f, false);
}

else if (x == "T15")
{
CreateParticleSystemAtEntity("", "ps_dust_ghost.ps", "ScriptArea_4", false);
PlaySoundAtEntity("", "general_wind_whirl.snt", "ScriptArea_4", 0.5f, false);
SetLampLit("altar_lamp_1", false, true);
}

else if (x == "T16")
{
SetLampLit("altar_lamp_1", false, true);
}

else if (x == "T17")
{
FadeOut(2.0f);
StopPlayerLookAt();
AddTimer("T18", 2.5f, "IntroText2");
AddTimer("T19", 3.5f, "IntroText2");
AddTimer("T20", 8.5f, "IntroText2");
}
}

void IntroText2(string &in asTimer)
{

string x = asTimer;
if (x == "T18")
{
TeleportPlayer("PlayerStartArea_1");
}

else if (x == "T19")
{
FadeIn(3.0f);
}

else if (x == "T20")
{
SetMessage("Messages", "IntroText2", 5.0f);
FadeOut(6.0f);
AddTimer("T21", 7.0f, "IntroEvent3");
AddTimer("T22", 7.5f, "IntroEvent3");
AddTimer("T23", 10.0f, "IntroEvent3");
AddTimer("T24", 12.5f, "IntroEvent3");
AddTimer("T25", 16.0f, "IntroEvent3");
AddTimer("T26", 19.0f, "IntroEvent3");
}
}

void IntroEvent3(string &in asTimer)
{

string x = asTimer;
if (x == "T21")
{
TeleportPlayer("PlayerStartArea_4");
StartPlayerLookAt("ScriptArea_5", 0.1f, 5.0f, "");
}

else if (x == "T22")
{
FadeIn(3.0f);
}

else if (x == "T23")
{
SetMessage("Messages", "Intro4", 0.0f);
}

else if (x == "T24")
{
SetLightFlickerActive("SpotLight_1", true);
}

else if (x == "T25")
{
SetLightFlickerActive("SpotLight_1", true);
SetLightVisible("SpotLight_1", false);
PlaySoundAtEntity("", "29_elec_burst02.snt", "ScriptArea_6", 0.0f, false);
PlaySoundAtEntity("", "break_glass_bottle.snt", "ScriptArea_6", 0.0f, false);
}

else if (x == "T26")
{
FadeOut(3.0f);
StopPlayerLookAt();
AddTimer("T27", 3.5f, "IntroText3");
AddTimer("T28", 4.5f, "IntroText3");
AddTimer("T29", 8.5f, "IntroText3");
AddTimer("T30", 11.5f, "IntroText3");
}
}

void IntroText3(string &in asTimer)
{

string x = asTimer;
if (x == "T27")
{
TeleportPlayer("PlayerStartArea_1);
}

else if (x == "T28")
{
FadeIn(3.0f);
}

else if (x == "T29")
{
SetMessage("Messages", "IntroText3", 2.5f);
FadeOut(6.0f);
}

else if (x == "T30")
{
SetMessage("Messages", "IntroText4", 2.5f);
AddTimer("T31", 7.0f, "IntroEvent4");
AddTimer("T32", 7.5f, "IntroEvent4");
AddTimer("T33", 12.0f, "IntroEvent4");
AddTimer("T34", 14.5f, "IntroEvent4");
}
}

void IntroEvent4(string &in asTimer)
{

string x = asTimer;
if (x == "T31")
{
TeleportPlayer("PlayerStartArea_5");
StartPlayerLookAt("ScriptArea_7", 0.05f, 5.0f, "");
}

else if (x == "T32")
{
FadeIn(3.0f);
}

else if (x == "T33")
{
SetMessage("Messages", "Intro5", 0.0f);
}

else if (x == "T34")
{
StartPlayerLookAt("ScriptArea_8", 0.08f, 5.0f, "");
}
}
01-04-2013, 05:23 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#2
RE: Help

When a "Unexpect End of File" happens, it means you have a missing ", (, ), somewhere. Go to notepad++ and put the language to C+. It will help you find the issue.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
01-04-2013, 07:28 PM
Find
darksky Offline
Member

Posts: 52
Threads: 8
Joined: Nov 2012
Reputation: 2
#3
RE: Help

forgot a "

void IntroText3(string &in asTimer)
{

string x = asTimer;
if (x == "T27")
{
TeleportPlayer("PlayerStartArea_1);
}
(This post was last modified: 01-04-2013, 07:30 PM by darksky.)
01-04-2013, 07:30 PM
Find




Users browsing this thread: 2 Guest(s)