Mapper Help (Alter Aeon)

Posted by Branagh on Tue 05 Mar 2019 12:38 AM — 8 posts, 33,802 views.

#0
I previously got help with an old mapper that was mostly functional but often could not detect room names correctly.
The mud recently added kxwt support for room name so I'm trying to make a simpler version but having trouble so far.
The output from the mud now looks like this:

Quote:

kxwt_rvnum 50005
kxwt_terrain 2
kxwt_rshort The healer's tent
kxwt_area 5000 You are near the refugee encampment.
kxwt_walkdir 2
The healer's tent

[Exits: north east south ]


Triggers to detect roomnum, areanum, room name and exits work fine when tested individually but I need help with generating room uid.
The mud has instanced areas which expire after 30 mins when not in use and can recycle old rvnums. So to get a unique id, you have to concatenate areanum and roomnum together.
The mapper here (https://github.com/Neurrone/Mushclient-Plugins) did this but I don't see how.
I tried this but I don't think it's right:
function generate_uid (areanum, roomnum)
uid = (string.format("%s.%s", areanum, roomnum)
end 
Australia Forum Administrator #1
Assuming things always come in that order, when you get the room vnum just remember it in a variable. Then when you get the area number concatenate it with the room vnum and there is your unique ID.
#2
Thank you.
Now my mapper can capture the main info it needs and draw rooms walking around. I'm stuck on the next step, trying to create the tables in sqlite to store the data in. The tables are not being created at all.
What I have so far is here:
https://pastebin.com/pu164Vk5
Could you have a quick look in case it's something obvious that I'm missing?
Australia Forum Administrator #3

      areanum            TEXT NOT NULL CHECK (area_num <> %s),    


What's the %s here?
#4
Branagh, I've already made a total graphical mudder for Alter Aeon, using Mush. What is your contact information on the mud?
Get in contact with me and we can talk about sharing it.

Otherwise, I can help.
Amended on Sun 05 Jan 2020 06:01 AM by Death
USA Global Moderator #5
Quote:

Get in contact with me and we can talk about sharing it.


If you don't mind my asking...
If you're already willing to share it with other people, why not just put it online and share the link?
Australia Forum Administrator #6

The Learning Mapper I developed recently seems to work OK with Alter Aeon (at least as far as I tested it).

See Nick’s Learning Mapper post for details about it.

Configuration

mapper config when_to_draw                             exits
mapper config activate_description_after_exits         No
mapper config activate_description_after_room_name     No
mapper config add_newline_to_prompt                    No
mapper config blank_line_terminates_line_type          Yes
mapper config exits_on_room_name                       No
mapper config include_exits_in_hash                    Yes
mapper config exits_is_single_line                     Yes
mapper config prompt_is_single_line                    Yes
mapper config exit_lines_start_with_direction          No
mapper config sort_exits                               No

Notes

To help the mapper learn the exits lines the following triggers should be added to your world file.

See http://www.gammon.com.au/pasting for how to copy from below and paste into your world file.

<triggers>

<!-- Room names -->

  <trigger
   back_colour="8"
   bold="y"
   enabled="y"
   keep_evaluating="y"
   match="*"
   match_back_colour="y"
   match_bold="y"
   match_inverse="y"
   match_italic="y"
   match_text_colour="y"
   send_to="12"
   sequence="100"
   text_colour="15"
  >
  <send>  
  function callmap (...)
    CallPlugin ("99c74b2685e425d3b6ed6a7d", unpack ({ ... }) )
  end -- callmap

  callmap ("set_line_type", "room_name")     -- this is a room name
  callmap ("do_not_deduce_line_type", "room_name") -- so don't try to deduce them
  callmap ("deduce_line_type", "description")      -- start deducing descriptions
</send>
  </trigger>

<!-- Prompt lines -->

  <trigger
   enabled="y"
   match="&lt;*&gt;*"
   send_to="12"
   sequence="100"
  >
  <send>  
  function callmap (...)
    CallPlugin ("99c74b2685e425d3b6ed6a7d", unpack ({ ... }) )
  end -- callmap

  callmap ("set_line_type", "prompt")                     -- this is a prompt
  callmap ("do_not_deduce_line_type", "prompt")           -- so don't deduce prompts
  callmap ("do_not_deduce_line_type", "description")           -- descriptions follow room names
</send>
  </trigger>

<!-- Exit lines -->

  <trigger
   enabled="y"
   match="[Exits: *]"
   match_bold="y"
   match_inverse="y"
   match_italic="y"
   match_text_colour="y"
   send_to="12"
   sequence="100"
   text_colour="15"
  >
  <send>  
  function callmap (...)
    CallPlugin ("99c74b2685e425d3b6ed6a7d", unpack ({ ... }) )
  end -- callmap

  callmap ("set_line_type", "exits", "%1")
  callmap ("do_not_deduce_line_type", "exits")
  callmap ("do_not_deduce_line_type", "description")
</send>
  </trigger>
</triggers>
Australia Forum Administrator #7

It looks like I should have re-read the first posts in this thread first. :)

The “kxwt_” messages make mapping much more reliable. You need to turn it on:

 set kxwt on

Then the kxwt messages (which are omitted from output) give you a vnum and room description.

Then use the triggers below, instead of the ones in my previous post.

See http://www.gammon.com.au/pasting for how to copy from below and paste into your world file.

<triggers>

<!-- kxwt messages -->

  <trigger
   custom_colour="2"
   enabled="y"
   match="^kxwt_([a-zA-Z]+)( .*)?$"
   omit_from_output="y"
   regexp="y"
   send_to="12"
   sequence="1"
  >
  <send>

local command = "%1"
local params = Trim ("%2")

function callmap (...)
  check (CallPlugin ("99c74b2685e425d3b6ed6a7d", unpack ({ ... }) ))
end -- callmap

-- vnum
if command == "rvnum" then
  vnum = string.match (params, "^(%d+)")  -- not local, save for later
  if vnum then
    callmap ("deduce_line_type", "description")      -- start deducing descriptions
    callmap ("deduce_line_type", "room_name")        -- start deducing room names
  end
  return

-- room short description
elseif command == "rshort" then
  callmap ("set_line_type_contents", "room_name", params)
  return

-- area name
elseif command == "area" then
  local areanumber, areaname = string.match (params, "^(%d+) (.*)$")
  if areanumber and vnum and areaname then
    callmap ("set_area_name", areaname)
    -- UID is unique if you use the area number and the room number
    callmap ("set_uid", areanumber .. "/" .. vnum)  -- see: http://www.gammon.com.au/forum/?id=14420
  end -- if
  return
end -- if

  </send>
  </trigger>

<!-- Room names -->

  <trigger
   back_colour="8"
   bold="y"
   enabled="y"
   keep_evaluating="y"
   match="*"
   match_back_colour="y"
   match_bold="y"
   match_inverse="y"
   match_italic="y"
   match_text_colour="y"
   send_to="12"
   sequence="100"
   text_colour="15"
  >
  <send>  function callmap (...)
    check (CallPlugin ("99c74b2685e425d3b6ed6a7d", unpack ({ ... }) ))
  end -- callmap

  callmap ("set_line_type", "room_name")     -- this is a room name
  callmap ("do_not_deduce_line_type", "room_name") -- so don't try to deduce them
  callmap ("deduce_line_type", "description")      -- start deducing descriptions
</send>
  </trigger>

<!-- Prompts -->

  <trigger
   enabled="y"
   match="&lt;*&gt;*"
   send_to="12"
   sequence="100"
  >
  <send>  
  function callmap (...)
    check (CallPlugin ("99c74b2685e425d3b6ed6a7d", unpack ({ ... }) ))
  end -- callmap

  callmap ("set_line_type", "prompt")                     -- this is a prompt
  callmap ("do_not_deduce_line_type", "prompt")           -- so don't deduce prompts
  callmap ("do_not_deduce_line_type", "description")           -- descriptions follow room names
</send>
  </trigger>

<!-- Exits -->


  <trigger
   enabled="y"
   match="[Exits: *]"
   match_bold="y"
   match_inverse="y"
   match_italic="y"
   match_text_colour="y"
   send_to="12"
   sequence="100"
   text_colour="15"
  >
  <send>  
  function callmap (...)
    check (CallPlugin ("99c74b2685e425d3b6ed6a7d", unpack ({ ... }) ))
  end -- callmap

  callmap ("set_line_type", "exits", "%1")
  callmap ("do_not_deduce_line_type", "exits")
  callmap ("do_not_deduce_line_type", "description")
</send>
  </trigger>
</triggers>