Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Plugins ➜ Mapper with multiple potential exit lines

Mapper with multiple potential exit lines

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


Posted by Ahhh_reptar   (2 posts)  Bio
Date Tue 10 Jul 2018 07:17 PM (UTC)
Message
I'm playing a mud where we aren't supplied with room numbers, and each exit will get its own line. Each room is set up like this.

Industrial Way 
----------Cowboy Bebop------------------------------------------------------
This is the industrial pathway, where the factories and refineries are
located. There are shops that sell goods that can be used to create
usefull goods. There are sounds of clanking metal, bending metal  and
hissingnoises as the factories are in full working condition. The large
buildings and tall smokestacks dominate  the area and they seem foreboding
and gloomy. 
-------------------------------------------------------Space Cowboy---------
Obvious exits:
North - Industrial Way
East  - An Assembly Room
South - Industrial Way
West  - Clothing Manufacturing
 A male citizen wanders the streets of the colony
 A male citizen wanders the streets of the colony

Every mapper I've seen expects all the exits on one line, and I'm not sure how to change them so the mapper starts working for this game.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 10 Jul 2018 08:54 PM (UTC)
Message
Instead of looking for one "exits" line just look for a batch of them, starting with the "Obvious exits:" line.

Once you get a line that doesn't start with a direction (eg. North, South, East, West) followed by a hyphen then you know you have got all the exits and at that point you can add them to the mapper database.

Template:faq=37 Please read the MUSHclient FAQ - point 37.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Ahhh_reptar   (2 posts)  Bio
Date Reply #2 on Tue 10 Jul 2018 10:33 PM (UTC)
Message
I looked over that, but I'm not sure what to change or how. I'm very inexperienced with coding.
Top

Posted by Chaotzin   (19 posts)  Bio
Date Reply #3 on Thu 19 Jul 2018 09:39 PM (UTC)

Amended on Thu 19 Jul 2018 09:40 PM (UTC) by Chaotzin

Message
I imagine you'd have to collect your exit info with multiple triggers like Nick is suggesting.

This is pretty rough, but I'd say your three triggers would match on something like...

Start capturing:
^Obvious exits:$


Use this one to enable the next two triggers. You could assign them to a trigger group and use:

EnableTriggerGroup ("capture_group", true)


Your trigger that captures the exits then matches:
^(North|East|South|West)  - (.+?)$


And finally when a line arrives that isn't an exit:
^(?<!North|East|South|West).+?$


You'd use this match to tell the script that you've now collected all exit info and it can stop capturing with those two triggers:
EnableTriggerGroup ("capture_group", false)
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #4 on Sun 09 Feb 2020 05:31 AM (UTC)
Message

The Learning Mapper I wrote recently can handle multiple exit lines. See Learning Mapper reply #8 for some examples, in particular look at the entry for Aber (TerraFirmA) and also Coffee MUD.


- Nick Gammon

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


17,454 views.

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

Go to topic:           Search the forum


[Go to top] top

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