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 Error Help] Crash because of a "}"?!?
Rokotain Offline
Member

Posts: 54
Threads: 9
Joined: Jul 2011
Reputation: 0
#1
[Script Error Help] Crash because of a "}"?!?

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.
(This post was last modified: 02-01-2012, 12:32 AM by Rokotain.)
01-31-2012, 07:51 PM
Find
FinBanana Offline
Junior Member

Posts: 29
Threads: 4
Joined: Jan 2012
Reputation: 0
#2
RE: [Script Error Help] Crash because of a "}"?!?

On the last line, shouldn't it have a ;
like this: AddTimer("", 1, "LookEventStop");
01-31-2012, 08:09 PM
Find
UnseenLegend ( NL ) Offline
Member

Posts: 171
Threads: 10
Joined: Sep 2011
Reputation: 12
#3
RE: [Script Error Help] Crash because of a "}"?!?

And give everything a Space bar So the error shows what you did wrong

[Image: read-image.asp?n=n-20121202110321-m.jpg&r=8]
01-31-2012, 08:16 PM
Find
Rokotain Offline
Member

Posts: 54
Threads: 9
Joined: Jul 2011
Reputation: 0
#4
RE: [Script Error Help] Crash because of a "}"?!?

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^^!
01-31-2012, 09:20 PM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#5
RE: [Script Error Help] Crash because of a "}"?!?

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:

02-01-2012, 03:42 AM
Find




Users browsing this thread: 2 Guest(s)