ID:145779
 
BYOND Version: beta

Operating System: XP

Web Browser: INternet Explorer

Game/Hub(s): hub://games.byond.com/hub/Lilley159/ADarkPath

Detailed Problem Description: i get a error when game is running
Infinite loop suspected--switching proc to background.
If it is not an infinite loop, either do 'set background=1' or set world.loop_checks=0.
proc name: New (/world/New)
usr: null
src:
call stack:
: New()


Does the problem occur:
Every time

In other games? Not that i know of

On other computers? No

In other user accounts? No
That is not a Byond error, it's an error with the game's code. It means you either have an infinite loop somewhere, or you just have a call-stack that's too large. Probably the former.
In response to Loduwijk
An example of an infinite loop:
world/New()
..()
while(1)
var/tmp/players[0]
for(var/mob/M in world)
if(M.client)
players += M


...remember, it's just an example. What happens is that this proc is always happening, not giving any time to other procs. this is how you can fix it: just put ' set background=1 ' like how you would put ' set category="blah" '...or add a sleep line in there


- GhostAnime
In response to GhostAnime
omg, j00 nvar put dlay!11!1one!1

That's what causes you to get those error messages. An inifnite loop is okay, a lot of games use them even though they might find better ways around them. I like to, at least. A long loop without delay will send you those annoying messages, so use sleep() or spawn().

Also, you might want to set the loops to 1.
world/New()
..()
SuperLoop()
proc/SuperLoop()
set background=1
while(1)
world<<"Hey!"
sleep(1)


The sleep proc cannot take any arguments lower than 1, unless it is a false value i.e(null, 0, " "). When you set it to null, though, your proc will run incredibly fast, only sleeping when the client is stressed. Not a good idea in most cases because of lag issues, but still useful to know.
In response to CaptFalcon33035
A example of an infinite lop would be a day/night system. =D
You should show us your world/New() code so that we can further help you fix this problem. This is not a BYOND Bug, it is an error with your code. If you show us the code, we can help.