ID:91791
 
Not a bug
world/New() isn't allowed to finish executing causing DS to fail to load.
BYOND Version:462-463
Operating System:Windows 7 Ultimate
Web Browser:Firefox 3.5.8
Status: Not a bug

This is not a bug. It may be an incorrect use of syntax or a limitation in the software. For further discussion on the matter, please consult the BYOND forums.
Descriptive Problem Summary:
When I try to run my game from DM it doesn't come up. I checked in my task manager, and it's there...and it's size keeps increasing, but it never pops-up. I can play game's from BYOND, just not launch Dream Seeker from DM...

Numbered Steps to Reproduce Problem:
1) Make a while() statement to create a never-ending loop, make it output "Test" or anything to the world.
2) Try to close Dream Seeker (for me, it crashed).
3) Try to run any game from DM (for me, it wouldn't work)

Code Snippet (if applicable) to Reproduce Problem:
world/New()
..()
var/I=1
while(I==1)
world << "Test"


Expected Results:
It to just crash and allow you to do what you want again.

Actual Results:
It made my Dream Seeker never pop-up anymore, even after a re-installation of BYOND and a reboot.

Does the problem occur:
Every time? Or how often? - Every time.
In other games? - No.
In other user accounts? - On my key and a guest key.
On other computers? - Not tested.

When does the problem NOT occur?
Never.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked?
It worked until I crashed Dream Seeker...

Workarounds:
None that I know of.
This isn't a glitch, just call spawn() to avoid this. The world doesn't start by calling the parent ..(), but by the end of the proc.
Well, this is my world/New() code...it still doesn't launch DS...

world
view = 8
New()
..()
for(var/skill in typesof(/obj/KIDOU/)) skillobjs+=new skill
for(var/skill in typesof(/obj/HOLLOW/)) skillobjs+=new skill
maxplayers = 50
spawn(864000)
world << "<center><font color=teal><b>AUTO-REBOOT COUNTING DOWN...</b></font></center>"
sleep(10)
world << "5"
sleep(10)
world << "4"
sleep(10)
world << "3"
sleep(10)
world << "2"
sleep(10)
world << "1"
world.Reboot()
var/I=1;while(I)
spawn(600)
for(var/mob/M in players)
if(M.playing)
M.Save()
else
continue
Ranch Jolly wrote:
This isn't a glitch, just call spawn() to avoid this. The world doesn't start by calling the parent ..(), but by the end of the proc.

If I take out my while() loop, it works fine...
Hi1 wrote:
Ranch Jolly wrote:
This isn't a glitch, just call spawn() to avoid this. The world doesn't start by calling the parent ..(), but by the end of the proc.

If I take out my while() loop, it works fine...

spawn() the while and it'll work fine.
while()

To define while would be;
"a period or interval of time"
You are setting while() to 1 with
var/I=1;while(I)
which is technically fine.
But, you aren't finishing while() which causes an infinite loop.
To finish while, you'll need to nullify or subtract from var/I.
mob/proc/Hello()
var/X = 10
while(X)
world << "Hello!"
X -= 1

This will display "Hello" to the world, 10 times then stop. Hence: X = 10 and X-=1 after the world << "Hello!"

Did this help you understand while() ?