ID:163006
 
when i start my game, i want no map file to be loaded, but rather the map is made with code after the game is run.
how do i go about do this, in world() new() ?
It's a world variable.

world
maxx
maxy
maxz
In response to Kaiochao2536
im aware, but i wanna use a var to setboth x and y without changing both maxx and maxy
In response to FallingLegend
FallingLegend wrote:
im aware, but i wanna use a var to setboth x and y without changing both maxx and maxy

Set both x and y what?

There are only 3 variables to determine the size of the map. maxx, maxy and maxz. maxx and maxy determine the dimensions of the map, and maxz determines how many map "planes" there are to work with.
In response to Foomer
set just both maxx and maxy using a variable, but it says it expected a constant expression.
In response to FallingLegend
You can either set world dimensions in the code:
world
maxx = 5
maxy = 4
maxz = 1


Or at runtime like this:
mob/verb/SetWorldSize(nx as num, ny as num)
world.maxx = nx
world.maxy = ny


Although you'll want to make sure world.maxz is at least 1 all the time, unless you're happy sitting in null.
In response to Foomer
not a verb, something like this.

var/XY = 5
World()
<tab>New()
<tab><tab>world.maxx = XY
In response to FallingLegend
FallingLegend wrote:
not a verb, something like this.

> var/XY = 5
> World()
> New()
> world.maxx = XY


In other words:
world
New()
maxx = 5
maxy = 5
maxz = 1


But really if you're going to set it at world new, you might as well just pre-set the vars in world.
In response to Foomer
i cant set both vars with one var, it just doesnt work, it says it was looking for a constant value when i do so, and this way just doesnt work.
In response to FallingLegend
You're trying to unnecessarily set a var with a var. All you need is

world
maxx=5
maxy=5

because doing this:
world
New()
maxy=5

or this:
var/xy=5
world
New()
maxy=xy

is pointless, useless, and not needed. Making a var xy won't change both maxx and maxy because you're only changing one of them.
In response to Kaiochao2536
anyways, um, i was trying to change both x and y with the one variable, and that variable will be also used in calculating the number of squares, and the offset of things.