ID:836084
 
(See the best response by Forum_account.)
Code:
world
fps = 25 // 25 frames per second
icon_size = 32 // 32x32 icon size by default
mob=/mob/mammal/human/player
view = 6 // show up to 6 tiles outward from center (13x13 view)

proc
worldGenerate(t as num)
src.maxx = t
src.maxy = t


// Make objects move 8 pixels per tick when walking

mob
mammal
human
player
icon = 'human.dmi'
Login()
var/t
t = input("Please choose a world size") in list(" Large (200x200) "," Medium (100x100) "," Small (50x50) ")
switch(t)
if(" Large (200x200) ")
worldGenerate(200)
world<<"large"
if(" Medium (100x100) ")
worldGenerate(100)
world<<"medium"
if(" Small (50x50) ")
worldGenerate(50)
world<<"small"
usr<<"You wake up this morning and feel strange..."
usr.casual_speed = 5
usr.step_size = casual_speed
..()


Problem description:
worldGenerate() is not a defined proc because its with world but i don't know a way to get around it...
Don't place it under world.
proc/worldGenerate()
// do stuff
how can i do that while still being able to change the world vars
Just as you would anything.
proc
worldGenerate(x = world.maxx, y = world.maxy)
// make x and y default to the current dimensions
// if you send a different value to x or y then it will override the default
world.maxx = x
world.maxy = y

I've never tried changing the maxx and maxy at runtime before, so I'm not even sure if you can. Worth a shot, though.
In response to Darkology123 (#2)
Best response
Darkology123 wrote:
how can i do that while still being able to change the world vars

proc
worldGenerate(t)
world.maxx = t
world.maxy = t

You can also leave the proc inside world and change how you call it, just change "worldGenerate()" to "world.worldGenerate()".
Thanks everyone, it works. To Albro, you are able to change it at runtime apparently :)