Generic Mapping Script
Re: Generic Mapping Script
Okay, so looking at your included picture, you have several problems. First, you have the pattern for the prompt trigger in your room name trigger, and you have its pattern type as "substring" instead of "perl regex" (which would be the proper type for that pattern, when used in the prompt trigger). You need to change the pattern type for line 1 to "color trigger", rather than changing the colors used in highlighting (which is simply to show that something was matched by the trigger, mostly only useful to see if it is working or not).
Re: Generic Mapping Script
@ulysses I just uploaded an updated package (and updated the script posted on the main page, so you can just copy/paste that over the existing script to see the changes), so that it should now properly add doors via the add door command in the up/down and in/out directions. Check it out, and let me know how it works for you.
Re: Generic Mapping Script
Hey, Jor'Mox. Thanks so much for looking at this.Jor'Mox wrote: ↑Wed May 09, 2018 6:13 pm@ulysses I just uploaded an updated package (and updated the script posted on the main page, so you can just copy/paste that over the existing script to see the changes), so that it should now properly add doors via the add door command in the up/down and in/out directions. Check it out, and let me know how it works for you.
Sorry to say, but the problem remains. I am now able to add an UP door and when I do I see:
Code: Select all
start mapping
Now mapping in area: Dreamlands
add door up
983 down 2
982 up 2
Inspecting the room via the 'exits' menu on the context click shows that the up direction is now marked with a closed door (third radio button). However, when I move N away from this room, remove the item which causes me to fly (and therefore see the UP direction), move S back to the room which had the UP exit (but does not now since I'm not flying), then the glowing here-you-are pointer jumps to another location on the map (presumably the closest match it can find - it points to another room with a just a N and a W exit). it is not disregarding the fact that this is a potentially 'hidden' exit. It works as discussed above with the E direction (and presumably NE etc), but it is still not working with UP or DOWN. I verified the DOWN case was not working either in another spot on the map which has a hidden down location.
Sorry - perhaps it is something simple!
Thanks!
Ulysses/Wod
Wod
CthulhuMUD
www.cthulhumud.com
A hugely entertaining MUD based on the horror writings of HP Lovecraft.
CthulhuMUD
www.cthulhumud.com
A hugely entertaining MUD based on the horror writings of HP Lovecraft.
Re: Generic Mapping Script
Mine was doing some weird things that made it work... so I fixed those, and finally replicated your issue, and then fixed it. I have updated the script in the first post, but not the package. Could you please check it out to see if it resolves the problem before I update the package file?
Re: Generic Mapping Script
Thanks! It's working now. I've got plenty of little things to learn, but so far so good. I'll have to get the hang of things like repeat named rooms and special entrance/exits. Speed walking too. Good enough for now.
Re: Generic Mapping Script
Yes! It's working. Totally Oar-some dude.Jor'Mox wrote: ↑Wed May 09, 2018 10:59 pmMine was doing some weird things that made it work... so I fixed those, and finally replicated your issue, and then fixed it. I have updated the script in the first post, but not the package. Could you please check it out to see if it resolves the problem before I update the package file?
Now to get those pesky mazes mapped
Thanks Jor'Mox, you're a legend.
-Wod
Wod
CthulhuMUD
www.cthulhumud.com
A hugely entertaining MUD based on the horror writings of HP Lovecraft.
CthulhuMUD
www.cthulhumud.com
A hugely entertaining MUD based on the horror writings of HP Lovecraft.
Re: Generic Mapping Script
Question about speed-walking:
Sometimes the glowing you-are-here pointer doesn't keep up with a speed-walk. I put a delay in which helps most of the time, but not always. At the end of the speed-walk I forced a 'find me' and that improves it most of the time if it fails mid-route, but again not always. Perhaps the delay needs to be a bit longer? Here is my function which I wrote for doing the walk:
Thanks!
Wod.
Sometimes the glowing you-are-here pointer doesn't keep up with a speed-walk. I put a delay in which helps most of the time, but not always. At the end of the speed-walk I forced a 'find me' and that improves it most of the time if it fails mid-route, but again not always. Perhaps the delay needs to be a bit longer? Here is my function which I wrote for doing the walk:
Code: Select all
function doSpeedWalk()
-- we can do a lot here, this fires when a room is double clicked on, and is intended to speedwalk to it
print("Path to " .. getRoomName(speedWalkPath[#speedWalkPath]) .. ": " .. table.concat(speedWalkDir, ", "))
delay = 0.5
for i = 1,#speedWalkDir do
tempTimer(delay, function()
send(speedWalkDir[i])
end)
delay = delay + 0.5
end
tempTimer(delay, function()
map.find_me()
end)
end
Thanks!
Wod.
Wod
CthulhuMUD
www.cthulhumud.com
A hugely entertaining MUD based on the horror writings of HP Lovecraft.
CthulhuMUD
www.cthulhumud.com
A hugely entertaining MUD based on the horror writings of HP Lovecraft.
Re: Generic Mapping Script
So, that sort of issue suggests that there is some problem tracking movement through one or more of the rooms along the designated path (i.e. it isn't recognizing the room when you walk into it). The timing of when commands are issued shouldn't make any difference at all, as the script keeps track of all movement commands sent in a table, and then removes them one at a time as rooms are entered, so speed walking should behave exactly like walking normally, or spamming commands in manually. So, to verify if this is the case, I suggest finding a problematic path, walking it manually to see if there are any problem rooms (under the same conditions obviously), and either fixing those issues, or coming back and letting me know that you don't see the same thing under both circumstances.
Also, just from a coding optimization standpoint, it might be a bit nicer to not have a ton of timers all running at once, to do that, you can use recursion, so that each timer creates the next one when it fires. Here is some code that would do that while producing the same result you should be getting with your current code:
Also, just from a coding optimization standpoint, it might be a bit nicer to not have a ton of timers all running at once, to do that, you can use recursion, so that each timer creates the next one when it fires. Here is some code that would do that while producing the same result you should be getting with your current code:
Re: Generic Mapping Script
As usual, thanks very much for your reply! Here are my observations:Jor'Mox wrote: ↑Thu May 17, 2018 6:45 pmSo, that sort of issue suggests that there is some problem tracking movement through one or more of the rooms along the designated path (i.e. it isn't recognizing the room when you walk into it). The timing of when commands are issued shouldn't make any difference at all, as the script keeps track of all movement commands sent in a table, and then removes them one at a time as rooms are entered, so speed walking should behave exactly like walking normally, or spamming commands in manually. So, to verify if this is the case, I suggest finding a problematic path, walking it manually to see if there are any problem rooms (under the same conditions obviously), and either fixing those issues, or coming back and letting me know that you don't see the same thing under both circumstances.
Also, just from a coding optimization standpoint, it might be a bit nicer to not have a ton of timers all running at once, to do that, you can use recursion, so that each timer creates the next one when it fires. Here is some code that would do that while producing the same result you should be getting with your current code:
- I chose two points on the map, reasonably far apart (by about 15 rooms) and walked manually between them in both directions, this was ok.
- Speedwalking between those rooms the tracking would go wrong most times, about 2 rooms before the end.
- Not all routes were the same, i.e. sometimes it picked a different route. However, whichever the route, the tracking would often (maybe always) fail on the 2nd or penultimate room. I ran this about 5 times in both directions, and the result is the same. Speed-walking a different route, but one which incorporated the rooms where the other routes were stalling, did not affect the behaviour - the room previously stalling were now ok and the lost-tracking rooms were now again near the new endpoints of the new route. This suggest something flawed in the script or a synchronisation issue between the running of the script and the mud output
- Replacing my script with yours made no difference to the behaviour (appreciate the coding tips though!)
- Setting delay = 0.1 made tracking fail much earlier on in the route, something like the 3 or 4th room.
- Setting delay = 1.0 (or indeed 2.0 - slow walking!) always made the tracking fail on the penultimate room
- Taking the delay out entirely, i.e. just having this function;
Causes the tracking to go wrong almost immediately, on the 2nd room in fact.Code: Select all
for i = 1,#speedWalkDir do send(speedWalkDir[i]) end
Thanks!
Wod-Ulysses.
Wod
CthulhuMUD
www.cthulhumud.com
A hugely entertaining MUD based on the horror writings of HP Lovecraft.
CthulhuMUD
www.cthulhumud.com
A hugely entertaining MUD based on the horror writings of HP Lovecraft.
Re: Generic Mapping Script
The trick is, there shouldn't be any difference between entering the movements manually as compared to sending them via this particular function. What happens if you just spam in directions REALLY fast? Also, what if you have some other bit of code inputing a number of movement commands for you all at once (say, an alias that walks you along a particular path by sending the commands all at the same time)?
Also, I didn't expect that changing to the code I gave would change anything, it was definitely just a "here is a coding tip" sort of thing.
Also, I didn't expect that changing to the code I gave would change anything, it was definitely just a "here is a coding tip" sort of thing.