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 ➜ General ➜ What do I need to learn to be able to adapt an automapper?

What do I need to learn to be able to adapt an automapper?

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


Posted by Engvar   (24 posts)  Bio
Date Sun 24 Feb 2019 11:03 PM (UTC)
Message
I'm trying to adapt the mapper plugin that I found here for a MUD that I'm playing that doesn't currently have one available to players.

https://github.com/nickgammon/plugins/blob/master/Lands_Of_Redemption_Mapper.xml

This is the one that I found closest to the one I'm trying to get it to work for. There are no available VNUMS for players, and this one is in the same boat. It says it checks for room name and description, hashes those to create a unique room ID, and then adds exits.

Here's what it looks like in the one I want it to work for.

https://imgur.com/a/Sm5OGzr

I've managed to adapt the healthbar plugin to read my prompt, and I've gotten a floating OOC chat window to work wonderfully. This one is much harder to adapt though, and I'm missing some of the basics to be able to adapt it.

I want to be able to do this, but I'm honestly not sure where to start.
Top

Posted by Fiendish   USA  (2,555 posts)  Bio   Global Moderator
Date Reply #1 on Tue 26 Feb 2019 03:48 PM (UTC)

Amended on Tue 26 Feb 2019 03:50 PM (UTC) by Fiendish

Message
Quote:
hashes those to create a unique room ID

As long as no two rooms share the same name+description+exits, anyway.

The fundamental basic components needed to make that plugin work are your prompt, the room name, room description, room exits line. You have to figure out how to reliably capture those with triggers. It also needs all of the messages displayed when a movement fails for any reason. (Those go into the table marked with "-- put messages from the MUD which stop you moving here")

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #2 on Tue 26 Feb 2019 08:51 PM (UTC)
Message

Have you read this post?

That describes what the mapper needs.

As Fiendish said, you basically need to identify:

  • When you change rooms (so you can redraw the map)
  • A way of uniquely identifying the room, possibly combining the room name and description and then hashing those
  • A way of knowing which way you just went, to change rooms.
  • A way of knowing that when you attempted to change rooms you failed (eg. “That door is locked!”)
  • A way of saving the room database to disk for next time. Possibly use a SQLite3 database, or “serialize” the rooms and exits tables.

- Nick Gammon

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

Posted by Engvar   (24 posts)  Bio
Date Reply #3 on Tue 26 Feb 2019 10:22 PM (UTC)
Message
That tutorial is actually where I got the Lands of Redemption mapper from.You mentioned it as an example of a MUD without unique room numbers, and it's got very similar layouts to the one I'm trying to use it for. It also seems to have all the same "Can't go that way" messages.

I've played around with it a lot the past few days, and I've managed to get it to draw a room, and pull some data from the game, but I'm still having trouble with getting the correct data.

Since the new room always comes in the same order, if I could get it to recognize the room name, I could possibly have it create a unique ID based on the name and following 3 lines. Every room description is at least 5 lines, and every room has a unique description, though not necessarily a unique name.

Quote:

A Goblin Hut
The walls of the rest of this hut are a dirt brown color, having been made
from mud, clay, sticks and twigs and dried grasses. The roof looks to have
been sloppily put together from large leaves and sticks, and several holes can
be seen within it, protecting little from the outside elements. A strong and
pungent sour smell fills the air here, scents of the collaborative decoration
of waste and refuse collected in the hut. A small bed made of dried leaves
and grass sits along one of the walls, and small beetles and bugs can be found
to be nesting in it as well. Fine goblin squalor decorates this hut with
scattered bones that have been cleaned of their meat and look to have been
gnawed on beyond that. The dirt floor is littered with pieces of garbage and
even a section of feces in one of the corners. A crudely made door in the
eastern wall has many small twigs and grasses branching out from around it,
having not been made with any care at all.


[Exits: east]
A goblin man sits here, wallowing in his filth.
A goblin woman is here, sifting through her rubbish.

<870/870Hp 1162/1162Mn 568/568Mv | 98G 284S |72/205W| | Goblin Village>


My understanding of how the mapper setup works, is that I need to make a trigger that picks up the room name by color, name and next 3 lines would make a unique identifier, and exits by the layout [Exits:*].

Then I think I'm going to have to manually enter info for a room, and it will take it from there?

So I have to learn how to identify by color, and by a line in relation to previous line identified. Unless I'm making this way more complicated than it needs to be.

As a side note, thanks for all the work you two have done. The HP bars plugin I'm using were made by Nick, and the OOC Chat Miniwindow plugin was made by Fiendish. I've been slowly learning to make these things after work the last couple weeks by going through tutorials you two have made. I may not get this one working, but the more non-coder friendly ones make a huge difference.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #4 on Sat 02 Mar 2019 05:32 AM (UTC)
Message

My understanding of how the mapper setup works, is that I need to make a trigger that picks up the room name by color, name and next 3 lines would make a unique identifier, and exits by the layout [Exits:*].

Not necessarily that. Whatever it is that works. I used colour in some cases because the room name was always in a certain colour. Not necessarily 3 lines. When you look at the MUD output you, as a human, can tell, somehow, that you are looking at a room description. You just need to codify that. What is it that you see that tells you that this is a room description? Is it a blank line followed by a short line followed by a lot of lines followed by “Exits:”? Whatever neural process your brain goes through, you need to turn that into code.


- Nick Gammon

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

Posted by Engvar   (24 posts)  Bio
Date Reply #5 on Sat 02 Mar 2019 03:51 PM (UTC)
Message
It seems like color might be out of the question. There's something going on with the colors that I just don't understand.

According to the colors coming from the games 'help ansi' file, the room name is colored "Bright White" and the description is "Clear", which is the default color, and the exit line is "Blue".

I thought maybe this was just a naming difference, and I could figure out the color according to Lua, I'd be able to target it. I tried to highlight "white" text just to see what came back as white, and everything was highlighted.

Back to the drawing board. I found somewhere else on the forums here that someone has made a working one for this game, doesn't have an email listed unfortunately. It looks like they found a way to subtract what line their prompt appeared on from the last prompt appearance. That gave them the start of the room, so they had the line with the room name, then the next couple of lines to create a unique ID.

Back to studying Lua. I'll update when I find a new approach.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #6 on Sun 03 Mar 2019 07:47 PM (UTC)
Message
Regardless of what the MUD calls them you can find the colour (foreground and background) of any character in the output window. In particular using the style runs which are supplied as part of a trigger. See:

http://www.gammon.com.au/forum/?id=7818

This gives you the RGB colours, so that the underlying names don't matter.

As for capturing multiple lines, see:

Template:faq=37 Please read the MUSHclient FAQ - point 37.

- 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.


24,481 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.