Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: metalmario991 on Thu 22/01/2015 23:59:36

Title: Unexpected eof
Post by: metalmario991 on Thu 22/01/2015 23:59:36
// room script file

function hManor_Interact()
{
cEgo.Say("I can't do that!");
}

function hManor_Look()
{
cEgo.Say("It's the old Dia Manor!");
}

function hManor_PickUp()
{
cEgo.Say("I can't pick that up!";
}


I entered this for my room script and got an error saying unexpected eof. What does that mean and what did I script incorrectly?
Title: Re: Unexpected eof
Post by: Matti on Fri 23/01/2015 00:23:00
You forgot a bracket:

cEgo.Say("I can't pick that up!");
Title: Re: Unexpected eof
Post by: metalmario991 on Fri 23/01/2015 00:27:22
Thank you.
Title: Re: Unexpected eof
Post by: Cassiebsg on Fri 23/01/2015 13:01:56
Quote from: metalmario991 on Thu 22/01/2015 23:59:36
and got an error saying unexpected eof. What does that mean and what did I script incorrectly?

eof = end of function (I'm guessing).

Just so you know what it means, since you did ask and you probably will see this error many many times in the future. ;)
With time you'll learn all those error msg, and know what to look for when you see them.
Title: Re: Unexpected eof
Post by: monkey0506 on Fri 23/01/2015 15:33:07
I believe it is actually just referring to end of file. With a missing closing parenthesis like that, the parser is consuming the rest of the script file looking for another parenthesis. It might be possible to catch this earlier on (e.g., if it encounters a closing curly brace before it finds the matching parenthesis). I'm not sure if there's already an issue in the tracker for that or not, but there probably should be.