SwapMaps

by Lummox JR
Load, save, and reuse temporary maps for unlimited worlds
ID:1149713
 
How do i make swapmaps load a map but only for 1 client, but by their name/key.?

I want to make a cutscene, so that when the cutscene map is loaded, only that client can enter that map.
Just create a new swapmap datum and load the map, tying it to the player through a /tmp var. Teleport them there and begin the cutscene. When the player logs out or the cutscene finishes, unload that map.
ok so like

mob/var
map = new/swapmap_template(id)

but what if i want to give the map a name.?
i want to create from a template but rename the map to the players key.
That var should be /tmp so it doesn't save.

In SwapMaps I included code for a map converter, in fromdmp.dm, though it doesn't compile into the library so you'll have to copy it into your own project and strip out some of the output. The dmp2swapmap() routine will create a map_[mapname].txt file.

When it's time to create your cutscene, use SwapMaps_CreateFromTemplate() to create the map. You can call SetID() for it if you really want to be able to save it, but I can't see any reason you'd want to. After the cutscene ends or the user logs out, unload the map.
ok cool, so only that client will be in that map right.?
like i want to name the map_[usr.key] by the clients key
wait, so when you create from a template you automatically locate to that new map.?
Nope, you don't automatically move anything to that map; that's something you'll have to do yourself. I forget the routines to grab a specific turf from a map, but it should all be covered in the documentation.

You won't need to name the map if it's not going to be saved. Template-created maps are considered temporary; that routine is used for stuff like battle maps and such.
ok great thanks. So only that one client will be able to enter that map. Cool, great library.!
wait so how would i locate the client to the new map(template)
The library contains routines that give you the lower corner turf of the map. Add your relative coordinates to that, and then just move the player there.
ok great. thanks..