Scripting Problem - Nested Functions (SOLVED)

Started by , Sun 14/01/2007 05:31:41

Previous topic - Next topic

underscores8

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


underscores8

I've fixed this problem... I realised the missing bracket had nothing to with btnDeleteSave. Instead, there was one missing from btnConfirmSave.

Gilbert

By the way, the "match braces" feature of the script editor is very handy, you may try it.

SMF spam blocked by CleanTalk