What I did already:
* Created a room manually, created another room manually, linked them via exits manually (unfortunately, that is where
the mapper tutorial ended)
* Create a GMCP script, which will be executed, whenever any new room is entered. It then goes on to save the room's id to a list, or if it is already known, say so. See code below.
Now I would like to combine the two. Looking at other mapping scripts, they do fancy things like calculate new x,y,z coordinates, based on last movement command, etc. At least, that is what I understood. Do I need to reinvent the wheel here? Not sure what to next consider including / copying / building myself.
There may also be cases where I try moving in a direction, but there is no exit, so no new room is reached. Other cases may be, I use an unexpected command to change rooms. Not sure how to deal with those, yet.
function ermittleRaum()
-- where am I?
id = gmcp.MG.room.info.id
echo("Found room: " .. id)
-- new here ?
if raeume[id] then
echo (" - seen this room before")
else
echo (" - new room, saving data")
raeume[id] =
{ short = gmcp.MG.room.info.short,
domain = gmcp.MG.room.info.domain,
exits = gmcp.MG.room.info.exits
}
end
end
edit: also here, for you to review, how I created the rooms manually:
lua addRoom(1)
lua setRoomArea(1, 1)
lua setRoomName(1, gmcp.MG.room.info.short)
lua getRoomName(1)
lua setRoomIDbyHash(1, gmcp.MG.room.info.id)
lua getRoomIDbyHash(gmcp.MG.room.info.id)
o
lua addRoom(2)
lua setRoomArea(2, 1)
lua setRoomName(2, gmcp.MG.room.info.short)
lua setExit(2, 1, "w")
lua setRoomCoordinates(1,0,0,0)
lua setExit(1, 2, "e")
lua setRoomCoordinates(2, 5, 0, 0)
lua getAreaRooms(1)
lua getRoomExits(1)
lua getRoomExits(2)
centerview(1)
Notice how I moved rooms by sending "o", which is German for "e", which the mapper's setExit-command expects.