Thanks,
that is extremely useful. I did this with it
function __IncreaseZ(...)
local x,y,z
-- display(arg)
for i = 3,arg['n'] do
x,y,z = getRoomCoordinates(arg[i])
-- echo("\n id "..arg[i].." x "..x.." y "..y.." z "..z.." "..getRoomName(arg[i]))
setRoomCoordinates(arg[i],x,y,(z+1))
end--for
centerview(arg[3])
end--function
and also
function __DecreaseZ(...)
local x,y,z
-- display(arg)
for i = 3,arg['n'] do
x,y,z = getRoomCoordinates(arg[i])
-- echo("\n id "..arg[i].." x "..x.." y "..y.." z "..z.." "..getRoomName(arg[i]))
setRoomCoordinates(arg[i],x,y,(z-1))
end--for
centerview(arg[3])
end--function
I hate walking up/down steps and not knowing where I am on them, so I like to group them on the same z level and offset them. This works becase my mud is just n,s,w,e,u,d so the u,d go where ne,sw would be.
Its remarkable how much you can map with so little code, functions etc
Also later i did this for adding doors
addMapMenu("Closed","Doors","Closed")
addMapMenu("Locked","Doors","Locked")
addMapMenu("Remove","Doors","Remove")
addMapEvent("CNorth","__DoorAction","Closed","North")
addMapEvent("CSouth","__DoorAction","Closed","South")
addMapEvent("CWest","__DoorAction","Closed","West")
addMapEvent("CEast","__DoorAction","Closed","East")
addMapEvent("LNorth","__DoorAction","Locked","North")
addMapEvent("LSouth","__DoorAction","Locked","South")
addMapEvent("LWest","__DoorAction","Locked","West")
addMapEvent("LEast","__DoorAction","Locked","East")
addMapEvent("RNorth","__DoorAction","Remove","North")
addMapEvent("RSouth","__DoorAction","Remove","South")
addMapEvent("RWest","__DoorAction","Remove","West")
addMapEvent("REast","__DoorAction","Remove","East")
function __DoorAction(...)
local roomid = arg[3]
local door = arg[2]
local doorDirectionMap = (
{LNorth="n", LSouth="s", LWest="w", LEast="e", LUp="u", LDown="d",
CNorth="n", CSouth="s", CWest="w", CEast="e", CUp="u", CDown="d",
RNorth="n", RSouth="s", RWest="w", REast="e", RUp="u", RDown="d"}
)
local doorStatusMap = (
{LNorth=3, LSouth=3, LWest=3, LEast=3, LUp=3, LDown=3,
CNorth=2, CSouth=2, CWest=2, CEast=2, CUp=2, CDown=2,
RNorth=0, RSouth=0, RWest=0, REast=0, RUp=0, RDown=0}
)
local doorStatus = doorStatusMap[door]
local doorDirection = doorDirectionMap[door]
echo("\n Set Door id "..roomid.." exit "..doorDirection.." status "..doorStatus)
setDoor(roomid, doorDirection, doorStatus)
end--function
I have up / down in the function but not in the menu. I'm not sure if you can make up/down doors but either way its no big deal really to adjust it.
I was trying to find a away to pass an argument using the addMapEvent function as well as the arg table but couldn't get it to work. This is kinda clunky but it works just fine.