To delete rooms, you select them with the mouse on the map, right click, and select 'delete'.
But, keep in mind that the most common type of mistake that will come up while mapping is you accidentally generate two copies of the same actual room. To fix that, you can either move the second copy of the room via the map, or via the 'shift' command, over the first copy, and then use the 'merge rooms' command to combine the two together into one room, getting rid of the extra room.
Generic Mapping Script
Re: Generic Mapping Script
There is no access to anything happening on the map window, so I literally can’t do anything with rooms you have selected.
I strongly recommend against messing with recall and such while mapping is active. Stop mapping, recall, make sure it knows where you are, and start mapping again as needed. This script is intended for two very different scenarios. The first in which you carefully map out areas, and the second while playing the game as normal, with mapping (meaning creating new rooms) disabled. When mapping is off, the script will rapidly figure out where you are as you start moving around, even if you are mysteriously transported to an unusual location, so long as you have the area mapped. Failing that, you can look at the room you are in, and type “find me”.
Your mapping error is because the room you tried to move south to doesn’t have a north exit on the map to the room you are coming from, but it should, so it creates a mismatch. So the script searches for a potential match in the direction you moved, looking for a room with the observed exits and room name. It found one, so it put you there and connected the exits, rather than making a new room as it would have otherwise.
It definitely takes a bit of practice to get used to how it behaves, and tailoring your mapping practices to match, but I find it strikes a decent balance in terms of flexibility and power, so some things just have to be put up with. If some rooms just don’t want to behave, delete them, and map that section again. Though you can set exits to specific roomIDs if needed.
I strongly recommend against messing with recall and such while mapping is active. Stop mapping, recall, make sure it knows where you are, and start mapping again as needed. This script is intended for two very different scenarios. The first in which you carefully map out areas, and the second while playing the game as normal, with mapping (meaning creating new rooms) disabled. When mapping is off, the script will rapidly figure out where you are as you start moving around, even if you are mysteriously transported to an unusual location, so long as you have the area mapped. Failing that, you can look at the room you are in, and type “find me”.
Your mapping error is because the room you tried to move south to doesn’t have a north exit on the map to the room you are coming from, but it should, so it creates a mismatch. So the script searches for a potential match in the direction you moved, looking for a room with the observed exits and room name. It found one, so it put you there and connected the exits, rather than making a new room as it would have otherwise.
It definitely takes a bit of practice to get used to how it behaves, and tailoring your mapping practices to match, but I find it strikes a decent balance in terms of flexibility and power, so some things just have to be put up with. If some rooms just don’t want to behave, delete them, and map that section again. Though you can set exits to specific roomIDs if needed.
Re: Generic Mapping Script
The thing that bugs me is that if I end up in the same area, the script doesn't seem to think it's been here before and always makes a new duplicate room, and I can't see. However, I have learned to edit BOTH room's exits to make it work due to your advice, thank you!
Re: Generic Mapping Script
If you walk into a room from a different direction, but it lines up on the map, it shouldn't be creating a new room, but if things aren't lined up on the map, then a new room should be generated, because it has no way to know if the room just coincidentally looks the same (and in fact many games have rooms with identical names and exits in them). If you can show me an example of it messing up, I may be able to help figure out what is happening, and/or create a fix.
Re: Generic Mapping Script
Do you have a email, So i can send a 18-min video showing what happens?
BTW, all my frustration isn't on you, just on how the script behaves.
EDIT 1:
Here it is.
https://www.youtube.com/watch?v=teJhlhP ... e=youtu.be
EDIT 2:
using the sense command, I can go to a entity, and it shows which direction I'm going to get to them.
BTW, all my frustration isn't on you, just on how the script behaves.
EDIT 1:
Here it is.
https://www.youtube.com/watch?v=teJhlhP ... e=youtu.be
EDIT 2:
using the sense command, I can go to a entity, and it shows which direction I'm going to get to them.
Re: Generic Mapping Script
So, as you have a rather long video covering issues, I'll be responding to them in order.
The first issue you bring up is recall going to the wrong room. In theory, you should be able to fix this by walking into the room where you actually recall, in such a way that the map shows you being in that room, and using the 'set recall' command. You should then be able to verify that the change has been made by using this command: lua display(map.recall)
This should produce a table (probably a very small one), that shows your character name, and the roomID associated with it. It may be worth checking what this has before trying to change it, so you can observe any change directly.
Next, you show an instance where the map jumps backward, avoiding a particular room. From what I can tell, that room has a closed door to the north when you walk into it this time, but it didn't at the time of its creation, so it has an exit stub to the north. So, the script is looking for a north exit, and none is found, so it matches with another room that has the same name and the observed exits. To fix this, you need to add a door on that exit, as the script treats exits with doors as optional. Obviously the easiest way to do this would have been when the room was first created, but at this point you have two options, the first is just to select the room on the map, right click, select 'exits', and add a door. It isn't terribly obvious what does this, but below the text box where the roomID would go for that exit, there is a set of radio buttons (four round buttons of which you can only select one), they represent, from left to right, no door, open door, closed door, and locked door. Select one as appropriate and save. Alternately, you can enter the room, open the door, leave and come back (so that the map now shows you standing in that room), and use the 'add door' command to place a door on the appropriate exit. In either case, it should now work just fine. The key point here being that adding doors is an important part of the process of mapping an area.
Your next issue shows you trying to move west, but failing. This is because the room you are trying to move into has a west exit, but the room on the map does not (most likely because you deleted the room to the west of it). You can fix this by editing the exits of that room, and clicking the right-most checkbox of the two located to the left of the text box for the roomID for that exit. You could alternately stand in the room east of the problem room, delete the problem room (and the room north of it, because it will become messed up as well), and then move west, letting the script recreate the room from scratch. In this case, it is important where you are standing when you do this, because deleting a room removes all exits leading to it, making attached rooms no longer match with what is observed. But, if you are standing in the room that gets messed up, the map still has you being in that room, so it works out. The key lesson here is that deleting rooms causes issues that need to be handled carefully. Also key here is that you should only ever use the 'start mapping' command when the map accurately shows your location. If you are standing in a room that isn't where the map shows you to be, it is going to start creating problems very rapidly.
Map stretching is something that can be disabled or enabled, as you prefer (there is a setting in map.configs, just below the documentation), but it always stretches the entire map along the relevant line, so that if you move west and it sees the need to stretch the map, it moves every room west of your current location further west. This is so that things maintain alignment. In this particular instance, I would say that the easiest solution would be use of areas, via the 'set area' command. Map stretching only applies within an area, so if you create area transitions at relevant points, it creates a break and protects an already mapped area from getting distorted as you map out another area.
Next, you run into an issue with the way you tried to map out the area. The script intentionally searches in the moved direction for a room that matches the name and exits of the room you just entered. So, in wide open areas that are full of essentially identical rooms, it is important to map things out in a particular way, such that you don't have a room for it to jump to. There are obviously all sorts of particular methods you could choose here, just so long as don't create a gap between two rooms that it could jump across, or if you do, fill that gap in such a way that you don't trigger that jump. In the case you show, for instance, you could have mapped out the edges, and then gone from the middle line in a north-south direction, toward the edges there. This is ultimately just something you have to get used to, and adjust your mapping strategy to work with, because it can otherwise cause a ton of problems. All the stuff at the end is because of this phenomenon.
Edit: Oh, and with the sense command, that is going to work via the onForcedMove event, similar to how we did following, except you will need a different pattern (and this will have to be its own trigger). I think this should work as a perl regex pattern: ^You concentrate and sense their ki (\w+) of here\.
And this for the code: raiseEvent("onForcedMove",matches[2])
The first issue you bring up is recall going to the wrong room. In theory, you should be able to fix this by walking into the room where you actually recall, in such a way that the map shows you being in that room, and using the 'set recall' command. You should then be able to verify that the change has been made by using this command: lua display(map.recall)
This should produce a table (probably a very small one), that shows your character name, and the roomID associated with it. It may be worth checking what this has before trying to change it, so you can observe any change directly.
Next, you show an instance where the map jumps backward, avoiding a particular room. From what I can tell, that room has a closed door to the north when you walk into it this time, but it didn't at the time of its creation, so it has an exit stub to the north. So, the script is looking for a north exit, and none is found, so it matches with another room that has the same name and the observed exits. To fix this, you need to add a door on that exit, as the script treats exits with doors as optional. Obviously the easiest way to do this would have been when the room was first created, but at this point you have two options, the first is just to select the room on the map, right click, select 'exits', and add a door. It isn't terribly obvious what does this, but below the text box where the roomID would go for that exit, there is a set of radio buttons (four round buttons of which you can only select one), they represent, from left to right, no door, open door, closed door, and locked door. Select one as appropriate and save. Alternately, you can enter the room, open the door, leave and come back (so that the map now shows you standing in that room), and use the 'add door' command to place a door on the appropriate exit. In either case, it should now work just fine. The key point here being that adding doors is an important part of the process of mapping an area.
Your next issue shows you trying to move west, but failing. This is because the room you are trying to move into has a west exit, but the room on the map does not (most likely because you deleted the room to the west of it). You can fix this by editing the exits of that room, and clicking the right-most checkbox of the two located to the left of the text box for the roomID for that exit. You could alternately stand in the room east of the problem room, delete the problem room (and the room north of it, because it will become messed up as well), and then move west, letting the script recreate the room from scratch. In this case, it is important where you are standing when you do this, because deleting a room removes all exits leading to it, making attached rooms no longer match with what is observed. But, if you are standing in the room that gets messed up, the map still has you being in that room, so it works out. The key lesson here is that deleting rooms causes issues that need to be handled carefully. Also key here is that you should only ever use the 'start mapping' command when the map accurately shows your location. If you are standing in a room that isn't where the map shows you to be, it is going to start creating problems very rapidly.
Map stretching is something that can be disabled or enabled, as you prefer (there is a setting in map.configs, just below the documentation), but it always stretches the entire map along the relevant line, so that if you move west and it sees the need to stretch the map, it moves every room west of your current location further west. This is so that things maintain alignment. In this particular instance, I would say that the easiest solution would be use of areas, via the 'set area' command. Map stretching only applies within an area, so if you create area transitions at relevant points, it creates a break and protects an already mapped area from getting distorted as you map out another area.
Next, you run into an issue with the way you tried to map out the area. The script intentionally searches in the moved direction for a room that matches the name and exits of the room you just entered. So, in wide open areas that are full of essentially identical rooms, it is important to map things out in a particular way, such that you don't have a room for it to jump to. There are obviously all sorts of particular methods you could choose here, just so long as don't create a gap between two rooms that it could jump across, or if you do, fill that gap in such a way that you don't trigger that jump. In the case you show, for instance, you could have mapped out the edges, and then gone from the middle line in a north-south direction, toward the edges there. This is ultimately just something you have to get used to, and adjust your mapping strategy to work with, because it can otherwise cause a ton of problems. All the stuff at the end is because of this phenomenon.
Edit: Oh, and with the sense command, that is going to work via the onForcedMove event, similar to how we did following, except you will need a different pattern (and this will have to be its own trigger). I think this should work as a perl regex pattern: ^You concentrate and sense their ki (\w+) of here\.
And this for the code: raiseEvent("onForcedMove",matches[2])
Re: Generic Mapping Script
Okay, thank you for responding to my video.
I just have a list of things I found out as a result of this, I will add to it as I find more.
So, I found out that my character was set to = 50 while the recall was set to 8.
I tried using set Character <name> again at ID 8, but the lua display didn't change.
Also, I found out that when I delete the room, the exits in adjacent rooms disappear. If they still kept their exit as a unknown variable instead of deleting it, it would be less troublesome in my rookie opinion.
Also, um, do I add the raiseEvent to the code? the raise event so far looks like this:
raiseEvent("onForcedMove",multimatches[1][3])
Do I make it raiseEvent("onForcedMove",multimatches[1][2][3])
Or do I make it like this:
raiseEvent("onForcedMove",multimatches[1][3])
raiseEvent("onForcedMove",matches[2])
I just have a list of things I found out as a result of this, I will add to it as I find more.
So, I found out that my character was set to = 50 while the recall was set to 8.
I tried using set Character <name> again at ID 8, but the lua display didn't change.
Also, I found out that when I delete the room, the exits in adjacent rooms disappear. If they still kept their exit as a unknown variable instead of deleting it, it would be less troublesome in my rookie opinion.
Also, um, do I add the raiseEvent to the code? the raise event so far looks like this:
raiseEvent("onForcedMove",multimatches[1][3])
Do I make it raiseEvent("onForcedMove",multimatches[1][2][3])
Or do I make it like this:
raiseEvent("onForcedMove",multimatches[1][3])
raiseEvent("onForcedMove",matches[2])
Re: Generic Mapping Script
Recall locations are stored by character, and in theory there is one for an "empty" character, i.e. one named "" (which is what the character will be if one isn't set). So, you can either set the recall for the empty character to whatever you want, or you can set your character name for the script, and set the recall point for that (from what you said, it seems that it is already correct). Then you just need to set your character when you login, and it will remember your recall location. If you only have one character, just using the empty character option would make the most sense to me, but if you have multiple characters each with potentially different recall locations, I strongly recommend setting your character for the purposes of the script.
I have no control over what happens when a room is deleted. That is all done via Mudlet itself, so I cannot modify its behavior, unfortunately. I agree that changing the exits into exit stubs would make more sense than just deleting them.
For the raiseEvent code that you mention, you specifically need to make an entirely new trigger, not modify the original onForcedMove trigger.
I have no control over what happens when a room is deleted. That is all done via Mudlet itself, so I cannot modify its behavior, unfortunately. I agree that changing the exits into exit stubs would make more sense than just deleting them.
For the raiseEvent code that you mention, you specifically need to make an entirely new trigger, not modify the original onForcedMove trigger.
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: Generic Mapping Script
It has been noted on Discord recently that there is no way to write login scripts because there is no way for the lua sub-system to find out what character name and password is set on the "Connection preferences" dialogue/form. This is something that I am meaning to get around to sorting out so that a script can replace the current simplistic send the character name and then the password after a short time delay once connected to the MUD server... ![Geek :geek:](./images/smilies/icon_e_geek.gif)
... this does sound like something that you'd like to have to hand for part of this issue.
![Geek :geek:](./images/smilies/icon_e_geek.gif)
... this does sound like something that you'd like to have to hand for part of this issue.
Re: Generic Mapping Script
Potentially, yes, though the script will continue to allow a character to be set "manually", because some people (myself included) have multiple characters in the same game that all use the same profile, rather than setting up a different profile for each character. Not only does the game I play have a relatively "complex" login process, but it has master accounts, so you login to your master account, and from there choose the character you want to play, so any "character" I could use for that login would just be the name of my master account, rather than my actual character. Of course, for my personal use, I have something setup that checks my character name when I login via triggers, so it isn't really an issue for me.
That said, being able to grab the profile character name would at least be a handy thing to use as the default, rather than leaving it blank.
That said, being able to grab the profile character name would at least be a handy thing to use as the default, rather than leaving it blank.