[Home] [Downloads] [Search] [Help/forum]

Log on
Register forum user name Search FAQ

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Plugins
. . -> [Subject]  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] Refresh page


Posted by Mewtiny   (1 post)  [Biography] 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

[Go to top] top

Posted by Nick Gammon   Australia  (22,556 posts)  [Biography] 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
[Go to top] 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.


822 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]