Mudlet mapper

From icesus
Jump to navigation Jump to search

Mudlet's mapper has a really bad document. So here is the instruction on how to get the mapper work.

Setup

First, when you type `map basics`, it tells you that you need two things to make the mapper to work, that is, `room name` and `exits`. The `exits` are captured by a trigger in generic_mapper>English trigger group>English exits trigger and indicate that you are in a new room. So each time the exits are captured, the mapper will assumed that you've entered a room and will use `name_search()` function to get the room name. But this work flow could be wrong in icesus since

  1. we don't have a room name in room desc
  2. even we have a room name, we can't detect it correctly if there is no distinct between it and normal room desc
  3. random texts may ruin the process.

Therefore we need to modify this based on `map config custom_name_search`.Now my strategy is use exits to trigger creator room and get the right room name.

Below is the instruction show to setup it up

Change the behavior of Exit trigger

First disable the mapper's default `English Exits Mapper`, then add a trigger like this

1.png
 ^\s*The (?:only )?obvious exit[s]? (?:is|are):? (.*)
 room_exits = matches[2]
 room_name_search = true
 send("creator room",false)

Use `creator room`

Creator a trigger like this

Mapper 2.png
 ^'(.*)' is coded by .* and is part of the (.*) area\.$
 roomname = matches[2]
 areaname = matches[3]
 
 if room_name_search then
   room_name_search = false
   if areaname ~= "Outworld" then
     raiseEvent("onNewRoom", room_exits or "")
   end
 end

Make a new room_search() function

Make a new script like this and type `map config custom_name_search true`

 function mudlet.custom_name_search(lines)
   return roomname 
 end

How to use

When you enter a new area, you can type `start mapping <areaname>` to start mapping. For typical directions such `n`, `s` etc., the mapper will work fine. Now for special exits like `enter`, use `add portal <special room command>` to creator a new room, note that after this the new room coincide with your previous room on the map window. Now type `shift <direction>` to move the new room, for example, `shift e`.

For rooms with a closed door, when you unlock it, you can type `add door <direction>` to add the exits to the room.

If you move and blocked by some thing, type 'lua raiseEvent("onMoveFail")` to indicate a fail move or write corresponding text as a trigger.

Some problem

In some places, `creator room` outputs two lines, may cause a problem

If you have other problems, feel free to contact mmiao!