SRL Archive - Discussions and Debates

Runtime errors


Infantry001

2006-10-26 23:14:36

Now im not asking for a solutiong, just an answer. Why do runtime errors occur, especially with SRL (not all the time, just sometimes)? Many times, a runtime coems out of nowhere from Antirandoms.scar or Mining.scar. what causes this to happen?

weibs

2006-10-27 17:14:22

I know runtime errors can stem from an array. For example, if you have an array that has a length of 5 (arr[0], arr[1], arr[2], arr[3], arr[4] exist) and you try to access arr[5], you'll get a runtime error, because arr[5] is out of the boundaries of the array. It may come from the player array if something is set up wrong.

I'm not sure what else runtime errors can come from.

Yakman

2006-10-27 18:15:56

'access violation' runtime errors is caused when you try to use a Bitmap, DTM or character set when it hasent been loaded in SCAR's memory.

'math error' runtime errors are caused if you divide a number by zero or use sin/cos on the wrong number

'dll error' runtime errors are caused if you write a rubbish plugin, they are also caused if you use some procedures without ThreadSafeCalling them

'canvas does not allow drawing' runtime errors are caused if you try to draw on a canvas which cant be drawn on, eg. the client canvas.

'can't create compatable DC' runtime errors are caused if you load too many bitmaps, DTMs or character sets without freeing them. SCAR runs out of memory and crashes.

thats all i can remember now, but i know theres more.

Infantry001

2006-10-27 22:21:44

thanks