In the latest beta of my ScrollingDialog module, I note that there is an error which will cause the game to crash if you have a lot of dialog options (specifically with one or more long options). The line that was crashing the module was:
Code: ags
The error being this:
The solution was simply not to use String.Format to build up the String. Using this instead fixed the problem:
Code: ags
I know for a fact all the variables were valid, and it wasn't a normal "this is probably a scripting problem" error.
Just for reference, the exact text I was using:
Code: ags
Use that with the 2.0 Beta 1 and the game will crash. Commenting out the very last option serves as a partial fix, though not a very good one. And just a heads up, I realize there are two option 9s in the above example code, but that was actually a test of the module's "feature" by which if you try to add a new option in a non-sequential order it will automagically go to the first unused option (i.e., there's no option 8 so even though I put 9 it will be stored in option 8 ).
[EDIT:]
FRICKING SMILEY!
this.__buffers[topicID] = String.Format("%s%d%s", this.__buffers[topicID].Substring(0, i), (state != false), this.__buffers[topicID].Substring(e, this.__buffers[topicID].Length));
The error being this:
Quote---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x6974704F ; program pointer is -42, ACI version 2.72.920, gtags (2039,18)
AGS cannot continue, this exception was fatal. Please note down the numbers above, remember what you were doing at the time and notify CJ on the Tech forum.
in ScrollingDialog (line 363)
from ScrollingDialog (line 429)
from Global script (line 14)
Most versions of Windows allow you to press Ctrl+C now to copy this entire message to the clipboard for easy reporting.
---------------------------
OK
---------------------------
The solution was simply not to use String.Format to build up the String. Using this instead fixed the problem:
String __str = this.__buffers[topicID].Substring(0, i);
__str = __str.Append(String.Format("%d", (state != false)));
__str = __str.Append(this.__buffers[topicID].Substring(e, this.__buffers[topicID].Length));
this.__buffers[topicID] = __str;
I know for a fact all the variables were valid, and it wasn't a normal "this is probably a scripting problem" error.
Just for reference, the exact text I was using:
// game start
ScrollingDialog.SetText("new topic", 0, "this is some text");
ScrollingDialog.SetText("new topic", 1, "this is some really longish text that I'm typing in here;;;;;;lolol look at those semi-colons aren't they great? XD hahahha jajja 111 lolz0rz I are the pwnt!");
ScrollingDialog.SetText("new topic", 2, "this is some other text");
ScrollingDialog.SetText("new topic", 3, "here's some more generic text");
ScrollingDialog.SetText("new topic", 4, "a few more should do");
ScrollingDialog.SetText("new topic", 5, "'cept I'm lazy, so this is it...");
ScrollingDialog.SetText("new topic", 6, "d'oh! it wasn't enough");
ScrollingDialog.SetText("new topic", 7, "this should help");
ScrollingDialog.SetText("new topic", 9, "omfg");
ScrollingDialog.SetText("new topic", 9, "omfg(2)");
Use that with the 2.0 Beta 1 and the game will crash. Commenting out the very last option serves as a partial fix, though not a very good one. And just a heads up, I realize there are two option 9s in the above example code, but that was actually a test of the module's "feature" by which if you try to add a new option in a non-sequential order it will automagically go to the first unused option (i.e., there's no option 8 so even though I put 9 it will be stored in option 8 ).
[EDIT:]
FRICKING SMILEY!
