[SOLVED] Index was outside the bounds of the array.

Started by Icey, Sat 02/01/2016 19:13:50

Previous topic - Next topic

Icey

need some big help, I have no idea what just happened and I can't open my game. All I know is while I was working in the scripts I was trying to find this open function error that I just can't seem to spot and then after a few tries I got this error and I closed the game so nothing would happen and now i can't open it and I haven't got the chance to make a back off all my recent work and I really can't lose this game now. Is there any way to fix this or am I doomed to restart from an old back up?
Quote---------------------------
Adventure Game Studio
---------------------------
An error occurred whilst trying to load your game. The error was:



Index was outside the bounds of the array.



If you cannot resolve the error, please post on the AGS Technical Forum for assistance.



Error details: System.IndexOutOfRangeException: Index was outside the bounds of the array.

   at AGS.CScript.Compiler.FastString.get_Item(Int32 index)

   at AGS.Editor.AutoComplete.IncrementIndexToSkipAnyComments(FastString script, Int32& index)

   at AGS.Editor.AutoComplete.SkipUntilMatchingClosingBrace(FastString& script)

   at AGS.Editor.AutoComplete.ConstructCache(Script scriptToCache, Boolean isBackgroundThread)

   at AGS.Editor.AGSEditor.RefreshEditorAfterGameLoad(Game newGame)

   at AGS.Editor.Tasks.LoadGameFromDisk(String gameToLoad, Boolean interactive)

   at AGS.Editor.InteractiveTasks.LoadGameFromDisk(String gameToLoad)
---------------------------
OK   
---------------------------

Crimson Wizard

Hmm, I have this idea: if you remember what script gave you errors, find that script in your project folder, copy its contents to some backup text file, and erase contents completely inside the script file. Then try to load game again.

Please do not delete the script backup no matter what happens, we might use it to find the reason of this crash.

Icey

#2
I can't seem to find the script, maybe I keep looking over it but it was a new script that I had made in the scripts section. I think it might have deleted itself from the game which could be the error. But I do have the contents of that script backed up before i closed the game.

EDIT
I think AGS did delete the script because it's no where to be found and when I open up a previous back up and make a script I can see the "new script" in the project folder

EDIT 2...
Nvm, I was working in the header of the global script


EDIT 3
Ok so that seem to work but I did get some fatal error pop up after putting the code back into the script and trying to play. I don't know why but it only happened once and I'm not gonna bug because this just the back up of the one with the  original problem.

But even thought that seems to all have stopped I still get this script error and I can't find the open brackets and I think after fixing those I should be straight with the problem cause it's never happened until I tried to fix this script error.

EDIT 4
Solved the problem, thanks for the help, Crimson.

Crimson Wizard

Can you send me the copy of the script that caused you trouble? I might need to look into resolving this crash, because Editor should not crash like this because of script error.

SMF spam blocked by CleanTalk