Difference between revisions of "AGIWiki/Script buffer overflow error"

Jump to navigation Jump to search
m
no edit summary
(Created page with "{{AGIWiki}} A '''script buffer overflow error''' occurs when the script buffer has run out of room. The error message looks like the following: ''"Scr...")
 
m
Line 5: Line 5:
''"Script buffer overflow. Maximum size = v18 Press ESC to quit."'', where "v18" is replaced with the value of <var>v18</var> (see [[AGIWiki/Special variables|special variables]]).
''"Script buffer overflow. Maximum size = v18 Press ESC to quit."'', where "v18" is replaced with the value of <var>v18</var> (see [[AGIWiki/Special variables|special variables]]).


Fortunately, there are ways to deal with a script buffer overflow. The simplest solution is to increase the script buffer size by issuing the [[AGIWiki/script.size|script.size]] command at the beginning of [[AGIWiki/logic 0|logic 0]] before doing '''anything''' that might add to the script buffer (the <code>script.size</code> command clears the script buffer, so bad things can happen if it isn't empty when <code>script.size</code> is called).
Fortunately, there are ways to deal with a script buffer overflow. The simplest solution is to increase the script buffer size by issuing the [[AGIWiki/script.size|script.size]] command at the beginning of [[AGIWiki/logic 0|logic 0]] ''before doing '''anything''' that might add to the script buffer'' (the <code>script.size</code> command clears the script buffer, so bad things can happen if it isn't empty when <code>script.size</code> is called).


Simply increasing the script buffer size may not stop the error, though. If the problem is that your code is repeatedly loading and discarding resources or overlaying pictures, increasing the script buffer size may simply make it take longer for the overflow to occur. In this case, a better approach is to figure out why the script buffer overflow is occurring in the first place. The [[AGIWiki/Memory and Script|Memory and Script]] article can help you do this.
Simply increasing the script buffer size may not stop the error, though. If the problem is that your code is repeatedly loading and discarding resources or overlaying pictures, increasing the script buffer size may simply make it take longer for the overflow to occur. In this case, a better approach is to figure out why the script buffer overflow is occurring in the first place. The [[AGIWiki/Memory and Script|Memory and Script]] article can help you do this.
885

edits

Navigation menu