I just cut-and-pasted some code in a script module, and as soon as I had done it an error box came up containing a message telling me to post the following here:
Error: StartIndex cannot be less than zero.
Parameter name: startIndex
Version: AGS 3.1.0.60
System.ArgumentOutOfRangeException: StartIndex cannot be less than zero.
Parameter name: startIndex
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at AGS.Editor.ScintillaWrapper.CheckFunctionForLocalVariables(Int32 currentPos, ScriptFunction func, String scriptExtract)
at AGS.Editor.ScintillaWrapper.GetListOfLocalVariablesForCurrentPosition(Int32 currentPos)
at AGS.Editor.ScintillaWrapper.FindLocalVariableWithName(Int32 startAtPos, String nameToFind)
at AGS.Editor.ScintillaWrapper.GetFinalPartOfExpression(Int32 currentPos, ScriptStruct& memberOfStruct, Boolean functionsOnly)
at AGS.Editor.ScintillaWrapper.ShowCalltip(Int32 openingBracketPos, Int32 parameterIndex, Boolean functionsOnly)
at AGS.Editor.ScintillaWrapper.scintillaControl1_DwellStart(Object sender, DwellStartEventArgs e)
at Scintilla.ScintillaControl.DispatchScintillaEvent(SCNotification notification)
at Scintilla.ScintillaControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
If it helps, I might have had the game debugging at the time, but I wasn't really paying attention.
It didn't appear to doing anything other than display the exception message.
You should really know what you're doing before c&p-ing code from a module.
Please post the code you used.
My guess is that String.Substring(int index, int length) gets called with a starting index less than zero.
This is a bug in the AGS Editor that was fixed in 3.1.2. If you want to avoid it happening again, upgrade to AGS 3.1.2 SP1 which you can download from the website.
Sure.
I downloaded it before, but my cruddy dial-up ruined it.
I haven't got around to downloading it again.