Yet another mapper thread. Almost got it.

Posted by Engvar on Thu 11 Apr 2019 11:04 PM — 24 posts, 73,457 views.

#0
After a month of working on the basics of triggers, and realizing why I changed majors after one semester, I'm getting so close to getting a mapper working on the mud I'm playing.

I've abandoned creating unique room id's by using the room name and description, because I talked to the IMM's and they agreed to add VNUM as a prompt option! Progress!

I also found someone making a mapper with Nick that looked like it would be VERY similar to what I needed, so I've been working on adapting it. The mapper in question is the Inquisition_Mapper.
https://www.gammon.com.au/forum/bbshowpost.php?id=14139&page=2

I started it up, got it to match on my prompt for the VNUM, and it started mapping! Then I tried getting it to match for the room name, I broke it somehow, and even when I started completely over I can't seem to get it working again. So here I am, hoping for some spark of inspiration.

Here's what I'm trying to match from:
Quote:

A Small Immaculate Temple
This room holds a serene and peaceful look. The white walls stand unblemished
but for the gentle articulate carvings within their surfaces. A neat altar
stands at the southern end of the room, raised on a few steps. There are no
particular markings anywhere within the temple that would indicate which of
the gods the altar represents, although the white setting in which it stands
would give some sort of indication that it stands not for a god of the dark or
death. To the north stands an archway, the only entrance or exit to the small
temple, which leads to the rotunda.


[Exits: north]
(Golden Aura) Ryzfur is here.
(Charmed) A brawny black bear cub paws at the ground, snuffling.
(Pink Aura) (Golden Aura) (White Aura) Gwyn the Exemplar of Guile, Champion of the Crusade is here.

<1738/1738Hp 1752/1752Mn 622/622Mv | 52G 412S |84/205W| | Irlandia Castle | V2330>


The Triggers:

The room name, in this room "A Small Immaculate Temple", is always in bold white on black. The only other things I've found with that font are down by the players. "(White Aura)", and "(Charmed)" are both tags that are in the same font. I have to trigger on bold white on black, excluding those options. I also just copied this one in to the weather line, since this mud doesn't have a weather line, and it seems to be used for capturing the description somehow.


<trigger
   back_colour="8"
   enabled="y"
   match="^(?!\(White Aura\)|\(Charmed\))*$"
   match_back_colour="y"
   match_text_colour="y"
   script="got_room_name"
   text_colour="15"
   keep_evaluating="y"
   sequence="90"
   regexp="y"
   bold="y"
   match_bold="y"
   name="room_name"
  >
  </trigger>


Next up is the prompt. I have a feeling that the vertical bars are screwing this up, but it works for the healthbar plugin, so I'm trying for it. Further down in the plugin is a spot where you change the number to what place your vnum wildcard is. I adjusted it to [8].


<triggers>
  <trigger
   enabled="y"
   match="^\<(\d+)\s*\/(\d+)\s*Hp (\d+)\s*\/(\d+)\s*Mn (\d+)\s*\/(\d+)\s*Mv*V*>"
   script="got_prompt"
   sequence="100"
   name="prompt"
   keep_evaluating="y"
  >
  </trigger>


After that is the exits line. On the mud I'm playing, it changes color for day/night, so I was just trying to text match it.


<trigger
   back_colour="8"
   enabled="y"
   match="[Exits:*]"
   match_back_colour="y"
   match_bold="n"
   match_inverse="n"
   match_italic="n"
   match_text_colour="n"
   script="got_exits"
   sequence="100"
   text_colour="14"
  >
  </trigger>



Now after all this, I'm not getting anything on the map. I am getting this after my exits line though.
Quote:

Run-time error
Plugin: Inquisition_Mapper (called from world: GameName)
Function/Sub: got_exits called by trigger
Reason: processing trigger "" when matching line: "[Exits: north]"
[string "Plugin: Inquisition_Mapper"]:235: bad argument #1 to 'concat' (table expected, got nil)
stack traceback:
[C]: in function 'concat'
[string "Plugin: Inquisition_Mapper"]:235: in function <[string "Plugin: Inquisition_Mapper"]:231>


Any idea where I've gone wrong?
Amended on Thu 11 Apr 2019 11:07 PM by Engvar
USA Global Moderator #1
I see
Quote:
Function/Sub: got_exits called by trigger
Reason: processing trigger "" when matching line: "[Exits: north]"


So I go and look at the got_exits function in the plugin file and I find that it does

room_description = Trim (table.concat (description, "\n"))


Your error message said:
Quote:
bad argument #1 to 'concat' (table expected, got nil)

So the first argument given to table.concat is nil when it expects to get a table. The first argument is
description
so the problem is that your description variable hasn't been set.

I see that the description variable is set in a function called got_description_line which is run by the trigger called description_line which is enabled in a function called got_weather_line which is run by a trigger called weather_line. Do you have a weather line like that plugin expects? If not, you'll need a different set of triggers for getting the room description.
Amended on Thu 11 Apr 2019 11:12 PM by Fiendish
#2
I can't for the life of me figure out how it gets the room description, and it DID work at one point without anything except the vnum being captured, so that boggles me even more. Here's all the triggers that I'm working with.


<triggers>
  <trigger
   enabled="y"
   match="^\<(\d+)\s*\/(\d+)\s*Hp (\d+)\s*\/(\d+)\s*Mn (\d+)\s*\/(\d+)\s*Mv*V*>"
   script="got_prompt"
   sequence="100"
   name="prompt"
   keep_evaluating="y"
  >
  </trigger>


<trigger
   back_colour="8"
   enabled="y"
   match="^(?!\(White Aura\)|\(Charmed\))*$"
   match_back_colour="y"
   match_text_colour="y"
   script="got_room_name"
   text_colour="15"
   keep_evaluating="y"
   sequence="90"
   regexp="y"
   bold="y"
   match_bold="y"
   name="room_name"
  >
  </trigger>

<trigger
   back_colour="8"
   enabled="y"
   match="^(?!\(White Aura\)|\(Charmed\))*$"
   match_back_colour="y"
   match_text_colour="y"
   script="got_room_name"
   text_colour="15"
   keep_evaluating="y"
   sequence="90"
   regexp="y"
   bold="y"
   match_bold="y"
   name="weather_line"
  >
  </trigger>

<trigger
   back_colour="8"
   enabled="y"
   match="[Exits:*]"
   match_back_colour="y"
   match_bold="n"
   match_inverse="n"
   match_italic="n"
   match_text_colour="n"
   script="got_exits"
   sequence="100"
   text_colour="14"
  >
  </trigger>

  <trigger
   enabled="n"
   match="*"
   script="got_description_line"
   sequence="200"
   name="description_line"
  >
  </trigger>


I thought maybe the description line trigger was somehow getting what was between the weather line and the exit line, so without the weather line substituting the room name should(?) work.
USA Global Moderator #3
Quote:
I thought maybe the description line trigger was somehow getting what was between the weather line and the exit line, so without the weather line substituting the room name should(?) work.

Yes. It basically just marks the start of the room description for that particular MUD. Any other marker for the start of the description will work just as well.
USA Global Moderator #4
This assumes that you actually care about storing the room description in the mapper. If you don't, then you could just delete the offending line of code and I think it will just work without having descriptions.
#5
Ok, I tried deleting the weather trigger and the room description trigger. Still getting this after the [Exits: ] line on the first room after reloading the plugin.

Quote:

Run-time error
Plugin: Inquisition_Mapper (called from world: GameName)
Function/Sub: got_exits called by trigger
Reason: processing trigger "" when matching line: "[Exits: south]"
[string "Plugin: Inquisition_Mapper"]:235: bad argument #1 to 'concat' (table expected, got nil)
stack traceback:
[C]: in function 'concat'
[string "Plugin: Inquisition_Mapper"]:235: in function <[string "Plugin: Inquisition_Mapper"]:231>


On subsequent rooms I get:
Quote:

Trigger function "got_exits" not found or had a previous error.
USA Global Moderator #6
Ah. I didn't mean to delete the triggers. I meant to delete just the line that says
room_description = Trim (table.concat (description, "\n"))

Leave everything else as it was before.
Amended on Fri 12 Apr 2019 02:22 AM by Fiendish
#7
Ok, put the triggers back in, took that line out, and now I get no errors at least, but still nothing on the map. It's killing me, if I'd been ok without room names, it worked before. He's what I see with Trace on.

Quote:

The Rising End of a Damaged Pier
Rotting fragments of the old pier stick out from between the smooth rocks of
this pier as they rise upward to the north, preventing furture travel. Loops
of drying seaweed hang on the blackened rocks, some of which have cracked from
the immense heat of the catastrophe. To the west, an opening in the wall of a
dilapidated structure has been patched with a scavenged door wedged into the
slot. The fetid smell of intermingled ash, brine, and decay hang in the air
despite the relentless ocean winds from the east. The pier continues
southward toward the remains of the boardwalk and the wreck of a boat.


[Exits: south west]
TRACE: Matched trigger "[Exits:*]"
TRACE: Executing trigger script "got_exits"
(Magical) A fount of clean water flows freely here.
Flimsy cloth and canvas tents line the street here, threatening to topple.
Ryzfur is here, floating in the air.
Thasyl is here.

<1773/1773Hp 1698/1739Mn 649/651Mv | 54G 953S |90/205W| | Ruins of Lords | V1944>
TRACE: Matched trigger InfoBar
TRACE: Matched trigger "^\<(\d+)\s*\/(\d+)\s*Hp (\d+)\s*\/(\d+)\s*Mn (\d+)\s*\/(\d+)\s*Mv "
TRACE: Executing trigger script "DoPrompt"
TRACE: Executing trigger script "do_prompt"


It doesn't look like it's matching on the room name for some reason though. A test trigger that's got an identical target hits it though.

It also doesn't seem to be picking up my prompt. This is the trigger I have for the prompt at the moment.


<triggers>
  <trigger
   enabled="y"
   match="^\<(\d+)\s*\/(\d+)\s*Hp (\d+)\s*\/(\d+)\s*Mn (\d+)\s*\/(\d+)\s*Mv*V*>"
   script="got_prompt"
   sequence="100"
   name="prompt"
   keep_evaluating="y"
  >
  </trigger>


And I have the target for the vnum as wildcard 8. Did I not format correctly to find the vnum?
Amended on Fri 12 Apr 2019 02:42 AM by Engvar
USA Global Moderator #8
Quote:
This is the trigger I have for the prompt at the moment

That is a weird mixture of regex but is not marked as a regex trigger. It definitely won't work.


Quote:
TRACE: Matched trigger "^\<(\d+)\s*\/(\d+)\s*Hp (\d+)\s*\/(\d+)\s*Mn (\d+)\s*\/(\d+)\s*Mv "

Suggests that something is matching your prompt. Why not make your bad trigger match the good one?
Amended on Fri 12 Apr 2019 03:04 AM by Fiendish
#9
That was the healthbar plugin that was matching on the prompt. All I did to get the trigger target I'm using is take what was in it when I installed the plugin, then move that and add the Vnum that I added to the prompt.

Healthbar

^\<(\d+)\s*\/(\d+)\s*Hp (\d+)\s*\/(\d+)\s*Mn (\d+)\s*\/(\d+)\s*Mv


Mapper

^\<(\d+)\s*\/(\d+)\s*Hp (\d+)\s*\/(\d+)\s*Mn (\d+)\s*\/(\d+)\s*Mv*V*>


The only thing I changed was adding "*V*>" to the end in order to capture the vnum at the end of the prompt.
Australia Forum Administrator #10
Yes, but you didn't tell the client that rather complicated sequence was a regexp. Thus it tries to match it literally.

It would be good to see:


  regexp = "y"


... in the trigger.
Amended on Fri 12 Apr 2019 05:53 AM by Nick Gammon
#11
Ok, I changed the target for the prompt so something less complicated that I think should still work. Here's what my triggers look like now.


<triggers>
  <trigger
   enabled="y"
   match="<*Hp * V*>"
   script="got_prompt"
   sequence="100"
   name="prompt"
   keep_evaluating="y"
  >
  </trigger>

<trigger
   back_colour="8"
   enabled="y"
   match="^(?!\(White Aura\)|\(Charmed\)|You).*$"
   match_back_colour="y"
   match_text_colour="y"
   script="got_room_name"
   text_colour="15"
   keep_evaluating="y"
   sequence="90"
   regexp="y"
   bold="y"
   match_bold="y"
   name="room_name"
  >
  </trigger>

<trigger
   back_colour="8"
   enabled="y"
   match="^(?!\(White Aura\)|\(Charmed\)|You).*$"
   match_back_colour="y"
   match_text_colour="y"
   script="got_weather_line"
   text_colour="15"
   keep_evaluating="y"
   sequence="90"
   regexp="y"
   bold="y"
   match_bold="y"
   name="weather_line"
  >
  </trigger>

<trigger
   back_colour="8"
   enabled="y"
   match="[Exits: * ]"
   match_back_colour="y"
   match_bold="n"
   match_inverse="y"
   match_italic="y"
   match_text_colour="n"
   script="got_exits"
   sequence="100"
   text_colour="14"
  >
  </trigger>

  <trigger
   enabled="n"
   match="*"
   script="got_description_line"
   sequence="200"
   name="description_line"
  >
  </trigger>


And now here's what I'm getting when I turn on trace. It looks like it's at least triggering on everything. I'm not sure what the run-time errors are indicating though.

Quote:

Shrine to Mercy and Deliverance
TRACE: Matched trigger weather_line
TRACE: Matched trigger room_name
TRACE: Executing trigger script "got_weather_line"
TRACE: Executing trigger script "got_room_name"
Run-time error
Plugin: Inquisition_Mapper (called from world: GameName)
Function/Sub: got_room_name called by trigger
Reason: processing trigger "room_name" when matching line: "Shrine to Mercy and Deliverance"
[string "Plugin: Inquisition_Mapper"]:217: attempt to get length of local 'name' (a nil value)
stack traceback:
[string "Plugin: Inquisition_Mapper"]:217: in function <[string "Plugin: Inquisition_Mapper"]:213>
A sweet, soporific scent lingers upon the air within this shrine, the calming
TRACE: Matched trigger description_line
TRACE: Executing trigger script "got_description_line"
smell drifting from the riots of fresh red and purple poppies that completely
TRACE: Matched trigger description_line
TRACE: Executing trigger script "got_description_line"
blanket the floor. Wide chevrons of vivid red ibha decorate the dark stone
TRACE: Matched trigger description_line
TRACE: Executing trigger script "got_description_line"
walls of the shrine. The gems glimmer in the soft, flickering candlelight of
TRACE: Matched trigger description_line
TRACE: Executing trigger script "got_description_line"
braun sconces ringing the room. The glass-smooth domed ceiling reflects hazy
TRACE: Matched trigger description_line
TRACE: Executing trigger script "got_description_line"
images of the blooms on the ground and curves to a sharp point at the center.
TRACE: Matched trigger description_line
TRACE: Executing trigger script "got_description_line"
Two oversized misericorde daggers cross above the archway to the south, their
TRACE: Matched trigger description_line
TRACE: Executing trigger script "got_description_line"
blades flecked with dried red blood.
TRACE: Matched trigger description_line
TRACE: Executing trigger script "got_description_line"
TRACE: Matched trigger description_line
TRACE: Executing trigger script "got_description_line"

[Exits: south]
(Glowing) A poppy-shaped braun pedestal holds a book on its open petals here.

<1738/1738Hp 1730/1752Mn 622/622Mv | 54G 903S |89/205W| | City of the Gods | V862>
TRACE: Matched trigger prompt
TRACE: Executing trigger script "got_prompt"
Run-time error
Plugin: Inquisition_Mapper (called from world: GameName)
Function/Sub: got_prompt called by trigger
Reason: processing trigger "prompt" when matching line: "<1738/1738Hp 1730/1752Mn 622/622Mv | 54G 903S |89/205W| | City of the Gods | V862>"
[string "Plugin: Inquisition_Mapper"]:170: bad argument #2 to 'format' (string expected, got nil)
stack traceback:
[C]: in function 'format'
[string "Plugin: Inquisition_Mapper"]:170: in function <[string "Plugin: Inquisition_Mapper"]:162>
USA Global Moderator #12
Interpreting error messages is the most important skill a programmer can have.

Let's start with
Quote:

Function/Sub: got_room_name called by trigger
Reason: processing trigger "room_name" when matching line: "Shrine to Mercy and Deliverance"
[string "Plugin: Inquisition_Mapper"]:217: attempt to get length of local 'name' (a nil value)


Your room_name trigger calls a function named got_room_name. Does your got_room_name function populate the name variable before trying to find its length? It sounds like the answer is no.
Amended on Sat 13 Apr 2019 03:34 PM by Fiendish
#13
Here's what it has at the moment.


-- Here on room name
-- -----------------------------------------------------------------
function got_room_name (name, line, wildcards)
  local name = wildcards [1]

  -- ignore really long lines
  if #name > 60 then
    return
  end -- if

  room_name = name
  current_exits = nil
  description = { }
  room_description = nil

end -- got_room_name
Amended on Sat 13 Apr 2019 04:00 PM by Engvar
USA Global Moderator #14
Here's an experiment for you to run:

On the first line of your function, right after the line that says
function got_room_name (name, line, wildcards)
Insert
require "tprint"
print("MY WILDCARDS ARE")
tprint(wildcards)


Also inspect your room name trigger pattern to see if it matches and captures what you think it should.
Amended on Sat 13 Apr 2019 04:05 PM by Fiendish
#15
Ok, I inserted it and this is what it shows now when I use the 'look' command.

Quote:

Shrine to Mercy and Deliverance
MY WILDCARDS ARE
0="Shrine to Mercy and Deliverance"
Run-time error
Plugin: Inquisition_Mapper (called from world: GameName)
Function/Sub: got_room_name called by trigger
Reason: processing trigger "room_name" when matching line: "Shrine to Mercy and Deliverance"
[string "Plugin: Inquisition_Mapper"]:220: attempt to get length of local 'name' (a nil value)
stack traceback:
[string "Plugin: Inquisition_Mapper"]:220: in function <[string "Plugin: Inquisition_Mapper"]:213>
A sweet, soporific scent lingers upon the air within this shrine, the calming
smell drifting from the riots of fresh red and purple poppies that completely
blanket the floor. Wide chevrons of vivid red ibha decorate the dark stone
walls of the shrine. The gems glimmer in the soft, flickering candlelight of
braun sconces ringing the room. The glass-smooth domed ceiling reflects hazy
images of the blooms on the ground and curves to a sharp point at the center.
Two oversized misericorde daggers cross above the archway to the south, their
blades flecked with dried red blood.


[Exits: south]
(Glowing) A poppy-shaped braun pedestal holds a book on its open petals here.

<1728/1728Hp 1722/1722Mn 622/622Mv | 54G 903S |89/205W| | City of the Gods | V862>
Run-time error
Plugin: Inquisition_Mapper (called from world: GameName)
Function/Sub: got_prompt called by trigger
Reason: processing trigger "prompt" when matching line: "<1728/1728Hp 1722/1722Mn 622/622Mv | 54G 903S |89/205W| | City of the Gods | V862>"
[string "Plugin: Inquisition_Mapper"]:107: bad argument #2 to 'format' (string expected, got nil)
stack traceback:
[C]: in function 'format'
[string "Plugin: Inquisition_Mapper"]:107: in function 'supplied_get_room'
...Users\Anschutz\Desktop\CoM\MUSHclient\lua\mapper.lua:219: in function 'get_room'
...Users\Anschutz\Desktop\CoM\MUSHclient\lua\mapper.lua:937: in function 'draw'
[string "Plugin: Inquisition_Mapper"]:203: in function <[string "Plugin: Inquisition_Mapper"]:162>


I also set up a simple trigger for the room name that just output the name again right below it, and it seems to be capturing it correctly.


<triggers>
  <trigger
   back_colour="8"
   bold="y"
   enabled="y"
   match="^(?!\(White Aura\)|\(Charmed\)|You).*$"
   match_back_colour="y"
   match_bold="y"
   match_inverse="y"
   match_italic="y"
   match_text_colour="y"
   regexp="y"
   send_to="2"
   sequence="100"
   text_colour="15"
  >
  <send>%0</send>
  </trigger>
</triggers>


Quote:

Shrine to Mercy and Deliverance
Shrine to Mercy and Deliverance
A sweet, soporific scent lingers upon the air within this shrine, the calming
smell drifting from the riots of fresh red and purple poppies that completely
blanket the floor. Wide chevrons of vivid red ibha decorate the dark stone
walls of the shrine. The gems glimmer in the soft, flickering candlelight of
braun sconces ringing the room. The glass-smooth domed ceiling reflects hazy
images of the blooms on the ground and curves to a sharp point at the center.
Two oversized misericorde daggers cross above the archway to the south, their
blades flecked with dried red blood.


[Exits: south]
(Glowing) A poppy-shaped braun pedestal holds a book on its open petals here.

<1738/1738Hp 1752/1752Mn 622/622Mv | 54G 903S |89/205W| | City of the Gods | V862>
#16
This is the error I'm getting after the room name.

Quote:

Run-time error
Plugin: Inquisition_Mapper (called from world: GameName)
Function/Sub: got_room_name called by trigger
Reason: processing trigger "room_name" when matching line: "At the End of the Northern Road"
[string "Plugin: Inquisition_Mapper"]:217: attempt to get length of local 'name' (a nil value)
stack traceback:
[string "Plugin: Inquisition_Mapper"]:217: in function <[string "Plugin: Inquisition_Mapper"]:213>


And then one after the prompt line.

Quote:

Run-time error
Plugin: Inquisition_Mapper (called from world: GameName)
Function/Sub: got_room_name called by trigger
Reason: processing trigger "room_name" when matching line: "At the End of the Northern Road"
[string "Plugin: Inquisition_Mapper"]:217: attempt to get length of local 'name' (a nil value)
stack traceback:
[string "Plugin: Inquisition_Mapper"]:217: in function <[string "Plugin: Inquisition_Mapper"]:213>


I made another trigger to grab the vnum and repeat it back in the output window, and it seems to be targeting correctly on that also.
USA Global Moderator #17
So if your new print statements show that the room name is wildcard 0 and that there's no wildcard 1, why do you have

local name = wildcards[1]

in your got_room_name function?
Amended on Sat 13 Apr 2019 06:11 PM by Fiendish
#18
I changed it and it worked! I walked around and it mapped a couple dozen rooms. Got room names and descriptions, and even walked to the room when I clicked it!

Then it broke again... I haven't changed anything, just reinstalled it, but I'm still getting this message now, no more map.

Quote:

Run-time error
Plugin: Inquisition_Mapper (called from world: GameName)
Function/Sub: got_prompt called by trigger
Reason: processing trigger "prompt" when matching line: "<1738/1738Hp 1752/1752Mn 308/622Mv | 4G 1224S |90/205W| | Serian Center Square | V5810>"
[string "Plugin: Inquisition_Mapper"]:170: bad argument #2 to 'format' (string expected, got nil)
stack traceback:
[C]: in function 'format'
[string "Plugin: Inquisition_Mapper"]:170: in function <[string "Plugin: Inquisition_Mapper"]:162>


It did that when I got back to an area that I had it working in once before. I understand that it's storing the map in a different file, is it possible that it had a problem with there already being something there?

I went back to a new area and reinstalled and it worked again. Walked back up and it linked the map together. Then I hit a room and it closed the map and gave me this error.

Quote:

Run-time error
Plugin: Inquisition_Mapper (called from world: GameName)
Function/Sub: got_prompt called by trigger
Reason: processing trigger "prompt" when matching line: "<1738/1738Hp 1752/1752Mn 611/622Mv | 4G 1224S |90/205W| | Northern Road | V4367>"
[string "Plugin: Inquisition_Mapper"]:107: bad argument #2 to 'format' (string expected, got nil)
stack traceback:
[C]: in function 'format'
[string "Plugin: Inquisition_Mapper"]:107: in function 'supplied_get_room'
...Users\Anschutz\Desktop\CoM\MUSHclient\lua\mapper.lua:219: in function 'get_room'
...Users\Anschutz\Desktop\CoM\MUSHclient\lua\mapper.lua:591: in function 'draw_room'
...Users\Anschutz\Desktop\CoM\MUSHclient\lua\mapper.lua:989: in function 'draw'
[string "Plugin: Inquisition_Mapper"]:203: in function <[string "Plugin: Inquisition_Mapper"]:162>
Amended on Sat 13 Apr 2019 06:23 PM by Engvar
#19
It seems to always go down at the same spot, but I'm not sure why.

Quote:

MUSHclient mapper installed, version 2.6
Mapper plugin 'save state' file name is:
.\worlds\plugins\state\601e886123571f750e3774a3-2a5655924080806ca252f1e6-state.xml
Consider backing up the above file regularly as it has the mapper database in it.
Reinstalled plugin Inquisition_Mapper (2a5655924080806ca252f1e6)
You take a moment to look at your immediate surroundings.

Along the Northern Road
As the forest slowly thins out to the west in the distance, the sight of a
majestic and snowy mountain range can clearly be seen towering in the horizon.
There seems to be no passable trail to reach these mountains at this section
of the road but one can be seen faintly off towards the south. To the east of
the road, the plains begin to form into soft and rolling hills that carry
grass on their backs like hair. The grass doesn't seem as green here as it
does to the south for the cold climate here hampers its growth. To the north
and south, the northern road goes on.


[Exits: north south]
(Charmed) A brawny black bear cub paws at the ground, snuffling.

<1738/1738Hp 1752/1752Mn 620/622Mv | 4G 1224S |90/205W| | Northern Road | V4365>
Along the Northern Road
The northern road heads on here through the rolling, green hills to the west
and the snowy, mountain range to the east. Although not snowy here, a cold
air comes in to the east from the frozen mountains that tower very far in the
distance. Even at their distance, the eastern mountains can clearly be seen
with their snow-capped peaks and the frozen tundra around them. One mountain
in particular stands tall above the rest although it is somewhat set apart
from the others. The northern road continues on towards the north while
retreating south as well.


[Exits: north south]
A brawny black bear cub has arrived from the south.

<1738/1738Hp 1752/1752Mn 619/622Mv | 4G 1224S |90/205W| | Northern Road | V4366>
Along the Northern Road
Scattered forest accompanies the northern road to its eastern side. Grass
covers the land between the trees although it is starting to thin due to the
colder temperature here in northern Alandis. Far beyond these random trees
and light grass lies the outline of a mountain range covered in snow and ice.
To the west lies a somewhat warmer land with green hills of grass passing
softly across the horizon. Heading north and south, the road presses its dirt
trail on.


[Exits: north south]
A brawny black bear cub has arrived from the south.

<1738/1738Hp 1752/1752Mn 618/622Mv | 4G 1224S |90/205W| | Northern Road | V4367>
Run-time error
Plugin: Inquisition_Mapper (called from world: GameName)
Function/Sub: got_prompt called by trigger
Reason: processing trigger "prompt" when matching line: "<1738/1738Hp 1752/1752Mn 618/622Mv | 4G 1224S |90/205W| | Northern Road | V4367>"
[string "Plugin: Inquisition_Mapper"]:107: bad argument #2 to 'format' (string expected, got nil)
stack traceback:
[C]: in function 'format'
[string "Plugin: Inquisition_Mapper"]:107: in function 'supplied_get_room'
...Users\Anschutz\Desktop\CoM\MUSHclient\lua\mapper.lua:219: in function 'get_room'
...Users\Anschutz\Desktop\CoM\MUSHclient\lua\mapper.lua:591: in function 'draw_room'
...Users\Anschutz\Desktop\CoM\MUSHclient\lua\mapper.lua:989: in function 'draw'
[string "Plugin: Inquisition_Mapper"]:203: in function <[string "Plugin: Inquisition_Mapper"]:162>


Works until I get to that area. Then I get that error and it closes the map.
#20
I think I've figured it out. I found where the maps were saved in the state file. Deleted those and had it start over, and it's letting me go everwhere at the moment.

Thank you so much for all your help!
USA Global Moderator #21
Awesome.
Just in case you need to come back again, I find that it's always a good idea to dig into exactly what the error message is telling you before trying to figure out what might have caused it holistically.

In this case:
Quote:
Function/Sub: got_prompt called by trigger
Reason: processing trigger "prompt" when matching line: "<1738/1738Hp 1752/1752Mn 618/622Mv | 4G 1224S |90/205W| | Northern Road | V4367>"
[string "Plugin: Inquisition_Mapper"]:107: bad argument #2 to 'format' (string expected, got nil)

Means that in your got_prompt function you called string.format and it expected the second value given to it to be a string but the second value was actually nil. You should trace backward to figure out _why_ the second argument was nil and not a string as expected.

I'll drop a quote here from a book titled Think Like a Programmer: An Introduction to Creative Problem Solving by V. Anton Spraul

Quote:
In some situations, borrowed code will work initially, but when the programmer attempts to modify or expand the borrowed code base, the lack of deep comprehension removes the possibility of an organized approach. The programmer then resorts to flailing about and trial and error, thus violating the first and most important of our general problem-solving rules: Always have a plan.
Amended on Sun 14 Apr 2019 11:43 AM by Fiendish
Australia Forum Administrator #22
You know, I've put a considerable amount of effort into making the error messages useful.


Function/Sub: got_prompt called by trigger
Reason: processing trigger "prompt" when matching line: "<1738/1738Hp 1752/1752Mn 618/622Mv | 4G 1224S |90/205W| | Northern Road | V4367>"
[string "Plugin: Inquisition_Mapper"]:107: bad argument #2 to 'format' (string expected, got nil)


So what's this telling us?

  • The problem starts off with a trigger
  • The function the trigger calls is "got_prompt"
  • The trigger is named "prompt"
  • The line it is matching on (<1738/1738Hp 1752/1752Mn 618/622Mv | 4G 1224S |90/205W| | Northern Road | V4367>)
  • What plugin processed this trigger (Inquisition_Mapper)
  • What line in the plugin (script) it was (107)
  • What the problem was (bad argument to the format function)
  • Which argument it was (2)
  • What the function expected (a string)
  • What it got (nil)


This is pure gold. It tells you where to start looking, and what to look for.

Compare this to some of the web sites I have visited. You try to buy something and you get a dialog box "An error has occurred".

You aren't sure if:

  • You made some error in what you entered (eg. dates the wrong way around)
  • Your credit card has been charged (so if you try again you will be charged twice).
  • The order has been processed but there is a problem with shipping.
  • The order will be shipped but there is a problem telling you that.
  • Some other problem ... what?


I get that it is frustrating when things don't work, but those error messages (complex though they look) are your friends. Interpret them and you will be able to fix the problem, or at least narrow it down.
Amended on Sun 14 Apr 2019 08:18 AM by Nick Gammon
#23
Fiendish, you're absolutely correct. I do intend to get to the point where I'm able to figure out what the error messages are pointing me to. I hope I haven't been annoying you here, but I've learned an incredible amount from you in this thread about troubleshooting. I really can't thank you enough.

Nick, I cannot express how much I appreciate how much work you've put into this to make it as easy as possible for beginners. I'm slow going, I only get a couple hours a week to work on this, but your documentation has helped tremendously. I'm saving this breakdown of the error messages to use in the future. I didn't know what everything in them meant (still don't fully, but that's because I'm new to a lot of the terminology) and couldn't understand what it was pointing me to.

The last time I did anything remotely like this was learning HTML back in high school 15 years ago. If they had half the documentation you have I may have stuck with it. As it is, I'm really enjoying learning it, and I'm proud of what I've learned so far.

The game I'm working on this for only has 3 active staff members, and only one of them has programming experience. The other two are strictly RP staff. We all played the game in high school, and are trying to get it going again. I've been trying to help them come up to date in order to attract some new players, and will hopefully get a link to download MushClient and a package of plugins on the website for new players to use. Just sharing the healthbars you made and the OOC chat window have brought a few people back, and having a map is by far the biggest request. This game was a huge part of my growing up, I don't want to see if fade away.

I guess what I'm getting at is that I'm sorry if I came across as frustrated, but I guarantee that the frustration I had was with me and not with your work. I am nothing but appreciative for the work you've put into this, because I would have no chance of getting these things accomplished from scratch with the time I have available, and my lack of experience. Thank you.