ID:264566
 
Code:
proc
RandomStage()
start
spawn(18000)
goto start
fstage=rand(1,7)
if(fstage==1)
stagename = "Ultimas Arena"
world<<"<B><U><FONT COLOR = blue>WORLD ANNOUNCEMENT:</B> World stage set to Ultimas Arena"
for(var/mob/M in world)
M.suicide()
if(fstage==2)
stagename = "Starlight City"
world<<"<B><U><FONT COLOR = blue>WORLD ANNOUNCEMENT:</B> World stage set to Starlight City"
for(var/mob/M in world)
M.suicide()
if(fstage==3)
stagename = "Resistance Base"
world<<"<B><U><FONT COLOR = blue>WORLD ANNOUNCEMENT:</B> World stage set to Resistance Base"
for(var/mob/M in world)
M.suicide()
if(fstage==4)
stagename = "Brain Freeze"
world<<"<B><U><FONT COLOR = blue>WORLD ANNOUNCEMENT:</B> World stage set to Brain Freeze"
for(var/mob/M in world)
M.suicide()
if(fstage==5)
stagename = "Chill Out"
world<<"<B><U><FONT COLOR = blue>WORLD ANNOUNCEMENT:</B> World stage set to Chill Out"
for(var/mob/M in world)
M.suicide()
if(fstage==6)
stagename = "Celestial Forest"
world<<"<B><U><FONT COLOR = blue>WORLD ANNOUNCEMENT:</B> World stage set to Celestial Forest"
for(var/mob/M in world)
M.suicide()
if(fstage==7)
stagename = "Embers Pit"
world<<"<B><U><FONT COLOR = blue>WORLD ANNOUNCEMENT:</B> World stage set to Embers Pit"
for(var/mob/M in world)
M.suicide()

world
New()
spawn(18000)
RandomStage()
song=rand(1,19)
fstage=rand(1,7)


Problem description: Pretty much this is a code that's suppose to change the world map every 30 minutes. But it doesn't do that at all, and I don't understand what the problem could be. Help would be very much appreciated.

In response to Moonlight Memento
Moonlight Memento wrote:
Welcome, novice programmer!

Not the answer i'm looking for but thanks for your "Advice". =)
The problem is first that you are abusing (which is to say, using at all) goto. Second that you are abusing spawn(). Third that you are not doing anything that would cause what you want to happen to happen, therefore, what you want to happen never happens.
As has been mentioned, the code you presented shows bad practice on various levels. Instead of recursive function calls, you likely want a little looping construct, to avoid all sort of problems. Now, when you want to check for the value of one specific variable, you should use switch (read up on these links, because they explain the basics). In this very case, you won't even need a switch, because your whole RandomStage proc can be shortened to
proc
RandomStage()
var/list/stages = list("Ultimas Arena", "Starlight City", "Resistance Base", "Brain Freeze", "Chill Out", "Celestial Forest", "Embers Pit")
for()
stagename = pick(stages)
world << "<font color=\"blue\"><b><u>WORLD ANNOUNCEMENT:</b> World stage set to [stagename]</u></font>"
setupworld()
sleep(delay)

where setupworld should handle setting up the world and it's implementation would depend on your design. You likely want to get used to closing your HTML tags as well, since that can but you easy one day, if you get too lax and proper formatting according to the W3C won't hurt you, but is bound to ensure compatibility.
In response to Schnitzelnagler
Thank you very much Schenitzelnagler, your post is very helpful and it solved my issue. Thank you.