[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 Tychon   USA  (1 post)  [Biography] bio
Date Wed 29 May 2013 12:35 AM (UTC)  quote  ]
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.
[Go to top] top

Posted by Fiendish   USA  (851 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,800 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  (851 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,800 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,800 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,800 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,800 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,800 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

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.


22,917 views.

This is page 1, subject is 6 pages long: 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]