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 of file problem
Togglevolt Offline
Junior Member

Posts: 10
Threads: 2
Joined: Nov 2011
Reputation: 0
#1
Unexpected end of file problem

For some reason my game crashes when I use this script and I don't know what's wrong with it.
It say Unexpeted end of file, but if I keep the whole method empty it say nothing but none of my other scripts works.

Please help!



void KitchenScare(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("SoundPiano", "general_piano02.snt", "piano_1", 1.0f, false);

SetEntityActive("rag_plague_corpse_1", true);
SetEntityActive("rag_plague_corpse_2", true);
SetEntityActive("rag_plague_corpse_3", true);
SetEntityActive("rag_plague_corpse_4", true);
SetEntityActive("rag_plague_corpse_5", true);
SetEntityActive("rag_plague_corpse_6", true);
SetEntityActive("rag_plague_corpse_7", true);
SetEntityActive("rag_plague_corpse_8", true);
SetEntityActive("rag_plague_corpse_9", true);
SetEntityActive("rag_plague_corpse_10", true);
SetEntityActive("rag_plague_corpse_11", true);
SetEntityActive("rag_plague_corpse_12", true);
SetEntityActive("rag_plague_corpse_13", true);
SetEntityActive("rag_plague_corpse_14", true);
SetEntityActive("rag_plague_corpse_15", true);
SetEntityActive("rag_plague_corpse_16", true);
SetEntityActive("rag_plague_corpse_17", true);
SetEntityActive("rag_plague_corpse_18", true);
SetEntityActive("rag_plague_corpse_19", true);
SetEntityActive("rag_plague_corpse_20", true);
SetEntityActive("rag_plague_corpse_21", true);
SetEntityActive("rag_plague_corpse_22", true);
SetEntityActive("rag_plague_corpse_23", true);
SetEntityActive("rag_plague_corpse_24", true);
SetEntityActive("rag_plague_corpse_25, true);
SetEntityActive("rag_plague_corpse_26", true);
SetEntityActive("rag_plague_corpse_27", true);
SetEntityActive("rag_plague_corpse_28", true);

SetEntityActive("rat_corpse_pile_1", true);
SetEntityActive("rat_corpse_pile_2", true);
SetEntityActive("rat_corpse_pile_3", true);
SetEntityActive("rat_corpse_pile_4", true);

SetLampLit("chandelier_simple_short_3", true, false);
SetLampLit("chandelier_simple_short_1", true, false);
SetLampLit("candlestick_tri_1", true, false);
SetLampLit("candlestick_tri_2", true, false);
SetLampLit("candlestick_tri_3", true, false);
SetLampLit("candlestick_tri_4", true, false);
SetLampLit("candlestick_tri_5", true, false);
SetLampLit("candlestick_tri_6", true, false);
SetLampLit("torch_static01_8", true, false);
SetLampLit("torch_static01_10", true, false);
SetLampLit("torch_static01_11", true, false);
SetLampLit("torch_static01_12", true, false);
}


void OnEnter()
{
AddEntityCollideCallback("Player", "ScriptArea_4", "KitchenScare", true, 1);
}
11-18-2011, 03:34 PM
Find
Darion97 Offline
Junior Member

Posts: 29
Threads: 1
Joined: Jun 2011
Reputation: 1
#2
RE: Unexpected end of file problem

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_4", "KitchenScare", true, 1);
}

void KitchenScare(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("SoundPiano", "general_piano02.snt", "piano_1", 1.0f, false);
SetEntityActive("rag_plague_corpse_1", true);
SetEntityActive("rag_plague_corpse_2", true);
SetEntityActive("rag_plague_corpse_3", true);
SetEntityActive("rag_plague_corpse_4", true);
SetEntityActive("rag_plague_corpse_5", true);
SetEntityActive("rag_plague_corpse_6", true);
SetEntityActive("rag_plague_corpse_7", true);
SetEntityActive("rag_plague_corpse_8", true);
SetEntityActive("rag_plague_corpse_9", true);
SetEntityActive("rag_plague_corpse_10", true);
SetEntityActive("rag_plague_corpse_11", true);
SetEntityActive("rag_plague_corpse_12", true);
SetEntityActive("rag_plague_corpse_13", true);
SetEntityActive("rag_plague_corpse_14", true);
SetEntityActive("rag_plague_corpse_15", true);
SetEntityActive("rag_plague_corpse_16", true);
SetEntityActive("rag_plague_corpse_17", true);
SetEntityActive("rag_plague_corpse_18", true);
SetEntityActive("rag_plague_corpse_19", true);
SetEntityActive("rag_plague_corpse_20", true);
SetEntityActive("rag_plague_corpse_21", true);
SetEntityActive("rag_plague_corpse_22", true);
SetEntityActive("rag_plague_corpse_23", true);
SetEntityActive("rag_plague_corpse_24", true);
SetEntityActive("rag_plague_corpse_25", true);
SetEntityActive("rag_plague_corpse_26", true);
SetEntityActive("rag_plague_corpse_27", true);
SetEntityActive("rag_plague_corpse_28", true);
SetEntityActive("rat_corpse_pile_1", true);
SetEntityActive("rat_corpse_pile_2", true);
SetEntityActive("rat_corpse_pile_3", true);
SetEntityActive("rat_corpse_pile_4", true);
SetLampLit("chandelier_simple_short_3", true, false);
SetLampLit("chandelier_simple_short_1", true, false);
SetLampLit("candlestick_tri_1", true, false);
SetLampLit("candlestick_tri_2", true, false);
SetLampLit("candlestick_tri_3", true, false);
SetLampLit("candlestick_tri_4", true, false);
SetLampLit("candlestick_tri_5", true, false);
SetLampLit("candlestick_tri_6", true, false);
SetLampLit("torch_static01_8", true, false);
SetLampLit("torch_static01_10", true, false);
SetLampLit("torch_static01_11", true, false);
SetLampLit("torch_static01_12", true, false);
}
(This post was last modified: 11-18-2011, 07:53 PM by Darion97.)
11-18-2011, 03:56 PM
Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#3
RE: Unexpected end of file problem

At least you have a lot of corpsesBig Grin

When Life No Longer Exists
Full-conversion mod
11-18-2011, 04:07 PM
Website Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#4
RE: Unexpected end of file problem

BTW, SetEntityActive supports the asterisk wildcard:

SetEntityActive("rag_plague_corpse_*", true);

Tutorials: From Noob to Pro
(This post was last modified: 11-18-2011, 06:51 PM by Your Computer.)
11-18-2011, 06:50 PM
Website Find
Togglevolt Offline
Junior Member

Posts: 10
Threads: 2
Joined: Nov 2011
Reputation: 0
#5
RE: Unexpected end of file problem

Okey Smile haha. Thx for the tip. But does any of you know why it doesn't work? I don't quite understand that "/
(This post was last modified: 11-18-2011, 08:35 PM by Togglevolt.)
11-18-2011, 08:32 PM
Find
Your Computer Offline
SCAN ME!

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

(11-18-2011, 08:32 PM)Togglevolt Wrote: Okey Smile haha. Thx for the tip. But does any of you know why it doesn't work? I don't quite understand that

Your script made the compiler return an error because you missed a quotation mark for rag_plague_corpse_25.

Tutorials: From Noob to Pro
11-18-2011, 09:28 PM
Website Find
Togglevolt Offline
Junior Member

Posts: 10
Threads: 2
Joined: Nov 2011
Reputation: 0
#7
RE: Unexpected end of file problem

Oh.....I knew it had to be something like that. But I've checked the script several times and didn't see it :O gonna try it now then
Yes it works now. Thanks for having better eyes than me! Wink
(This post was last modified: 11-18-2011, 09:51 PM by Togglevolt.)
11-18-2011, 09:45 PM
Find
ferryadams10 Offline
Senior Member

Posts: 288
Threads: 40
Joined: Apr 2011
Reputation: 19
#8
RE: Unexpected end of file problem

Listen, mostly when u get an error like that it's great to have notepad++ in which you can check the line numbers.

And it mostly says what the prob is for example: SetEntityActive("rag_plague_corpse_25, true);
will say just random line number.

Unexpected line ending (line 125, 1) Expected (")

So then you go in Notepad++ to line 125 and check if you forgot to place a (")

Cause the error says to expect a " but there is none and if it says like unexpected (Wink which will be in a case like this: void KitchenScare(string &in asParent, string &in asChild, int alState);

then remove the (Wink cause a void never has a (Wink

Hope this helps you fixing your problem if you don't have notepad++ yet go to this site and get it:

http://notepad-plus-plus.org/download/v5.9.6.2.html

For extra_english.lang files you go to the upper tabs, click on language/XML

For .hps files you go to laguage/C/C++

Bye Bye and please gimme reputation Tongue


Got a nice sofa
Please come and have a seat for a while

11-18-2011, 10:16 PM
Find
Togglevolt Offline
Junior Member

Posts: 10
Threads: 2
Joined: Nov 2011
Reputation: 0
#9
RE: Unexpected end of file problem

I already have notepad++ Smile but thanks anyway. And the reason I couldn't find the problem was because it said like "line (180,2)", and that token was just a }. But it's fixed now anyways Smile
11-19-2011, 02:02 AM
Find




Users browsing this thread: 1 Guest(s)