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
➜ Miniwindows
➜ Adapting Graphical Automapper (uh oh)
|
Adapting Graphical Automapper (uh oh)
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Death
(55 posts) Bio
|
| Date
| Sat 03 Mar 2018 08:56 PM (UTC) Amended on Sun 04 Mar 2018 05:57 AM (UTC) by Nick Gammon
|
| Message
| Hey guys,
I know you guys don't have time to help write an adaptation of every single mud, so I'm just asking for guidance on matching one part of it.
https://raw.githubusercontent.com/nickgammon/plugins/master/Materia_Magica_Mapper.xml
The code is from above^^^
I don't have a compass on my mud, so I changed HYPHEN_LINE from
<trigger
back_colour="8"
bold="y"
enabled="n"
match="(-------------------------------------------------)*"
match_back_colour="y"
match_bold="y"
match_inverse="y"
match_italic="y"
match_text_colour="y"
name="Hyphen_Line"
script="Hyphen_Line"
sequence="100"
text_colour="12"
>
</trigger>
to match my exits, [Exits: *], just so I don't have to deal with it, at least until I figure out how to make this work. (I know you're going to hate me for that)
Anyways, I'm having issues actually matching the exits.
The original trigger looks to match " Visible Exits: *",
and I've changed it to match my mud, where it might look like this.
The Temple of Krynn
[Exits: north east south west up]
This is the most beautiful Temple you've ever seen, gold and silver
everywhere. A red carpet leads you north towards the Temple altar or south
towards the room of donations. There is an archway to the west. A golden
sign above it simply says, "Incarnations". To your east is a small room with
a staircase leading down. A marble stairway leads up to the streets of
Krynn. There is a small shimmering plaque on the wall.
( 4) A ball of light shines bright
( 2) A long shiny sword has been left here.
( 2) A shiny breastplate has been left here.
A large golden fountain stands in the middle of the room.
(AFK) (Glowing) (Blue Aura) (Translucent) Blackfell is here.
(Glowing) (Slowed) (Blue Aura) (Translucent) The tranquil water dragon Emile Khadaji is here.
(AFK) (Glowing) (Invisible) (Hasted) (Blue Aura) Madcoil says 'AFK!'
(Glowing) (Hasted) (Blue Aura) Djaron guards the Temple with his life.
<4842/5530 hp 2447/2447 m 1927/1927 mv 67528070 xp>
I keep getting the error message "WARNING: I did not see a "Visible Exits:" line.
The mapper will not connect rooms to other rooms without it.
Please turn on the exits by typing:
"
So I know I'm not matching on the exits line, but I'm not sure why.
This is why I need your help.
The original string for matching is:
exits_str = string.gsub (wildcards [1]:lower (), "[()]", "")
I changed it to a few variations, but decided to try:
exits_str = string.match (line, "^Exits: (.*)")
Still no luck. Any chance to help me match my exits so I can get it to link the rooms and work properly?
Thanks for your help, always.
[EDIT] Improved formatting. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Sun 04 Mar 2018 05:58 AM (UTC) |
| Message
| If you are having trouble matching the exits you need to post the exact trigger you are using to do that.
 |
For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.
|
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Death
(55 posts) Bio
|
| Date
| Reply #2 on Sun 04 Mar 2018 07:06 PM (UTC) Amended on Sun 04 Mar 2018 08:39 PM (UTC) by Nick Gammon
|
| Message
| Hey Nick,
I'm currently matching off of this trigger.
<trigger
enabled="y"
match="[Exits: *]"
name="Exits_Line"
script="Exits_Line"
sequence="100"
>
</trigger>
Like I said, the function string is above.
I don't see how I'm not matching.
Again, my room is as follows.
Hannibal Way
[Exits: east south]
The city is in remarkably good shape. The streets and buildings here
have all been restored to their origional condition, and the names of the
streets have even been preserved.
Room name, EXITS, Long description.
So the plugin can still draw every room, but it's not linking them because it's not finding the exits.
What's happening is the map is just redrawing in every room and never linking the rooms. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #3 on Sun 04 Mar 2018 08:45 PM (UTC) |
| Message
| It sounds a bit like you haven't entered that function.
-- -----------------------------------------------------------------
-- 4. Here on exits line
-- -----------------------------------------------------------------
function Exits_Line (name, line, wildcards)
exits_str = string.gsub (wildcards [1]:lower (), "[()]", "")
EnableTrigger ("Exits_Line", false)
got_exits = true
end -- Exits_Line
Can you add a debugging print there please? Eg.
mapper.print "Got exits line"
What you might need to do is enable the exits line in the function Name_Line, because things are being done in a different sequence to Materia Magica.
EnableTrigger ("Exits_Line", true)
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Death
(55 posts) Bio
|
| Date
| Reply #4 on Sun 04 Mar 2018 09:47 PM (UTC) Amended on Mon 05 Mar 2018 02:39 AM (UTC) by Death
|
| Message
| Hey Nick,
I've done the following, as you've said.
-- -----------------------------------------------------------------
-- 1. Here on yellow line - room name
-- -----------------------------------------------------------------
function Name_Line (name, line, wildcards, styles)
if string.match (line, "^%[") then
return
end -- if chat line
got_hyphens = false
roomname = Trim (styles [1].text:sub (1, 50))
roomdesc = ""
exits = {}
exits_str = ""
map_str = ""
got_exits = false
EnableTrigger ("Exits_Line", true)
EnableTrigger ("Hyphen_Line", true)
EnableTrigger ("Other_Line", true)
EnableTrigger ("Name_Line", false)
end -- Name_Line
and here
-- -----------------------------------------------------------------
-- 4. Here on exits line
-- -----------------------------------------------------------------
function Exits_Line (name, line, wildcards)
exits_str = string.gsub (wildcards [1]:lower (), "[()]", "")
mapper.print "Got exits line"
EnableTrigger ("Exits_Line", false)
got_exits = true
end -- Exits_Line
Now I've got
The Temple of Krynn
[Exits: north east south west up]
Got exits line
This is the most beautiful Temple you've ever seen, gold and silver
everywhere. A red carpet leads you north towards the Temple altar or south
towards the room of donations. There is an archway to the west. A golden
sign above it simply says, "Incarnations". To your east is a small room with
a staircase leading down. A marble stairway leads up to the streets of
Krynn. There is a small shimmering plaque on the wall.
in every room, but it's not linking any rooms.
In most cases it's adding rooms to the database, but the exits are either horribly wrong, or when I move rooms again it's not updating at all, and the exits are from the previous room. (I understand you need to walk back and forth to link a room, it doesn't work though)
So, it's still just drawing the room you're in, and that's it. I've tested the plugin on Materia Magica, and it worked perfectly.
There are quite a few rooms with the same NAME and long desc, maybe this is the problem, but I'm in the recall area and it won't draw rooms at all, not even the rooms I'm in. (The recall area should be easy, as it's just like a + sign in design.)
I get the "got exits line" in like every room, but maybe it's not actually getting exits. (Maybe I filled your information in incorrectly)
Could it be my database is already filled with some of these rooms, so it won't draw them again? (This wouldn't be the linking problem, just the refusal to draw maybe?)
I've reinstalled it, and now I'm not matching exits at all anymore... Heh. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #5 on Mon 05 Mar 2018 04:39 AM (UTC) |
| Message
| Hmmm. In the function save_exits_to_database un-comment this line:
mapper.mapprint ("Added unknown exit", dir, "from room", uid, "to database.")
So you should see "added unknown exit" for each exit. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #6 on Mon 05 Mar 2018 05:39 AM (UTC) |
| Message
|
Quote:
There are quite a few rooms with the same NAME and long desc, maybe this is the problem ...
That certainly won't help. Uniquely identifying each room is pretty critical to not having rooms randomly appear to link to somewhere incorrect. If you incorporate the exits themselves into the generated room UID then that may help a bit (the code you linked does that).
Because of the sequence in which things arrive you want to check that the UIDs are as unique as you can make them. That is, don't generate a room UID until you have the short name, long name, exits etc.
If you have lots of rooms with the same name, same description, same exits, well then pfffft! That's a weird MUD.
It would be like going to a city which has all its streets named the same. That is, a stupid city. :) |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #7 on Mon 05 Mar 2018 06:20 AM (UTC) |
| Message
| See: http://www.gammon.com.au/forum/?id=12635
You don't necessarily have to process the Exits line at all. You should be able to deduce where the exits are because you go east from room A and end up in room B. |
- 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.
28,571 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top