So, that is a lot of issues, but some are simpler than others. I'll try to address as much as I can in one go, then after that pass, we can go back and address whatever I miss.
ulysses wrote:1. The mapping window which opens is very small. I found the controls around line 100 to make it larger, but It would be nice to have it open as a separate window, is that possible?
In theory the map can be opened in a separate window, however I'm not aware of a way to do so via code. If a map window is NOT created via code, then you can use the "Show Map" option in the Toolbox menu to open a map in a separate window that starts out docked to the main window. However, once a map window is created via code, the "Show Map" option will just toggle that window's visibility, not create an independent window. So, yes, it can be done, but no, I don't know how to do it with this script.
ulysses wrote:2. If I click zoom button (+) once then the map disappears - is there any way to zoom in more gradually?
The + and - buttons move the map view in the z direction (i.e. up and down), they are not zoom buttons. Hence why it suddenly disappears. You can point at the map window and scroll with your mouse to zoom in and out.
ulysses wrote:3. I used a lua function trigger in combination with the get_desc function to parse the room name. It works in simple cases but I need to strip out the weather/status info. They look like this;
Southern Trade Route (road-raining-puddles)
Temple of Ulthar - Main Hall (inside)
('inside' isn't really a problem, but the weather is as it is non-static). So I tried this:
Code: Select all
map.prompt.room = string.match(desc[#desc], '^(.*?)\(.*\)$')
But that doesn't work. Without the non-greedy modifier ? then the whole line is matched. Over the years I've done a lot of regex matching, but perhaps I'm getting rusty!
I will also need incorporate the first line of the description since some locations are not unique by their room name. This is where it will get rather tricky as there can exist spaces/messages between the room name and the description.
So, instead of using string.match, I would use string.gsub to cut out anything between parentheses, like this:
Code: Select all
map.prompt.room = string.gsub(desc[#desc],"%s*%([^%)]+%)","")
Importantly, there is no need for room names to be distinct, as there are plenty of games with whole areas full of rooms with identical room names. There is actually a significant amount of code devoted to tracking down where you are located in case things get mixed up, and you find yourself in rooms without unique names, in which it looks at the room name and exits of the current room, and the previous room, to help narrow down where you could be at. While creating the map itself, it is important to avoid situations where you have one room created, and then loop around to approach it from a distance in which there is a room or rooms between you and the mapped room with the same name and exits, as the script looks in the direction you moved to see if it can find a matching room (with identical name and exits) before deciding to create a new room. So long as you keep that in mind, it shouldn't be a problem.
ulysses wrote:4. The map aliases seem to have a mind of their own - they keep getting (re)created/disabled. I've ended up with like 90 or so aliases this evening, most disabled. I would like those to be static, under one group if possible, so they don't clutter up the alias list (they are getting created in the root alias 'directory'). I can see something about that in the script, but when I click on active ones in the GUI to inspect them, they de-activate themselves. This feels a little buggy/odd. Perhaps there is something more subtle going on?
In my experience, sometimes there suddenly appear copies of all the temporary items, as if they were permanent ones. They are not, and if you close the profile and open it back up, they should disappear. This is what is happening with the aliases for the mapping script. They are created via tempAlias so that they cannot be edited by the user without changing the main script.
ulysses wrote:5. Are in and out recognised as directions? They seem to be ok, but haven't tested thoroughly.
Yes, in and out should work fine.
ulysses wrote:6. In CthulhuMUD closed doors are shown as, for example, #north and locked doors as |#north| (however this doesn't seem to be universally applied).
While it would in theory be possible to automate the adding of doors when exits are created, I have not yet added such a feature to the script (it is on the list of things to do). So, for now I recommend just stripping out the # symbols from your exits so that they are properly recognized by the script. As with the problem with the room names, use string.gsub.
ulysses wrote:7. Not sure how to configure triggers to open doors. Some doors are special - e.g. one location requires 'pull rope', another to wait for guard recognition.
While I could obviously set something up for a generic door opening trigger, I don't know how to handle special cases without keeping some sort of list of exceptions. While the map script doesn't currently expose the roomID, the most sensible strategy would be to access the roomID, and use that as a key in a table of rooms and exits that need special handling, along with the relevant alternative command.
ulysses wrote:8. How to add graphics to the map, if possible.
This is definitely possible, but I haven't done anything with it, so the most I could do is basically just read what is in the wiki, and pass it along to you.
ulysses wrote:9. How to save and "connect" different maps from different regions/areas. I see there is one alias in the script:
Code: Select all
["Save Map Alias"] = {[[^save map$]], [[saveMap(getMudletHomeDir() .. "/map.dat")]]},
But that seems to use one file. Is that how it works - one file for all map regions?
The save command is essentially just to create a backup of the map, or to allow you to pass it along to another user (there is a matching load map command that lets you do this). As for creating different areas within the map, that is done with the "set area" command. While mapping, type "set area My Area Name", and it will move the room you are currently standing in into the area with that name, creating that area if necessary. The areas don't visually connect, making essentially a number of separate maps within a single file.
ulysses wrote:10. CthulhuMUD has multiple regions, some of which are reached by dream walking around the place - this is like a portal. How to handle that?
There is an "add portal" command that can be used to accommodate this sort of thing, though at present it only allows for a single command (an arbitrary one though) to "enter" the portal. However, the actual steps needed to pass through from area to area are only truly relevant if trying to speedwalk between the rooms, so if more than one command is needed, you can just use the first such command, then finish the other steps manually, then change the area of the first room you reach in the new region once it has been created.
ulysses wrote:11. How to find something in the scripts - for 10 or 20 lines of code this is no issue. For 1000 lines this is more problematic. I could not see a search function
I copy the script into a text editor, and search there. That is also where I do most of my editing as well when working on scripts, as I have more powerful tools available than inside Mudlet.