[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Plugins
. . -> [Subject]  Mapper

Mapper

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Copycatnebula   (5 posts)  [Biography] bio
Date Wed 10 Aug 2022 08:37 PM (UTC)
Message
I am trying to think through how I would create a function for the mapper that would allow validation if directions were possible from a roomid.

e.g. if the path I got was n, e, s, e, u is that possible from that room

mapper_validate ROOMID PATH

and have it return either the resultant room ID OR not possible.

Anyone have thoughts on how this best works with the functionality already implemented. I see a lot of room1-room2 path discovery but not a lot of if this path is possible from room 1 type capability. Maybe I am missing it.
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #1 on Wed 10 Aug 2022 11:08 PM (UTC)
Message
Starting from your current room and the first direction, check if the direction can be moved from that room, if so, look at the room in that direction and check the second direction, then the next room and the third direction, and so on. If you get through all of the directions, then yes, otherwise no.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Copycatnebula   (5 posts)  [Biography] bio
Date Reply #2 on Thu 11 Aug 2022 01:47 AM (UTC)
Message
Fiendish said:

Starting from your current room and the first direction, check if the direction can be moved from that room, if so, look at the room in that direction and check the second direction, then the next room and the third direction, and so on. If you get through all of the directions, then yes, otherwise no.


I take this reply to mean there is no existing functionality within the mapper that I can leverage given a room id to determine where a path goes? I would have to custom code the entire capability vs utilizing existing function calls.
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #3 on Thu 11 Aug 2022 03:31 AM (UTC)

Amended on Thu 11 Aug 2022 03:36 AM (UTC) by Fiendish

Message
Correct. What do you want it for anyway? It doesn't seem like it would be very useful on my MUD. What circumstance on yours calls for this?

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Copycatnebula   (5 posts)  [Biography] bio
Date Reply #4 on Thu 11 Aug 2022 04:48 AM (UTC)

Amended on Thu 11 Aug 2022 04:06 PM (UTC) by Copycatnebula

Message
Fiendish said:

Correct. What do you want it for anyway? It doesn't seem like it would be very useful on my MUD. What circumstance on yours calls for this?


we are given random directions from a specific map location and need to find the room things are hidden in. Meaning given a set of possible starting points it would be nice to be able to calculate the possibilities.

Another is knowing which path your target took when viewing them with a spell it would be nice to quickly plug in the viewed roomID and the path they took to run and get back a room id to goto to find them.

The third reason is for validating speed paths that are created without actually walking them (which can be dangerous in some areas of our mud). So i can make a speedwalk and validate it from the room to ensure that I arrive where I expect.

Thanks for replying. I just wanted to make sure there wasn't built in functionality to harvest here vs writing an entirely new plugin. Sounds like i need to build a searcher that can iterate the directions and either get back "not possible" or "roomid"
[Go to top] top

Posted by Nick Gammon   Australia  (22,985 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Thu 11 Aug 2022 08:46 PM (UTC)
Message

There is no such function, ie. “is this path valid?”.

However it wouldn’t be hard to write.

The function get_room (id) returns information about a room, including its exits. So you would do something like:

  1. id = starting_room
  2. n = 1 (first exit)
  3. room = get_room (id)
  4. see if room.exits [exit_list [n]] exists
  5. if so, add 1 to n, and make id = the room that the exit led to
  6. go back to (3) above until the list of exits is exhausted.

- Nick Gammon

www.gammon.com.au, www.mushclient.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.


6,286 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]