i have set it as RandomMove cuz it was sudden NPC's lead and don't remember if there was a 'entering to N' type of line.
for the moment, im away from Avatar Mud.
instead, i have been trying to delete ",
" (comma) and "and
" from matches of Exits trigger.
target mud is The Two Towers MUD this time.
t2t mud has 2 mode for expression. verbose and brief.
default exits are "N W S E U D", enter, out and cardinal ways.
in verbose mode, room expression is like this. (no color separation in real screen)
This is the main street of Bywater
. To your north you see the rathermain
street of Bywater
run-down looking town hall. The main road also makes a turn to the east
and continues. To the west stands the Hobbiton courthouse.
The sun shines down from directly overhead.
A light wind blows from the southwest, and clouds form overhead.
The only obvious exits are west
in brief mode, (again, no color separation in real screen)
Bywater's main street
A playful hobbit child
as combined exits trigger, (usually im playing in brief mode. but when "look"ed, room text becomes to verbose temporarily.)
\((.*)\) --for brief mode
^\s*The only obvious exits? (?:are|is) (.*)\. --for verbose mode
default trigger gave me a hint, but string.gsub replaces only 1 strings. and this script is to delete "and" only.
so im getting a result of 'west,
east north' (verbose) or 'w,
e n' (brief)
there are commas
attached to west,south and w,s.
so, those are not recognized as exits.
additionally, there are so called "named direction" like "bar" or "counter" in the room. which has no exit and is just interactive like shop NPC but counted and shown in exits line/part.
so, i have no idea how should i do.
simplest way might be to limit to only conventional exits. but there should be a case when this could be a door with direction.
also, swim and boat seems to be separated way.
i have tried many things to make Exits trigger working like using string.find(failed/not fully understand) or just making a table to call from within string.gsub (currently working on).
my failing script
should i make a function instead ?
Room Name, Prompt and on Failed Move triggers seems to be working properly.
but there was a room of no-name in verbose mode.... im getting headache.
Room Name trigger
patterns(4 and verbose type are increasing):
^(.+)\( --for brief
^\s+This is the (.+)\. --for verbose
^\s+You now stand in the (.+)\. --for verbose
^\s+You are on the (.+)\. --for versose
map.prompt.room = matches
Failed Move Trigger
You can't go that way! --exact matching
^The .+ is closed.
i found a way. simple stack of string.gsub did the job.
script became like this.
Exits Trigger(seems ok ?)
\((.*)\) --for brief
^\s*The only obvious exits? (?:are|is) (.*)\. --for verbose
i could execute "start mapping <new area name>" command and mapper starts working at last.
but there are no exits drawn on room and strange thing is happening.
the echoes of exits are shown like this. (underline represents blank space. since its automatically cut here.)
north_east__south <<< between east and south, originally where "and" was put, has 2 blank spaces.
its same with brief type.
seems there are still some mistakes in somewhere.