View previous topic :: View next topic |
Author |
Message |
StellarXtoolazytologin Guest
|
Posted: Thu Jan 20, 2005 8:17 am Post subject: Script buffer overflow |
|
|
I am receiving this error when playing the script in my game
"Script Error!
Script buffer overflow"
"failed to load indirect script 32726"
"Script Error! Illegal statement type 100"
I will post the script if needed, but I just wanted to know if this is just a standard error when a script is too large or something. |
|
Back to top |
|
 |
Uncommon His legend will never die

Joined: 10 Mar 2003 Posts: 2503
|
Posted: Thu Jan 20, 2005 10:43 am Post subject: |
|
|
wow man you are seriously out of it
Yeah, it's a pretty standard error. It's prolly the most common script error you'll run into. It'll usually run because your script is too big or you have too many scripts loaded at once. If you enable the debugging keys and press F10 while running the game, it'll tell you how many scripts are running and how high the buffer's getting. |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Thu Jan 20, 2005 11:15 am Post subject: |
|
|
But, hey, it's friggin Stellarks. How's it going? _________________
|
|
Back to top |
|
 |
StellarX Cosmically Oblivious

Joined: 09 Jan 2004 Posts: 14 Location: Dublin, GA
|
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Thu Jan 20, 2005 11:49 am Post subject: |
|
|
This is a bad piece of code right here:
Code: | for(i, 0, 35, 1) do, begin
for(j, 1, npccopycount(i), 1) do, begin
destroy npc(i)
end
end |
The reason why is that it's trying to count how many NPCs there are while it's destroying them. It's like you have five apples and you want to count how many you have and eat them all. You eat one and count one; eat two, count two; eat three and there are only two left. You had two apples but somehow managed to eat three.
This may not solve your script buffer overflow, but try changing the code to this:
Code: | variable(temp)
for(i, 0, 35, 1) do, begin
temp:=npccopycount(i)
for(j, 1, temp, 1) do, begin
destroy npc(i)
end
end |
Oh, and if that doesn't fix it, separate the script into smaller ones. There's no way you'll pinpoint the problem in a script that long. _________________
|
|
Back to top |
|
 |
Uncommon His legend will never die

Joined: 10 Mar 2003 Posts: 2503
|
|
Back to top |
|
 |
MC Guest
|
|
Back to top |
|
 |
|