Exactly what I'm after. If I read correctly and both are not publicly available then I will have to wait. I Don't want to map to much in case I've to start again, so I'm trying to find everything I need right from the start. I'm having great fun though.
I added a couple of things today.
In the mapSetup script added a couple of flags
__twoExits__ to stop the return mapping walking from one room to another
__updateMap__ to stop the entire function initNewRoom() which adds rooms and exits to the map but will still plot where I am on the map if it exists.
--map script exists
mudlet = mudlet or {}; mudlet.mapper_script = true
__debug__ = true;
__twoExits__ = false ;
__updateMap__ = false ;
they show in an existing window just so I know what going on with the mapper.
- alias.PNG (15.15 KiB) Viewed 8507 times
Green for on red for off. As its displayed the map will add rooms, but only exits in the direction of travel.
- toggles.PNG (4.91 KiB) Viewed 8507 times
function initNewRoom()
if __updateMap__ then
local isNewRoom = addRoom( _mapper_roomID )
local id = _mapper_roomID
local roomAreaName = gmcp.room.info.zone
local roomAreaID = addAreaName( roomAreaName );
if roomAreaID == -1 then
roomAreaID = getRoomAreaName( roomAreaName );
end --if
local stepLength = 1;
-- lastMoveDirection = command
-- I walk using the keypad so in the hotkeys I made lastMoveDirection = "north" etc
-- if you walk from the command line then use the above line but it does a compare a few
-- lines down so you might want to change north to n etc
if __debug__ then echo("last move command:"..lastMoveDirection.."\n") end--if
if isNewRoom then
if __debug__ then cecho("<red>ADDED new roomID: "..id.."\n") end--if
--set room name
local roomName = gmcp.room.info.name
setRoomName( id, roomName )
if __debug__ then cecho("<orange>ADDED room name: "..roomName.."\n") end--if
-- set room coordinates
if lastMoveDirection == "west" then --these might need set to 'w' etc
__mapper_room_x = __mapper_room_x - stepLength;
if __twoExits__ then setExit(id, roomID, 4) end;--if --id room in now
setExit(roomID, id, 5); --roomID room came from
end--if
if lastMoveDirection == "east" then
__mapper_room_x = __mapper_room_x + stepLength;
if __twoExits__ then setExit(id, roomID, 5) end;--if
setExit(roomID, id, 4);
end--if
if lastMoveDirection == "south" then
__mapper_room_y = __mapper_room_y - stepLength;
if __twoExits__ then setExit(id, roomID, 1) end;--if
setExit(roomID, id, 6);
end--if
if lastMoveDirection == "north" then
__mapper_room_y = __mapper_room_y + stepLength;
if __twoExits__ then setExit(id, roomID, 6) end;--if
setExit(roomID, id, 1);
end--if
if lastMoveDirection == "up" then
__mapper_room_z = __mapper_room_z + stepLength;
if __twoExits__ then setExit(id, roomID, 10) end;--if
setExit(roomID, id, 9);
end--if
if lastMoveDirection == "down" then
__mapper_room_z = __mapper_room_z - stepLength;
if __twoExits__ then setExit(id, roomID, 9)end;--if
setExit(roomID, id, 10);
end--if
cecho("<green>guessing new room coordinates\n")
setRoomCoordinates( id, __mapper_room_x, __mapper_room_y, __mapper_room_z )
setRoomArea( id, roomAreaID )-- set Area only for new rooms incase you change it
else
cecho("<green>KNOWN room, coordinates stay, just adding exits\n")
if lastMoveDirection == "west" then
if __twoExits__ then setExit(id, roomID, 4) end;--if
setExit(roomID, id, 5);
end--if
if lastMoveDirection == "east" then
if __twoExits__ then setExit(id, roomID, 5)end;--if
setExit(roomID, id, 4);
end--if
if lastMoveDirection == "south" then
if __twoExits__ then setExit(id, roomID, 1) end;--if
setExit(roomID, id, 6);
end--if
if lastMoveDirection == "north" then
if __twoExits__ then setExit(id, roomID, 6) end;--if
setExit(roomID, id, 1);
end--if
if lastMoveDirection == "up" then
if __twoExits__ then setExit(id, roomID, 10) end;--if
setExit(roomID, id, 9);
end--if
if lastMoveDirection == "down" then
if __twoExits__ then setExit(id, roomID, 9)end;--if
setExit(roomID, id, 10);
end--if
__mapper_room_x,__mapper_room_y,__mapper_room_z = getRoomCoordinates(id)
end--if isNewRoom
roomID = id;
__SetTerrainColor()--set the sector color
__roomCollision()--check for rooms in same coordinates
if __debug__ then
cecho("<yellow>DIR:"..lastMoveDirection.." new POS("..__mapper_room_x.."/"..__mapper_room_y.."/"..__mapper_room_z..")\n")
end--if
else
__mapper_room_x,__mapper_room_y,__mapper_room_z = getRoomCoordinates(_mapper_roomID) -- different roomid here
end--if __updateMap__
end--function
They sit in the script as shown above.
And operate with an alias.
The mud provides all exits from a room so it should be possible to test if the room already exists and has coordinates and if so then it will plot the exit, stop me missing some. But that might spoil my fun if it did that.
Still the code shouldn't be to tricky so it might fall within the realm of my abilities.
If these posts are pointless and of no interest someone say so
I'm just describing my problems as I stumble across them.