Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, 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.
Entire forum
➜ MUSHclient
➜ Plugins
➜ Mapper plugin for Two Towers
Mapper plugin for Two Towers
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2
3
4
5
6
Posted by
| ForgottenMUD
Belgium (22 posts) Bio
|
Date
| Reply #75 on Thu 25 Aug 2011 03:59 PM (UTC) Amended on Thu 25 Aug 2011 06:38 PM (UTC) by ForgottenMUD
|
Message
|
Nick Gammon said:
No, because going east to a room doesn't necessarily mean going west from the new room takes you back to the old one. You have to "teach" the mapper by actually doing it.
Everyone that has tested the mapper HATES it for this reason. They find it highly annoying that they have to run back to every square to "teach" the mapper. It wouldn't happen with the mapper of a graphical game where the map is drawn automatically.
Players prefer if the MUD doesn't have rooms like that or if the map is wrong for such odd/rare room.
Anyway, it took me forever but I figured it out myself how to fix this problem.
I changed the function process_room_description as
for exit in string.gmatch (exits_str, "%w+") do
local ex = valid_direction [exit]
if ex then
exits [ex] = "0" -- don't know where it goes yet
if ex == getReverseDir() then
exits [ex] = current_room
end -- if
end -- if
end -- for
with
function getReverseDir ()
if last_direction_moved == "n" then
return "s"
end
if last_direction_moved == "s" then
return "n"
end
if last_direction_moved == "w" then
return "e"
end
if last_direction_moved == "e" then
return "w"
end
end
Now for the background colour, I looked at the GMCP mapper. I see that I must deal with the values fillcolour and fillbrush, correct?
However, I tested it and tried to add the same fillcolour to all rooms:
rooms [uid] = { name = roomdesc, desc = roomdesc, exits = exits, area = MUD_NAME, fillcolour = ColourNameToRGB "lightgreen", fillbrush = 0 }
but it doesn't do anything, what am I missing? Is there a list of commands/variables for the mapper somewhere that could help? |
ForgottenMUD - original Java MUD
http://sites.google.com/site/forgottenmud | Top |
|
Posted by
| Fiendish
USA (2,533 posts) Bio
Global Moderator |
Date
| Reply #76 on Thu 25 Aug 2011 04:29 PM (UTC) Amended on Thu 25 Aug 2011 04:30 PM (UTC) by Fiendish
|
Message
|
LordOwl said: I can't edit the previous message but...
All of my posts have edit links on them when I'm logged in. I can only assume that it's the same for everyone else as well.
Also, please use [code][/code] tags when posting code. |
https://github.com/fiendish/aardwolfclientpackage | Top |
|
Posted by
| Nick Gammon
Australia (23,046 posts) Bio
Forum Administrator |
Date
| Reply #77 on Thu 25 Aug 2011 09:37 PM (UTC) |
Message
|
Quote:
It wouldn't happen with the mapper of a graphical game where the map is drawn automatically.
Graphical games don't have illogical room layouts, you couldn't draw them. Your fix sounds sensible for games that have logical layouts.
Quote:
function getReverseDir ()
if last_direction_moved == "n" then
return "s"
end
if last_direction_moved == "s" then
return "n"
end
if last_direction_moved == "w" then
return "e"
end
if last_direction_moved == "e" then
return "w"
end
end
Or:
reverse_direction = {
n = "s",
s = "n",
e = "w",
w = "e",
u = "d",
d = "u",
ne = "sw",
sw = "ne",
nw = "se",
se = "nw",
} -- end of reverse_direction
function getReverseDir ()
return reverse_direction [last_direction_moved]
end -- getReverseDir
Quote:
... but it doesn't do anything, what am I missing?
That code gets executed for new rooms (not ones already saved). You look like you are doing the right thing. Does it not work for new rooms?
Quote:
Is there a list of commands/variables for the mapper somewhere that could help?
The start of mapper.lua lists exposed functions and variables.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Scarn
(47 posts) Bio
|
Date
| Reply #78 on Wed 08 Aug 2012 12:30 AM (UTC) Amended on Wed 08 Aug 2012 01:17 AM (UTC) by Scarn
|
Message
| I'd like to start with saying how happy I am at finding this old post!
I was one of the traitors that used MUSHclient for about 7 years and then drifted over to the world of Zuggsoft for the shiny map, and now here we have a map of our very own.
I have played The Two Towers for about 10 years now, and I my aim now is get this map working and perhaps follow Fiendish footsteps in a T2T package for MUSHclient!
....time to learn lua!
I'm going to start by changing the main trigger that picks up an indented line, as the MUD uses 4 spaces for lots of things... gets confusing.
T2T has a brief mode and the room descriptions then look like this:
[code]A very dark tunnel(n and w)[/code]
Not only will these give you a room name, but the exits are a lot easier to strip out.
Would anyone be able to help me by converting the original two triggers that pick up the room name/exits into working on one trigger on the room brief?
As I said, I have no real experience of Lua, but a huge willingness to learn and a lot of time to put into this.
Thanks! | Top |
|
Posted by
| Scarn
(47 posts) Bio
|
Date
| Reply #79 on Wed 08 Aug 2012 01:16 AM (UTC) |
Message
| From having a play around I think the main issue has already been raised, that is the fact that if you have identically named rooms, the map won't always create as a new room.
I think an easy fix for this would be by -not- naming the rooms, and just giving them room IDs (which they get anyway). It would then be a simple case of making triggers for unique rooms to 'sync' the map to the correct room ID, or even manually adding unique room descs to the map. I fear that without finding a fix for multiple room names, this map will never stick.
Also is there any command to delete a room, if you make a mistake the only way I can see to rectify it is to start again.
| Top |
|
Posted by
| Fiendish
USA (2,533 posts) Bio
Global Moderator |
Date
| Reply #80 on Wed 08 Aug 2012 02:28 AM (UTC) Amended on Thu 09 Aug 2012 01:20 PM (UTC) by Fiendish
|
Message
|
Quote: I think an easy fix for this would be by -not- naming the rooms, and just giving them room IDs (which they get anyway). I don't see any IDs in any of the MUD output shown in this thread. The only IDs are being generated by Nick's hash. The problem is hash collisions. You fix the problem by using more unique data in the hash. I have proposed a method below.
Nick Gammon said:
Also rooms don't seem to have names per se, so in the absence of a better idea I have put in the partial room hash (better than nothing, maybe).
The naive hash method described by Nick should be amended to include information from currently known connected rooms (uids and directions of known connected rooms at the time of construction should produce more unique hashes). This may also require storing meta information about which information was used in the hash. But off the top of my head I think it shouldn't.
e.g. instead of merely
uid = utils.tohex (utils.md5 (roomdesc .. exits_str))
You really want something like (note: this is code will not work without structural changes in the plugin)
realexits = {}
for k,v in pairs(room.exits) do
table.insert(realexits,k)
table.insert(realexits,v)
end
uid = utils.tohex (utils.md5(roomdesc .. exits_str .. table.concat(realexits,",")))
This of course requires that you have room.exits set up first. |
https://github.com/fiendish/aardwolfclientpackage | Top |
|
Posted by
| Tychon
USA (1 post) Bio
|
Date
| Reply #81 on Wed 29 May 2013 12:35 AM (UTC) |
Message
| Is there a way to manually add a room? There are times when the room descrip is used again in the mud I play so it doesn't match. | Top |
|
Posted by
| Teef
(5 posts) Bio
|
Date
| Reply #82 on Tue 15 Oct 2013 07:49 PM (UTC) |
Message
| Hi, back to mudding and scripting after a good 5 years and in that time forgot all I knew about coding. I have been working on getting this mapper to run in the MUD i've started playing on and while adjusting the multiline trigger I came across this weird aspect of the game. Basically it appends any new things onto the description and places mobs before the exits. I've not seen another mud do this. So my question is, is there a good way to exclude information from the trigger?
I just don't want the mapper thinking I walked into a new room and try to map it because a mob or an item is left on the ground.
Normal Empty Room
[Combat Practice Arena.]
Wooden golems line up from wall to wall, waiting for their next chance at combat. These magical creatures have been given the most basic of combat functions to provide novice adventurers with an opponent for testing.
Obvious Exits: southeast, northeast, and east.
Room with Mob
[Combat Practice Arena.]
Wooden golems line up from wall to wall, waiting for their next chance at combat. These magical creatures have been given the most basic of combat functions to provide novice adventurers with an opponent for testing.
Also here: a scrawny goblin-shaped wooden golem
Obvious Exits: southeast, northeast, and east.
Room with item drop
[Combat Practice Arena.]
Wooden golems line up from wall to wall, waiting for their next chance at combat. These magical creatures have been given the most basic of combat functions to provide novice adventurers with an opponent for testing. You notice a tin training dagger.
Obvious Exits: southeast, northeast, and east.
Room with item drop and mob
[Combat Practice Arena.]
Wooden golems line up from wall to wall, waiting for their next chance at combat. These magical creatures have been given the most basic of combat functions to provide novice adventurers with an opponent for testing. You notice a tin training dagger.
Also here: a scrawny goblin-shaped wooden golem, and a scrawny goblin-shaped wooden golem
Obvious Exits: southeast, northeast, and east.
Basically I want to exclude everything after "You notice" up to "Obvious Exits"
I'm sure there's probably an obviously easy way staring at me in the face.
Any suggestions on how to get around this? | Top |
|
Posted by
| Nick Gammon
Australia (23,046 posts) Bio
Forum Administrator |
Date
| Reply #83 on Thu 17 Oct 2013 10:35 PM (UTC) |
Message
| Which MUD is this? Some have GMCP messages which make it easy.
Failing that, you would have to muck around excluding text like "You notice ..." and "Also here: ...". |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Teef
(5 posts) Bio
|
Date
| Reply #84 on Thu 17 Oct 2013 11:38 PM (UTC) |
Message
| It's for a new mud called Shattered Isles some old school mud friends of mine are developing from scratch. We all used to play Dragons Gate on Genie and then AOL back in the day. They don't have anything like GMCP messages which I already asked about and suggested especially since they plan on making the room descriptions change with the weather and time of day.
Is there a way to exclude the entire line similar to the (?!) regular expression used for a single word? I've been searching and can't find a suitable example.
| Top |
|
Posted by
| Nick Gammon
Australia (23,046 posts) Bio
Forum Administrator |
Date
| Reply #85 on Fri 18 Oct 2013 02:16 AM (UTC) |
Message
| Anything's achievable with enough effort. But these MUDs that spew out lengthy descriptions with one thing running into another (whilst they look less robotic) are a pain to interpret for mapping purposes. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Teef
(5 posts) Bio
|
Date
| Reply #86 on Wed 06 Nov 2013 04:01 PM (UTC) |
Message
| Ok I found a solution by grabbing the room and the exits separate like the original simple mapper.
<trigger
enabled="y"
group="mappertest"
lines_to_match="4"
keep_evaluating="y"
match="^[(?!Delay)(.+?)\.]\n\n(.*\n(\S.*\n)*)\Z"
multi_line="y"
name="Name_Desc"
regexp="y"
script="Name_Desc"
sequence="100"
>
</trigger>
function Name_Desc (name, line, wildcards) -- roomname and roomdesc grab
roomname = wildcards[1]
roomitems = wildcards[2]
roomdesc = string.gsub (roomitems , " You notice .+$", "\n")
end -- Name_Desc
And it seems to work. But I do have another question.
This mud is very fond of "hidden" exits in place of doors and gates and the mapper will treat them as new areas and not connect them. So I'll have a set of rooms up to a point and then like in the case of a shop, a standalone room.
[Pawnshop, Entrance.]
Sedrin's is quite possibly the busiest shop in the entire academy. Customers come and go at all hours of the day in hopes of selling their spoils from conquests beyond the safety of the academy walls. An iron-banded wooden barrel sits beside the door, collecting rainwater as it rolls off the roof. You notice an iron-banded wooden barrel, and an open sturdy oak door.
Obvious Exits: north.
HP: 185/185 ST: 136/136 DB: 10 192/401
south
[Sedrin's Pawnshop.]
The wooden walls of the shop are overly stocked with goods and equipment such as torches, tools, and pouches. Numerous wares have been haphazardly displayed behind a counter. A merchant graciously accepts coin in exchange for merchandise, even buying some used goods from willing suppliers. You notice an open sturdy oak door, a dented steel trashcan, and a wooden LIST sign.
Also here: a swift human merchant
Obvious Exits: none
Is there a way to connect areas? So I can speed
walk directly. | Top |
|
Posted by
| Nick Gammon
Australia (23,046 posts) Bio
Forum Administrator |
Date
| Reply #87 on Wed 06 Nov 2013 09:55 PM (UTC) |
Message
| It's been such a long time since I worked on the mapper I can't remember, frankly.
You might have to make some sort of alias that speedwalks to the pawnshop, does a "manual" exit, and then does another speedwalk after that. |
- 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.
249,244 views.
This is page 6, subject is 6 pages long:
1
2
3
4
5
6
It is now over 60 days since the last post. This thread is closed.
Refresh page
top