Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Plugins ➜ Learning Mapper - Area Name for new rooms

Learning Mapper - Area Name for new rooms

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Mewtiny   (1 post)  Bio
Date Sun 25 Oct 2020 10:11 AM (UTC)
Message
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

Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Sun 25 Oct 2020 10:48 AM (UTC)

Amended on Sun 25 Oct 2020 10:49 AM (UTC) by Nick Gammon

Message
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"))

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


10,870 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.