[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Plugins
. . -> [Subject]  Mapper plugin for Two Towers

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Mapper plugin for Two Towers
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1  2  3  4  5 6  

Posted by Fiendish   USA  (848 posts)  [Biography] bio   Global Moderator
Date Wed 08 Aug 2012 02:28 AM (UTC)  quote  ]

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.

http://aardwolfclientpackage.googlecode.com/
[Go to top] top

Posted by Scarn   (44 posts)  [Biography] bio
Date Wed 08 Aug 2012 01:16 AM (UTC)  quote  ]
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.
[Go to top] top

Posted by Scarn   (44 posts)  [Biography] bio
Date Wed 08 Aug 2012 12:30 AM (UTC)  quote  ]

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!
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Thu 25 Aug 2011 09:37 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Fiendish   USA  (848 posts)  [Biography] bio   Global Moderator
Date Thu 25 Aug 2011 04:29 PM (UTC)  quote  ]

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.

http://aardwolfclientpackage.googlecode.com/
[Go to top] top

Posted by ForgottenMUD   Belgium  (21 posts)  [Biography] bio
Date Thu 25 Aug 2011 03:59 PM (UTC)  quote  ]

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
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Wed 24 Aug 2011 11:28 PM (UTC)  quote  ]
Message
LordOwl said:

I am using this plugin for my MUD. I managed to change the trigger and get it to work, however I have a few issues.

1) When I move to a new unexplored room, the mapper only shows a little square with that room. It does not link it automatically to the rest of the map because it seems to wait to see that I can move both directions before it draws a link between the rooms.


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.

LordOwl said:

2) When I add an exit to a room, it changes its ID. Then same problem as above: the map for the rooms that lead to this room still lead to the old room, and the map does not display.


What do you mean by "add an exit"? As a room builder? The mapper tries to generate room IDs by including the description and exits. If the descriptions are always unique then you could omit the exits. However you will still have problems if the description changes.

LordOwl said:

3) Is there a command to change the background colour of the squares? e.g. yellow for a desert.


On the GMCP mapper I did that because the MUD sent down terrain types. There isn't a command per se.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by ForgottenMUD   Belgium  (21 posts)  [Biography] bio
Date Wed 24 Aug 2011 10:22 AM (UTC)  quote  ]
Message
I am using this plugin for my MUD. I managed to change the trigger and get it to work, however I have a few issues.

1) When I move to a new unexplored room, the mapper only shows a little square with that room. It does not link it automatically to the rest of the map because it seems to wait to see that I can move both directions before it draws a link between the rooms. I have to move back and forth to "connect" the room and display the whole map. Is it possible to make it draw the connection automatically?

2) When I add an exit to a room, it changes its ID. Then same problem as above: the map for the rooms that lead to this room still lead to the old room, and the map does not display.

3) Is there a command to change the background colour of the squares? e.g. yellow for a desert.

Can anyone help me?

ForgottenMUD - original Java MUD
http://sites.google.com/site/forgottenmud
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Wed 06 Apr 2011 05:41 AM (UTC)  quote  ]
Message
I understand what you are saying - the line breaks are in the area files, the server is not adding them "on the fly". However the fact remains that the line breaks are in the data as it arrives from the server. Whether the builder of the area put them in, or whether the server adds them at the last minute, the line breaks are there.

So, the client isn't adding them, is my point. The original question was:

Quote:

Is there a way to make the MUSHclient use the entire screen for the game/words?


The answer is, it isn't easy if the server has put the linebreaks there (at some point). The only real way of achieving it would be to "unwrap" the lines, and that requires some knowledge of context. Things like WHO lists, for example, would look stupid you just ran everything together.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Vincitore   (11 posts)  [Biography] bio
Date Tue 05 Apr 2011 06:03 AM (UTC)  quote  ]
Message
Yeah, that's correct. The line breaks are already written in; the server's not putting them there.
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Mon 04 Apr 2011 08:53 AM (UTC)  quote  ]
Message
I confess I don't fully understand this. The server does not wrap, but "virtually every line of text in the game is between 50 and 75 characters".

That sounds to me like it is wrapping, or a long room description would be much longer than 50 characters.

One point of confusion might be that the server may not wrap as text is being sent (hence tells might come out quite long), but the predefined descriptions for rooms (in area files) may have been entered with newlines at around column 70. So the server might technically not be wrapping, but it is sending lines that have been "pre-wrapped".

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Vincitore   (11 posts)  [Biography] bio
Date Mon 04 Apr 2011 07:21 AM (UTC)  quote  ]
Message
I did some experimenting (changed Mushclient's wrapping and mailed myself a long string) and found that the server does not wrap except in tells and a few other cases. Virtually every line of text in the game is between 50 and 75 characters, though, so it's rare to encounter anything that would exceed 80.
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Tue 14 Sep 2010 06:11 AM (UTC)  quote  ]
Message
Jerrid said:

Ok I asked one of the guys who takes care of the game. He says there is no wraping at 80. There also is no automatic wrapping either except for tells and out door maps. So I am not sure. He says he is not familiar with MUSHclient and the client he uses the entire screen gets used... I think I will retry messing with the properties of MUSHclient, but it did not work last time.


This fellow is incorrect. As you have it configured on the server (and maybe you can change that) it is clearly wrapping. Maybe on his client "the full screen gets used" because he only has an 80-character screen. Some MUDs have an option to disable server-side wrapping, I would ask again about that. But as received in your packet debug, the server is wrapping it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Tue 14 Sep 2010 06:03 AM (UTC)  quote  ]
Message
It does some pretty weird things too, for example: "0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d". That is a whole lot of carriage-returns. That doesn't do much. One might put the "cursor" back to column 1, but after that the extra ones are just wasting space.

They also put out colour codes for exits, even if the exit is spaces. (So you see nicely coloured spaces ... not).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Tue 14 Sep 2010 06:01 AM (UTC)  quote  ]

Amended on Tue 14 Sep 2010 06:07 AM (UTC) by Nick Gammon

Message
Right. Well if we bold and underline the newlines (0a is newline, 0d is carriage-return) we see this:




Sent  packet: 17 (3 bytes) at Monday, September 13, 2010, 7:37:54 PM

l..                6c 0d 0a

Incoming packet: 67 (997 bytes) at Monday, September 13, 2010, 7:37:54 PM

.[36mMerchant's    1b 5b 33 36 6d 4d 65 72 63 68 61 6e 74 27 73 20
Barge (Stormy Ev   42 61 72 67 65 20 28 53 74 6f 72 6d 79 20 45 76
ening).[0m...[37   65 6e 69 6e 67 29 1b 5b 30 6d 0d 0a 1b 5b 33 37
m   This wide ba   6d 20 20 20 54 68 69 73 20 77 69 64 65 20 62 61
rge is made of l   72 67 65 20 69 73 20 6d 61 64 65 20 6f 66 20 6c
ashed pine logs,   61 73 68 65 64 20 70 69 6e 65 20 6c 6f 67 73 2c
 and covered to.   20 61 6e 64 20 63 6f 76 65 72 65 64 20 74 6f 0d
..prevent rottin   0d 0a 70 72 65 76 65 6e 74 20 72 6f 74 74 69 6e
g.  By the look    67 2e 20 20 42 79 20 74 68 65 20 6c 6f 6f 6b 20
of things, you i   6f 66 20 74 68 69 6e 67 73 2c 20 79 6f 75 20 69
nfer that there.   6e 66 65 72 20 74 68 61 74 20 74 68 65 72 65 0d
..is likely a me   0d 0a 69 73 20 6c 69 6b 65 6c 79 20 61 20 6d 65
rchant selling t   72 63 68 61 6e 74 20 73 65 6c 6c 69 6e 67 20 74
hings from here.   68 69 6e 67 73 20 66 72 6f 6d 20 68 65 72 65 2e
  Crates in grou   20 20 43 72 61 74 65 73 20 69 6e 20 67 72 6f 75
ps...of five are   70 73 0d 0d 0a 6f 66 20 66 69 76 65 20 61 72 65
 periodically ca   20 70 65 72 69 6f 64 69 63 61 6c 6c 79 20 63 61
rried away by bu   72 72 69 65 64 20 61 77 61 79 20 62 79 20 62 75
rly sailors.....   72 6c 79 20 73 61 69 6c 6f 72 73 2e 0d 0d 0a 1b
[0;0m.[36m.[36m    5b 30 3b 30 6d 1b 5b 33 36 6d 1b 5b 33 36 6d 20
           .[36m   20 20 20 20 20 20 20 20 20 20 20 1b 5b 33 36 6d
.[36m              1b 5b 33 36 6d 20 20 20 20 20 20 20 20 20 20 20
 .[36m.[36m        20 1b 5b 33 36 6d 1b 5b 33 36 6d 20 20 20 20 20
       .[36m.[36   20 20 20 20 20 20 20 1b 5b 33 36 6d 1b 5b 33 36
m...[36m           6d 0d 0a 1b 5b 33 36 6d 20 20 20 20 20 20 20 20
    .[36m.[36m..   20 20 20 20 1b 5b 33 36 6d 1b 5b 33 36 6d 0d 0a
.[36m              1b 5b 33 36 6d 20 20 20 20 20 20 20 20 20 20 20
 .[36m.[36m        20 1b 5b 33 36 6d 1b 5b 33 36 6d 20 20 20 20 20
     .[36m   sou   20 20 20 20 20 1b 5b 33 36 6d 20 20 20 73 6f 75
th   .[36m         74 68 20 20 20 1b 5b 33 36 6d 20 20 20 20 20 20
      .[36m.[36m   20 20 20 20 20 20 1b 5b 33 36 6d 1b 5b 33 36 6d
            .[36   20 20 20 20 20 20 20 20 20 20 20 20 1b 5b 33 36
m.[0m...[37m.[33   6d 1b 5b 30 6d 0d 0a 1b 5b 33 37 6d 1b 5b 33 33
m.[33mA young la   6d 1b 5b 33 33 6d 41 20 79 6f 75 6e 67 20 6c 61
borer carries he   62 6f 72 65 72 20 63 61 72 72 69 65 73 20 68 65
avy crates to th   61 76 79 20 63 72 61 74 65 73 20 74 6f 20 74 68
e warehouse.....   65 20 77 61 72 65 68 6f 75 73 65 2e 0d 0d 0d 0d
................   0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d
...[36m(Citizen)   0d 0a 1b 5b 33 36 6d 28 43 69 74 69 7a 65 6e 29
 (D) .[36mA huma   20 28 44 29 20 1b 5b 33 36 6d 41 20 68 75 6d 61
n citizen casual   6e 20 63 69 74 69 7a 65 6e 20 63 61 73 75 61 6c
ly strolls down    6c 79 20 73 74 72 6f 6c 6c 73 20 64 6f 77 6e 20
the street......   74 68 65 20 73 74 72 65 65 74 2e 0d 0d 0d 0d 0d
................   0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d
................   0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d
...............[   0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0a 1b 5b
35m.[35mA greedy   33 35 6d 1b 5b 33 35 6d 41 20 67 72 65 65 64 79
 merchant stands   20 6d 65 72 63 68 61 6e 74 20 73 74 61 6e 64 73
 on the barge wa   20 6f 6e 20 74 68 65 20 62 61 72 67 65 20 77 61
tching his merch   74 63 68 69 6e 67 20 68 69 73 20 6d 65 72 63 68
andise..........   61 6e 64 69 73 65 2e 0d 0d 0d 0d 0d 0d 0d 0d 0d
..............[3   0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0a 1b 5b 33
5m.[35mThe barge   35 6d 1b 5b 33 35 6d 54 68 65 20 62 61 72 67 65
 captain stands    20 63 61 70 74 61 69 6e 20 73 74 61 6e 64 73 20
on his ship.....   6f 6e 20 68 69 73 20 73 68 69 70 2e 0d 0d 0d 0d
................   0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d
...[0;0m( 2) .[3   0d 0a 1b 5b 30 3b 30 6d 28 20 32 29 20 1b 5b 33
3m.[33mA bodygua   33 6d 1b 5b 33 33 6d 41 20 62 6f 64 79 67 75 61
rd of the mercha   72 64 20 6f 66 20 74 68 65 20 6d 65 72 63 68 61
nt watches you c   6e 74 20 77 61 74 63 68 65 73 20 79 6f 75 20 63
losely..........   6c 6f 73 65 6c 79 2e 0d 0d 0d 0d 0d 0d 0d 0d 0d
..............[0   0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0a 1b 5b 30
;0m..              3b 30 6d 0d 0a

Incoming packet: 68 (173 bytes) at Monday, September 13, 2010, 7:37:55 PM

H:.[1;32m100.[0;   48 3a 1b 5b 31 3b 33 32 6d 31 30 30 1b 5b 30 3b
0m% M:.[1;32m100   30 6d 25 20 4d 3a 1b 5b 31 3b 33 32 6d 31 30 30
.[0;0m% V:.[1;32   1b 5b 30 3b 30 6d 25 20 56 3a 1b 5b 31 3b 33 32
m100.[0;0m (.[1;   6d 31 30 30 1b 5b 30 3b 30 6d 20 28 1b 5b 31 3b
34mcalm.[0;0m) (   33 34 6d 63 61 6c 6d 1b 5b 30 3b 30 6d 29 20 28
.[1;37m.[0;0m=.[   1b 5b 31 3b 33 37 6d 1b 5b 30 3b 30 6d 3d 1b 5b
0;0m=.[0;0m=.[0;   30 3b 30 6d 3d 1b 5b 30 3b 30 6d 3d 1b 5b 30 3b
0m=.[0;0m=.[0;0m   30 6d 3d 1b 5b 30 3b 30 6d 3d 1b 5b 30 3b 30 6d
=.[0;0m=.[0;0m=.   3d 1b 5b 30 3b 30 6d 3d 1b 5b 30 3b 30 6d 3d 1b
[0;0m=.[0;0m=) e   5b 30 3b 30 6d 3d 1b 5b 30 3b 30 6d 3d 29 20 65
xits:S lead:>      78 69 74 73 3a 53 20 6c 65 61 64 3a 3e


Jerrid said:

The one guy I had asked before said it did wrap because it was old, but the guy who actually works on it says it does not and I kept asking in different ways to try and make my self clear.


The guy who said it wrapped was correct.

In my case I had the output window wrapping at column 100, however the longest line there ("is likely a merchant selling things from here. Crates in groups") is only 64 characters.

So clearly the MUD is doing the wrapping, and there isn't a heap you can do ... unless for example room descs are always in that particular colour, then maybe you could throw away the wraps for that.

I would ask again (and maybe point them to this thread) if you can defeat or adjust the column the MUD wraps at, so you can use more of your client screen.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] 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.


21,943 views.

This is page 5, subject is 6 pages long:  [Previous page]  1  2  3  4  5 6  [Next page]

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]