ID:270738
 
Well here's the problem i want to regenarate turfs like repop regenarates mobs and objs, well i want a code that make the original turfs reappear on the world. Can anybody help me with that ?
XD There's always reboot!

Uh let's see... I don't know of any ways that aren't really laggy, since all I can think of it using something like:

// This should work if you haven't turned off a defualt turf
for(z=1,z<=world.maxz,z++)
for(y=1,y<=world.maxy,y++)
for(x=1,x<=world.maxx,x++)
var/turf/t = locate(x,y,z) // Gets the turf at that location
t = initial(t) // Reset t to its original value


There's also another way that I'm sure would work... but you could also try a much simpler

for(var/turf/t in world)
t = initial(t) // Pretty obvious given the above


I'm not sure if that one will work though, I haven't been playing with turfs all that much until recently, and I haven't really tested anything yet...

Wrong. <code>initial()</code> only will work on variables, not actual objects.

A solution would be to save the map using a library like SwapMaps, then load it whenever you want the map to be regenerated to its initial state.

~~> Unknown Person
In response to Unknown Person
Oh you're right of course... I should have added a loop the initialises all of its variables instead, but it's the same thing
i don't care if it's lagg i deal with but, and can you help me with it
In response to Unknown Person
Owwwhhh i justed tryed it and it casue wayyyyyyyy tooo much lagg for me, isn't there a simpler way that casue no lag
In response to Sayian Hunter
Sayian Hunter wrote:
Owwwhhh i justed tryed it and it casue wayyyyyyyy tooo much lagg for me, isn't there a simpler way that casue no lag

Try what Unknown Person suggested, and look up the SwapMaps library. I dunno what it does but it sounds like something worth trying...
I did try it, it saves the map so when you log in back the objs be there, but i edit it so it saves the map as soon as you log in so when you repop i load the world too.

But it's still too lagggg for me
Anybody help me with that ?
In response to Sayian Hunter
Stop double posting. That'll make people more willing to help you.
In response to Sayian Hunter
Sayian Hunter wrote:
i don't care if it's lagg i deal with but, and can you help me with it

Sayian Hunter wrote:
Owwwhhh i justed tryed it and it casue wayyyyyyyy tooo much lagg for me, isn't there a simpler way that casue no lag

?