Frictional Games Forum (read-only)

Full Version: [Script Error Help] Crash because of a "}"?!?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Ok, everything is working neatly. Just got some inspiration back. And haven't had any problems in a while.

Then suddenly, my previous working script for the map crashes when I load the map!
But there is no valid reason for it. It says the error expected thing, with the "27, 1".

That means it's on line 27 of the script right?
Problem is the only thing there is a "}" to close a void.

Lines 17 - 27
Quote:void HiddenAreaEntered(string &in asParent, string &in asChild, int alState)
{
StopMusic(1, 0);
PlayMusic("SoundFire12.ogg", false, 8, 1, 0, true);
SetLampLit("torch_1", true, true);
SetLampLit("torch_2", true, true);
PlaySoundAtEntity("ui_sanity_gain", "ui_sanity_gain.snt", "Player", 0, false);
GiveSanityBoostSmall();
StartPlayerLookAt("AreaLookEvent", 5, 20, "");
AddTimer("", 1, "LookEventStop")
}

I tried removing it. But then the error message just jumped to saying it's on line 74. Which is the last line of the script. Also containing a "}" from the end of the void onLeave thing.

Any idea why the error is upset with my previous working and normal }'s ?
It's very annoying, I even tried deleting the .hps file and making it new. But still crashes with the error.
On the last line, shouldn't it have a ;
like this: AddTimer("", 1, "LookEventStop");
And give everything a Space bar So the error shows what you did wrong
Thank you, silly me didn't realise I forgot the ";" x)
It works again now, I think I had same problem before that the level editor mentiones the "}" instead of the line above which actually is the error. So now I've given them spaces.

Thanks again and sorry for consuming time with a minor memory slip^^!
FYI, the line isn't always the the correct line. It means there is a error in the function that is closet to the line indicated in the error c: