A little confused with the mapper and descriptions

Post Reply
mordenkaim
Posts: 6
Joined: Wed Apr 20, 2016 9:06 pm

A little confused with the mapper and descriptions

Post by mordenkaim » Tue Dec 17, 2019 3:22 pm

Hi all. I'm working on mapping a MUD (a very old custom code base so I don't get any location/map info from the game).

I believe I need to parse descriptions in order to resolve position conflicts, and I have the triggers for capturing the descriptions done. I am a little confused on where I need to look in the generic mapper to update the logic that validates which room you are in.

Adding a little code flow below to describe how I am approaching this/my current understanding of it.. as of now I have the description capture working roughly, though I need to clean up when it is enabled.
Code: [show] | [select all] lua
--Match room title
--Grab all lines until the exits line, put into description variable
--disable capture on exits line
--player position is updated here by the mapper ( I am not sure yet where this happens, but I think I need to compare description to GetRoomUserData if there is more than one room with the same title and exits... if there is only one room found with the same title and exits ignore descriptions)
--if mapping, setUserRoomData(getPlayerRoom(), "description", description)
I guess the real question I have is: "How does the mapper compare the userdata description with the current room description?" It doesn't seem to maintain the description in a variable by default and I've just set up an arbitrary variable to hold it, so I'm not sure how it would know what to compare it to.

mordenkaim
Posts: 6
Joined: Wed Apr 20, 2016 9:06 pm

Re: A little confused with the mapper and descriptions

Post by mordenkaim » Tue Dec 17, 2019 7:29 pm

So, I went from another angle.

From the default generic mapping script I added two variables to the map table under variables, map.currentDescription and map.previousDescription. Then I went through the generic mapping script and added lines to capture the description during the parse for roomName and exits, then returned an array from the room capture script that returns name and description. Then basically anywhere that a room name check is being done I check for both name and description matches.

So far it is working pretty well with the occasional glitch. Once I get it cleaned up i'll post my code to this thread in case anyone else is trying to do the same thing.

Post Reply

Who is online

Users browsing this forum: Vonlocof and 9 guests