[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?

Mapper plugin for Two Towers

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


Pages: 1  2  3  4  5  6 

Posted by ForgottenMUD   Belgium  (21 posts)  [Biography] bio
Date Reply #75 on 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 Fiendish   USA  (848 posts)  [Biography] bio   Global Moderator
Date Reply #76 on 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 Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Reply #77 on 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 Scarn   (44 posts)  [Biography] bio
Date Reply #78 on 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 Scarn   (44 posts)  [Biography] bio
Date Reply #79 on 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 Fiendish   USA  (848 posts)  [Biography] bio   Global Moderator
Date Reply #80 on 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

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,977 views.

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

[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]