Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: alphadalekben on Sat 02/05/2015 15:36:46

Title: Slight problem calling a dialogue in a function.
Post by: alphadalekben on Sat 02/05/2015 15:36:46
Shoot me for being thick, but I have a very minor (I'll admit as much) problem with a function. The 'faulty' code is the following;

Code (ags) Select

function CarbonsOffice_OnClick(GUIControl *control, MouseButton button)
{
  dCarbonOffice.Start;
}


The error is the following:
GlobalScript.asc(887): Error (line 887): '(' expected

I am aware that this is a minor issue, but it's such a minor issue that I can't see what on earth the problem could be.

Sorry to be a pain,
alphadalekben
Title: Re: Slight problem calling a dialogue in a function.
Post by: ChamberOfFear on Sat 02/05/2015 17:00:05
The error message says that you are missing parenthesis so that narrows it down quite a bit. You're trying to call the function "Start()" without parenthesis, all functions must have this.

Code (ags) Select

function CarbonsOffice_OnClick(GUIControl *control, MouseButton button)
{
  dCarbonOffice.Start(); // See the difference here
}
Title: Re: Slight problem calling a dialogue in a function.
Post by: alphadalekben on Sat 02/05/2015 17:08:11
Oooooooh, I see now. Thanks for that. I knew it would be something simple like that. My bad. Sorry about that.