Mirage Source
Runtime Error 6: Overflow - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: Runtime Error 6: Overflow (/showthread.php?tid=140)



Runtime Error 6: Overflow - Anthony - 22-06-2006

Well, the runtime error fixes post didn't help me out much here haha. What is happening is I am getting a Runtime Error 6: Overflow on the server. I can't seem to pinpoint it to anything yet, I have been testing the server in many different ways and it only will occur when it is compiled so I cannot load it in VB and debug it that way. It only seems to occur once in awhile, I haven't timed it yet to see how long it takes or anything but it's quite a while I believe. More or less I am just wondering if there is a way to locate a coding error without searching the entire thing for a tiny mistake. Overflow is when a byte is being stored as something beyond 255 correct? So is there a way to find something thats attempting to store any byte within the code thats higher than that? I hope this is making sense to everyone haha. Any help on how to track something down like that would be great. Thanks a lot.


- Obsidian - 22-06-2006

It means a value is being assigned for a variable outside of it's known range. e.g., you have something that's like Max_Players as Byte, and then it is looking at player number 256, even though the max byte value is 255.

Just figure out what part is overflowing, then up the variable Smile


- Anthony - 22-06-2006

Thats what I said haha. I am just wondering if there is a quicker way to find the byte thats giving me the error than searching every bit of code.


- grimsk8ter11 - 22-06-2006

just use debug in VB6, run from the IDE and whala when it errors, itll point to the line.


- Robin - 22-06-2006

If its a long time, it might be the 'saveplayer' sub.


- Dark Echo - 22-06-2006

You stated that it only appears once in a while right? Well the first few steps to find and fix this bug is to first to figure out how to produce the error. So work out what you have to do, to get this error appear.. Then work back from there..


- Anthony - 22-06-2006

Well I managed to track it down to the save player section, thanks Kite. It had to do with Shadows save player code, where he makes the game save one player at a time. Not sure exactly why it is happening just yet.

-edit-

Coming to my senses after sitting and eating a bowl of Cheerios it just hit me that it is obviously the Max_Players constant. I looked and it was set to 500 XD. So I fixed that right away and so far so good on the saving of players. Thanks for the help.


- Robin - 23-06-2006

Heh, thats the same problem i had xD