ID:179248
 
just a quick question I'm hoping someone can answer since I didn't want to spend a bunch of time looking it up...

ok so anyways is it possible to make it so...

errr...
ok let me start over.

You start off in my game with a town, now what if you switched to another mob (preferably a worker) and you went right next to the town and hit the "enter" verb that comes up when you're within 1 space of the town, which as always probably teleports you somewhere... into the town


Now every person can have the same type of town, just different economy, etc depending on how each person works them.

How would I make it so when it teleports them to this new town(new map, basically the inside of the town once you hit enter you went into the inside), that it creates a new map for them first?

same effect as if you were to be in Dream Maker and hit new
map.

is this possible?
if so could you give me a link or something to where this might be?


JonSnow13 wrote:
just a quick question I'm hoping someone can answer since I didn't want to spend a bunch of time looking it up...

ok so anyways is it possible to make it so...

errr...
ok let me start over.

You start off in my game with a town, now what if you switched to another mob (preferably a worker) and you went right next to the town and hit the "enter" verb that comes up when you're within 1 space of the town, which as always probably teleports you somewhere... into the town


Now every person can have the same type of town, just different economy, etc depending on how each person works them.

How would I make it so when it teleports them to this new town(new map, basically the inside of the town once you hit enter you went into the inside), that it creates a new map for them first?

same effect as if you were to be in Dream Maker and hit new
map.

is this possible?
if so could you give me a link or something to where this might be?



i believe your best bet would be to "copy" a z layer to another z layer, this can be done with the following code

proc/CopyZLayer(layertocopy as num, layerpaste as num)
var/atom/newatom
for(var/atom/A in world)
if(A.z == layertocopy)
newatom = new A.type
newatom.loc = locate(A.x,A.y,layerpaste)

Example:

mob/verb/newtown()
CopyZLayer(1,2)
src.loc = locate(1,1,2)

This would copy everything in layer 1, and put it in layer 2. Then send the mob to the 2nd layer. The process would not even be visible to the mob, as it would happen very rapidly. If your map isnt that big, it would look like nothing even happened.(assuming of course you're standing at 1,1,1 when you click the verb)

and to cut down lag, you can use a block() statement in the for loop instead of looping through all atoms in the world.

FIREking

p.s. This code isnt tested, if it doesnt work, dont get mad please.
In response to FIREking
grr I'm going to get mad!!
j/k

haha... oh well I'm not sure if that'll work...

I don't know if I want to do it this way I was just wondering if it was possible...


It would be nice to do if I had less than like 10 players of the same type of town, could totally make each one unique...

but I'm sure creating a new map every time a new player logs in and hits the Enter verb wouldn't be very good on the lag huh?
In response to JonSnow13
JonSnow13 wrote:
grr I'm going to get mad!!
j/k

haha... oh well I'm not sure if that'll work...

I don't know if I want to do it this way I was just wondering if it was possible...


It would be nice to do if I had less than like 10 players of the same type of town, could totally make each one unique...

but I'm sure creating a new map every time a new player logs in and hits the Enter verb wouldn't be very good on the lag huh?

Well this generally creates a new map, considering you have enough z layers. If you just make 10 empty z layers, you can use them for creating new maps by copying the other z layers. I am getting the impression that you wish to make a new map, with a "template" town on each map correct? If so, then my proc would be supreme for that purpose. You can create the "template" town on one z layer, and use it to copy to other z layers.

FIREking
In response to FIREking
but would this lag incredibly if say 30-50 people were to log in and do it?
In response to JonSnow13
JonSnow13 wrote:
but would this lag incredibly if say 30-50 people were to log in and do it?

if you really want to get rid of the lag, use a block statement so you only loop through all the atoms in the z layer that holds the template.

this can be achieve with the following proc

proc
loopthroughz1()
for(var/atom/A in block(locate(1,1,1),locate(world.maxx,world.maxy,1)))
world << "found [A.name] in the first layer!"

this out puts a message for each atom in the first layer. It gets rid of a lot of lag because we didnt loop through the entire world.

FIREking
In response to FIREking
cool thanks, this is very useful thanks a ton :)
I'm going to go see if I can get it to work now :P
JonSnow13 wrote:
How would I make it so when it teleports them to this new town(new map, basically the inside of the town once you hit enter you went into the inside), that it creates a new map for them first?

same effect as if you were to be in Dream Maker and hit new
map.

is this possible?
if so could you give me a link or something to where this might be?

I'm afraid it isn't possible, not as far as I know. BYOND has no dynamic map support, and to my knowledge world.maxz is fixed.

You could always give FIREking's code a shot, though I suspect that it won't work fully in that form and may take some tweaking if it would work at all. Assuming you did get it to work, you'd then need some kind of system in your world for keeping track of unuzed Z-levels and deleting them as needed.

Lummox JR
In response to Lummox JR
Lummox JR wrote:

I'm afraid it isn't possible, not as far as I know. BYOND has no dynamic map support, and to my knowledge world.maxz is fixed.

Actually, you can modify world.maxx, maxy, and maxz at runtime. The behavior is a bit confusing when you mix the max variables with compiled-in maps, so if you do want to do some sort of dynamic map support it would be best to create everything at runtime. Example:
world
maxx = 10
maxy = 10
maxz = 1

mob/verb/newlevel()
world.maxz++

mob/verb/teleport(z as num)
usr.Move(locate(1,1,z))


A few people (Gazoot?) have even made libraries to manage the map-format at runtime. I don't know what the completion status is on those things, but it may be the case that dynamic maps can work (to some degree) in even the current version of BYOND!
In response to Tom
Tom wrote:
Lummox JR wrote:

I'm afraid it isn't possible, not as far as I know. BYOND has no dynamic map support, and to my knowledge world.maxz is fixed.

Now I told Lummox this was wrong weeks ago!


A few people (Gazoot?) have even made libraries to manage the map-format at runtime.

I did a completely dynamic map system two years ago...and between Spuzzum and I we have a full map system which I'm supposed to be maintaining but haven't touched yet. Anyway, it is totally possible to completely dynamically generate maps in BYOND, using either the .dmp format or your own format.
In response to Deadron
Yes but doing something like this would make inconsiderable lag though, wouldn't it?


If it constantly created new worlds, and having to create new turfs on each map, not even considering the maps would be atleast 25x25, or possibly 50x50...
In response to Deadron
Deadron wrote:
Now I told Lummox this was wrong weeks ago!

Doh!
Blame it on my pathetic memory, then. :)

Knowing dynamic maps work is very interesting. I'm curious at what point BYOND would hit its memory limit for this, but knowing some dynamic map support exists makes big RPGs a lot more feasible.

Lummox JR
In response to Lummox JR
I tested this earlier, and it caused me bad bad lag, but was probably because I made 5 new maps at the same time...
In response to Nadrew
which possibly could happen...
I'm thinking of avoiding this idea... And aiming for just one town map for each race
In response to Nadrew
which possibly could happen...
I'm thinking of avoiding this idea... And aiming for just one town map for each race