Learning Mapper - Area Name for new rooms

Posted by Mewtiny on Sun 25 Oct 2020 10:11 AM — 2 posts, 11,446 views.

#0
It's possible I missed an option or setting somewhere but no matter what I did, new rooms always were set with an Area Name of the World Name. I updated the code below to always try and carry over the Area Name from the previous room so that once you've entered a new area, you only need to update the first room and then it will continue using that -- rinse/repeat. Obviously only really works 1 if you actually know what the Area is which sometimes requires WIZ/IMM status but still better than all rooms being set to the same area. Anyways, here's what I added/changed (in bold)



  -- add room to rooms table if not already known
  if not rooms [uid] then
    INFO ("Mapper adding room " .. fixuid (uid))
    local last_area
    if rooms [from_room] then
      last_area = rooms [from_room].area
    else
      last_area = area_name or WorldName ()
    end

    rooms [uid] = {
        desc = description,
        exits = exits,
        area = last_area,
        name = room_name or fixuid (uid),
        duplicate = duplicate,   -- which UID, if any, this is a duplicate of
        } -- end of new room table

Australia Forum Administrator #1
There is a function call mentioned in the documentation for changing the area name:


  set_area_name (name)               --> set the name of this area (optional, use if known) - shown at the bottom of the map


For example:


  check (CallPlugin ("99c74b2685e425d3b6ed6a7d", "set_area_name", "Main city"))