Difference between revisions of "AGIWiki/Script buffer overflow error"
(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 |
||
(One intermediate revision by the same user not shown) | |||
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/ | 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. |
Latest revision as of 14:59, 23 February 2013
A script buffer overflow error occurs when the script buffer has run out of room. The error message looks like the following:
"Script buffer overflow. Maximum size = v18 Press ESC to quit.", where "v18" is replaced with the value of v18 (see 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 script.size command at the beginning of logic 0 before doing anything that might add to the script buffer (the script.size
command clears the script buffer, so bad things can happen if it isn't empty when script.size
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 Memory and Script article can help you do this.