ID:265232
 
I would have put this under newbie central, but considering how confusing the swap maps system by Lummox Jr is, i put it here.

Can someone post a section coding that will make my game save its map automaticly, and load its map automatically, using swapmaps? I cant get it to work. And Lummox, if you read this, put some bits of coding in swapmaps (like at the bottom in the /* */ things) that are just basic plug in and use things? I probobly just made a simple mistake, but it is a confusing system.
You are right that this should be in newbie central, or even off-topic.

However, the easiest way to save your maps automatically is to loop through swapmaps_loaded.

for(var/swapmap/map in swapmaps_loaded)
map.Save()

I could have the variable mispelled, and possible the function capitalized when it shouldn't be, but that's the gist of it.
In response to sapphiremagus
Umm... it doesnt work O.o i get no errors, but it doesnt save O.o
In response to Vamp_-_Clock
I use SwapMaps too this is how I got it to save..
mob/Login()
..()
map = SwapMaps_Find("hq_[src.ckey]")
if(!map)
SwapMaps_Load("hq_[src.ckey]")

mob/Logout()
src.SaveChar(1)
if(map) map.Unload()
del(src)

In response to Dession
umm... could you define map?
In response to Vamp_-_Clock
you define it...var/map

its not that hard
In response to Dession
lol, i thought it could have been more complicated then that, sorry

Umm, but there is one (hopefully last) problem
map.Unload()
is an undefined proc
In response to Vamp_-_Clock
var/map
will not work the way you want it to.
You want
var/swapmap/map
In response to sapphiremagus
ack -.- it doesnt work

here is my coding
world
New()
map = SwapMaps_Find("hq_slow")
if(!map)
SwapMaps_Load("hq_slow")
..()
Del()
SwapMaps_Save("hq_slow")
if(map)
map.Unload()
..()
var/swapmap/map