|
Darkflame808 Beginner
Joined: 21 Sep 2010 Posts: 22
|
Posted: Fri Jan 14, 2011 12:05 am
Allow mapper to read a room with 'All directions' as the exit. |
Hello, I am trying to fine tune my mapper.
I have basically disected this script from the one found on this board and have managed to make up a working script that detects about 80% of the rooms within the city. However 0% of the rooms in the overworld.
In a city, the exits are listed as
Obvious exists are: north, south, east and west.
This is not a problem the mapper has no problems tagging this.
However in the overworld exits are listed simply as this.
Obvious exits: All directions
in which case I can go north, south, east, west, northeast, southeast, northwest, southwest.
Basically i'd like the mapper to notice that phrase "All directions" and translate that into exits meaning NW,N,NE,E,SE,S,SW
If I run into this room as it stands now the mapper will que up the command that was sent but will not update it the mapper till it recognizes another room that has a word describing the exit.
If I start off from a room with "All directions" the mapper will not create new blocks even if I type n s e w etc until it hits a room with exits it recognizes. in which case it'll draw the room and create half links for the untested exits.
Any help would be appreciated.
Here's an example of a room that does work.
Code: |
Widow's House:
You are in an old house. It is rather small but quite cozy. There is a
desk and a couch in the middle of the room. You can see two doors further
into the house, one of which appears to lead to a kitchen whilst the other
hides a room behind it. There is a crack on the floor large enough to see a
underground cavern beneath. However, it is too small to enter. The door to
the street is to your west.
Obvious exits are: west
|
And here is one that doesn't.
Code: |
You are walking on a roadway.
Obvious exits: all directions
|
Lastly, here's the script i'm using that works for majority of the towns i'm in.
Code: |
<trigger name="tRoomInfo" type="Command Input" priority="3810" trigontrig="false" id="381">
<pattern>^{@movecommands}$</pattern>
<value> minimap = ""
rdesc = ""</value>
<trigger type="Manual">
<pattern>^(*)$</pattern>
<value> #if (%begins(%1," Obvious exits are: ")) {
//this is the exits line
#state tRoomInfo 0
#call %match(%1," Obvious exits are: (*)",@rexits)
} {
#if (%begins(%1," Obvious exits: ")) {
//this is the exits line
#state tRoomInfo 0
#call %match(%1," Obvious exits: (*)",@rexits)
}
}</value>
</trigger>
<trigger name="">
<pattern>[b]whatever comes after exits line[/b]</pattern>
<value> #tag desc %expandlist(@rdesc,%cr)
#tag exit @rexits</value>
</trigger>
</trigger>
|
I am not sure if this has to do with the fact there is a pattern that says whatever comes after exts line. that isn't defined?
I tried putting > there but it still didn't work.
Thanks again. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4689 Location: Pensacola, FL, USA
|
Posted: Fri Jan 14, 2011 12:15 am |
I notice that the two lines have a distinct difference, the word 'are' before the colon... you could probably trick the mapper with a high priority trigger and a specific #TAG trigger
#TR {Obvious exits: all directions} {
#NOMAP
#GAG
#SAY { Obvious exits are: north, south, east, west, etc}
} "" "priority=1"
#TR {Obvious exits are:} {#TAG exit}
P.S. make sure to reconfigure the mapper every time you define your own #TAG triggers |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Progonoi Magician
Joined: 28 Jan 2007 Posts: 430
|
Posted: Fri Jan 14, 2011 1:04 am |
Another possibility would be just to manually insert the information #tag would process.
Something like
Code: |
#trigger {Obvious exits are: (*)} {#if (%1="all directions") {$exits=north|west|east|south|etc;#tag $exits]
|
|
|
_________________ The Proud new owner of CMud.
--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
-------------------------------- |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri Jan 14, 2011 3:18 pm |
A third possibility is to create a separate configuration file which only runs in the Overworld.
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Jan 14, 2011 4:50 pm |
You wouldn't need the #say at all, since you can specify the content of the #TAG:
Code: |
#if (%1 = "all directions") {
#tag exit {north, south, east, etc}
} {
#tag exit %1
} |
The only time this wouldn't work is when GMCP were involved. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Darkflame808 Beginner
Joined: 21 Sep 2010 Posts: 22
|
Posted: Sat Jan 15, 2011 6:32 pm |
Hi Matt,
Thanks for the code. I've never really been to good with script writing as you may have saw above it was your code that I butchered to attempt to make things work. :D Thanks for all the guidance you give us you're script was the reason why I purchased cmud and have thus far been very happy with it.
Rahab,
That is one path that I have never considered before! I do notice that when tinkering with the settings, I can map overworld perfectly and with another set of settings I can map cities pretty much 99% spot on.
May I ask, how do I go about setting up the mappers so they work in their respective areas?
Right now, I have a file called city mapper.txt that has the configuration stored (for when I screw up and need to return back to a working state).
Could I make one called overworld and have cmud call that file up when I transfer to that zone?
I see I can execute a script upon entering the zone. Is there a way to make it say use this config file?
Thanks! |
|
|
|
Darkflame808 Beginner
Joined: 21 Sep 2010 Posts: 22
|
Posted: Sat Jan 15, 2011 7:26 pm |
I think I found the answer, I think it's #config :) God bless the search and fail on me
|
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|