Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Script buffer overflow

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
StellarXtoolazytologin
Guest






PostPosted: Thu Jan 20, 2005 8:17 am    Post subject: Script buffer overflow Reply with quote

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

PostPosted: Thu Jan 20, 2005 10:43 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 15 Jul 2004
Posts: 3377
Location: Seattle, WA

PostPosted: Thu Jan 20, 2005 11:15 am    Post subject: Reply with quote

But, hey, it's friggin Stellarks. How's it going?
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
StellarX
Cosmically Oblivious




Joined: 09 Jan 2004
Posts: 14
Location: Dublin, GA

PostPosted: Thu Jan 20, 2005 11:40 am    Post subject: Code Reply with quote

Hey moogle! long time no see! RMS 4 Life.

I imagine the script is way too big and I'm thinking maybe I'll just try to rewrite it or come up with a different scenario for this part of the game
but here's the code if anyone wants to have a look
I've commented where I think the error starts

http://www.livejournal.com/users/stellarx/11413.html
_________________
StellarX.org!!! Join now and get a free cupcake!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 15 Jul 2004
Posts: 3377
Location: Seattle, WA

PostPosted: Thu Jan 20, 2005 11:49 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
Uncommon
His legend will never die




Joined: 10 Mar 2003
Posts: 2503

PostPosted: Fri Jan 21, 2005 9:21 am    Post subject: Reply with quote

And, on the subject of script-splitting, here are a few tips from the SPAM Man himself.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
MC
Guest






PostPosted: Thu Jan 27, 2005 12:51 am    Post subject: Reply with quote

That piece of code can't cause a buffer overflow. I'd imagine that you would get an if statment out of bounds or something.

Not really any more helpful, but http://gilgamesh.dnsalias.org:8080/wiki/ohrrpgce/index.php/How_do_I_avoid_script_buffer_overflows%3F
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group