A Runaway Loop Error is generated when a script thread executes a loop continuously without allowing for the rest of the game to continue.

Specifically, you must include a waitFrame command in your loops to avoid this error.

Error

ERROR: [mapname]([linenumber]): Thread 'main': runaway loop error

ERROR: maps/fail.script(28): Thread 'main': runaway loop error

Example

   1 
   2 //this is busta
   3 while( x < 100) {
   4  x++;
   5 }
   6 
   7 //this will work
   8 while( x < 100) {
   9  x++;
  10  sys.waitFrame();
  11 }
  12 

ScriptError RunawayLoopError (last edited 2005-11-01 19:40:02 by JimShepard)