Frictional Games Forum (read-only)
Scripting Error: Unexpected End In Script Please Help! - 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: Scripting Error: Unexpected End In Script Please Help! (/thread-20426.html)

Pages: 1 2


Scripting Error: Unexpected End In Script Please Help! - JohnandSerena - 02-21-2013

I have an unexpected end on 35,2 it says and idk what is wrong but can someone please help. Heres my script:

///////////////////////////
// Run when entering map
void OnStart()
{
wakeUp();
}
void wakeUp ()
{
FadeOut(0);
FadeIn(20);
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220);
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true);
AddTimer("trig1", 11.0f, "beginStory");

void beginStory(string &in asTimer)
{
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33);
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{
}


RE: Scripting Error: Unexpected End In Script Please Help! - PutraenusAlivius - 02-21-2013

Please give us your full script. The script that you posted only has 34 lines.


RE: Scripting Error: Unexpected End In Script Please Help! - JohnandSerena - 02-21-2013

(02-21-2013, 12:20 PM)JustAnotherPlayer Wrote: Please give us your full script. The script that you posted only has 34 lines.

My bad it says Unexpected end in script: 34,2


RE: Scripting Error: Unexpected End In Script Please Help! - PutraenusAlivius - 02-21-2013

(02-21-2013, 12:26 PM)JohnandSerena Wrote:
(02-21-2013, 12:20 PM)JustAnotherPlayer Wrote: Please give us your full script. The script that you posted only has 34 lines.

My bad it says Unexpected end in script: 34,2
At
PHP Code:
////////////////////////////
// Run when leaving map
void OnLeave()
{

There's an space at the last curly bracket (}). Remove it.
--
EDIT:
STOP READING AND EDIT IT!
Meanwhile, here's my script.
PHP Code:
void OnStart()
{
wakeUp();
}
void wakeUp ()
{
FadeOut(0);
FadeIn(20);
FadeImageTrailTo(22);
FadeSepiaColorTo(1004);
SetPlayerActive(false);
FadePlayerRollTo(50220220);
FadeRadialBlurTo(0.152);
SetPlayerCrouching(true);
AddTimer("trig1"11.0f"beginStory");
}
void beginStory(string &in asTimer)
{
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(03333);
FadeRadialBlurTo(0.01);
FadeSepiaColorTo(04);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
}

void OnLeave()
{




RE: Scripting Error: Unexpected End In Script Please Help! - JohnandSerena - 02-21-2013

(02-21-2013, 12:30 PM)JustAnotherPlayer Wrote:
(02-21-2013, 12:26 PM)JohnandSerena Wrote:
(02-21-2013, 12:20 PM)JustAnotherPlayer Wrote: Please give us your full script. The script that you posted only has 34 lines.

My bad it says Unexpected end in script: 34,2
At
PHP Code:
////////////////////////////
// Run when leaving map
void OnLeave()
{

There's an space at the last curly bracket (}). Remove it.
--
EDIT:
STOP READING AND EDIT IT!
Meanwhile, here's my script.
PHP Code:
void OnStart()
{
wakeUp();
}
void wakeUp ()
{
FadeOut(0);
FadeIn(20);
FadeImageTrailTo(22);
FadeSepiaColorTo(1004);
SetPlayerActive(false);
FadePlayerRollTo(50220220);
FadeRadialBlurTo(0.152);
SetPlayerCrouching(true);
AddTimer("trig1"11.0f"beginStory");

void beginStory(string &in asTimer)
{
ChaePlyerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(03333);
FadeRadialBlurTo(0.01);
FadeSepiaColorTo(04);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
}

void OnLeave()
{


Thanks ill try that when i get to my laptop again!

(02-21-2013, 12:30 PM)JustAnotherPlayer Wrote:
(02-21-2013, 12:26 PM)JohnandSerena Wrote:
(02-21-2013, 12:20 PM)JustAnotherPlayer Wrote: Please give us your full script. The script that you posted only has 34 lines.

My bad it says Unexpected end in script: 34,2
At
PHP Code:
////////////////////////////
// Run when leaving map
void OnLeave()
{

There's an space at the last curly bracket (}). Remove it.
--
EDIT:
STOP READING AND EDIT IT!
Meanwhile, here's my script.
PHP Code:
void OnStart()
{
wakeUp();
}
void wakeUp ()
{
FadeOut(0);
FadeIn(20);
FadeImageTrailTo(22);
FadeSepiaColorTo(1004);
SetPlayerActive(false);
FadePlayerRollTo(50220220);
FadeRadialBlurTo(0.152);
SetPlayerCrouching(true);
AddTimer("trig1"11.0f"beginStory");

void beginStory(string &in asTimer)
{
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(03333);
FadeRadialBlurTo(0.01);
FadeSepiaColorTo(04);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
}

void OnLeave()
{




RE: Scripting Error: Unexpected End In Script Please Help! - Adrianis - 02-21-2013

.... spaces at the end of the curly brace does not matter, you can pretty much stick extra white space wherever you like.

You are missing the closing brace '}' at the end of the 'wakeup' function


RE: Scripting Error: Unexpected End In Script Please Help! - PutraenusAlivius - 02-21-2013

(02-21-2013, 01:28 PM)Adrianis Wrote: .... spaces at the end of the curly brace does not matter, you can pretty much stick extra white space wherever you like.

You are missing the closing brace '}' at the end of the 'wakeup' function
If i'm correct, the error was supposed to be at Line 18, as there are no closing brace. So, the problem was two! Da Fuq?!


RE: Scripting Error: Unexpected End In Script Please Help! - Adrianis - 02-21-2013

Because the error is 'Unexpected End of file', is does not properly capture on which line the actual problem is, it just captures the line at which the script ends. Makes it a little harder to find, but the problem is almost always going to be a missing brace somewhere.

Quote: So, the problem was two!
Not really sure what you mean by that, sorry. There only seems to be one problem with that script


RE: Scripting Error: Unexpected End In Script Please Help! - PutraenusAlivius - 02-21-2013

(02-21-2013, 02:22 PM)Adrianis Wrote: Because the error is 'Unexpected End of file', is does not properly capture on which line the actual problem is, it just captures the line at which the script ends. Makes it a little harder to find, but the problem is almost always going to be a missing brace somewhere.

Quote: So, the problem was two!
Not really sure what you mean by that, sorry. There only seems to be one problem with that script
First one, missing brace
Second one, Unexpected END of file.
This could mean when the second one is finished, the first one will show up. LOL your number of posts. 314. Also known as Pi (Pi is 3.14159265359 or 3.14 x 100 = 314)


RE: Scripting Error: Unexpected End In Script Please Help! - Adrianis - 02-21-2013

The end of the file was unexpected, because it was expecting to find a closing brace somewhere, but it never did. The file ends, and the engine says 'WTF WHERES THE BRACE AT?!', because it did not expect it.

*will anthropomorphise game engines for ££