Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: on Sun 14/01/2007 05:31:41

Title: Scripting Problem - Nested Functions (SOLVED)
Post by: on Sun 14/01/2007 05:31:41
I'm very new to scripting, and I'm sorry if this is supposed to be in the beginner's forum.

I've created my own save/load game GUIs. When the delete button is clicked, I want a message box to come up asking if the player is sure he wants to delete the saved game. The message box GUI is YESNO (gYesno)
and the delete button is btnDeleteSave.
Here's the script I want to use:

(lines 225-227)

function btnDeleteSave_Click(GUIControl *control, MouseButton button) {
gYesno.Visible = true;
}

Here's the error message I'm getting:

---------------------------
Compile Error
---------------------------
There was an error compiling your script. The problem was:

In: 'Global script'



Error (line 225): Nested functions not supported (you may have forgotten a closing brace)



Do you want to fix the script now? (Your game has not been saved).
---------------------------
Yes   No   
---------------------------

Does anybody know how to fix this script?

Thanks,
Cody

Title: Re: Scripting Problem - Nested Functions
Post by: on Sun 14/01/2007 06:24:48
I've fixed this problem... I realised the missing bracket had nothing to with btnDeleteSave. Instead, there was one missing from btnConfirmSave.
Title: Re: Scripting Problem - Nested Functions (SOLVED)
Post by: Gilbert on Sun 14/01/2007 10:13:12
By the way, the "match braces" feature of the script editor is very handy, you may try it.