|
kognesty Newbie
Joined: 08 Jan 2001 Posts: 8 Location: USA
|
Posted: Fri Jul 12, 2002 12:39 am
Automapper, exits' line complication. |
In my mud, the exits' line appears like this:
[Exits: (north) east]
And occassionaly like this:
[Exits: north east west]
The second line is caught easily and causes no trouble, but the first for some reason prevents the room from even being mapped.
In the MUD the (north) notation indicates a door in that direction that is visible, but causes a lot of trouble for the automapper.
Just so you understand what I've tried and worked with a bit. I attempted to use %replace to just remove the right and left parenthetical marks and then tag the altered variable exits as exit.
I use the following trigger:
Pattern:
^~[Exits: &{exits}~]
Value:
#T- description2
#SUB {%ansi( high, cyan)~(%ansi( white)Exits: %ansi( grey)@exits%ansi( high, cyan)~)}
#TAG desc,exit {@desc} {@exits}
#VAR exits {}
#T+ description
I tried removing the #SUB to see if it was causing the problem, I tried adding:
#VAR exits %replace( @exits, "(", "")
#VAR exits %replace( @exits, ")", "")
before the #TAG line but that didn't work.
The entire process of capturing my room's name, desc, and exits is a real bear. Here's a sample of the general room layout seen with my current script in operation and without color:
Training Area of the Valius Gellerus
[ ] Elves adorned in the armor of the company spar each other
[ % % % ] here, preparing for an inevitable conflict and raid on
[ %<">" @] Yrenelania. The commanders are busily chewing out their
[ ] recruits and instructing the students on stealth and hit and
[ ] run tactics. These are elves strong points, as they are
nimble and quickfooted especially in the forest.
(Exits: north east west)
A new recruit to the Valius Gellerus is training in the grounds.
A new recruit to the Valius Gellerus is training in the grounds.
A new recruit to the Valius Gellerus is training in the grounds.
A new recruit to the Valius Gellerus is training in the grounds.
A new recruit to the Valius Gellerus is training in the grounds.
A new recruit to the Valius Gellerus is training in the grounds.
If anyone can figure out how to get everything capture correctly including the door exit line, please post it so I can try it. Any suggestions welcome? |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Fri Jul 12, 2002 1:12 pm |
Along the same lines of what you have tried, but a bit simpler, try:
#TRIGGER {~[Exits: (*)~]} {#VAR exits %replace(%replace("%1", "(", ""), ")", "");#TAG exit {@exits}}
Also, always remember to reconfigure when creating/modifying a trigger that uses #TAG.
Kjata |
|
|
|
kognesty Newbie
Joined: 08 Jan 2001 Posts: 8 Location: USA
|
Posted: Fri Jul 12, 2002 8:57 pm |
Excellent, I like simplier. Now because I know already which exits are doors (well obvious ones) could it be possible, or how would you go about doing a #door command based on the appearance of (north) (south) . . . etc.?
I know I could brute force it, simply make a bunch of triggers corresponding to (north) (south) . . . etc. after the exits line trigger but there must be a simplier way. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Fri Jul 12, 2002 9:50 pm |
You're right, there is a simpler way. To do that, we just go through all the words that are enclosed in parenthesis in the exits and use the #DOOR command with them. This should do it:
#ALIAS createDoors {#WHILE (%pos("(", @oldExits)) {#VAR pos %pos("(", @oldExits);#VAR oldExits %delete(@oldExits, @pos, 1);#VAR newDoor %copy(@oldExits, @pos, %pos(")", @oldExits) - @pos);#DOOR @newDoor;#VAR oldExits %delete(@oldExits, %pos(")", @oldExits), 1)}}
#TRIGGER {~[Exits: (*)~]} {#VAR oldExits "%1";#VAR exits %replace(%replace("%1", "(", ""), ")", "");#TAG exit @exits;createDoors}
Notice that the alias is called after sending the #TAG, to let the mapper create the exit links first.
Kjata |
|
|
|
kognesty Newbie
Joined: 08 Jan 2001 Posts: 8 Location: USA
|
Posted: Fri Jul 12, 2002 10:10 pm |
There was one error in your suggestion that I could fix, and one that I can not.
The first was that newDoor had a ( in front of the direction, easy enough I added, a %replace() function to get rid of it after it was copied.
The other error, is strange to say the least. The door is created before the new room, so it is added to the currently selected room then I get a flashing mouse/hour glass until I use my macro F5 (clears all the variables involved with the mapper script), then the new room is created just peachy, without the door.
#CLASS {Map}
#ALIAS recall {#RECALL;recal}
#ALIAS mapingon {#VAR desc {};#VAR exits {};#VAR oldexits {};#VAR name {};#VAR t_desc {};#T- exit2;#T+ exit;#T+ description;#ECHO Map Mode.}
#ALIAS mapingoff {#T+ exit2;#T- description;#T- exit;#ECHO Follow Mode.}
#ALIAS climb {}
#ALIAS createDoors {#WHILE (%pos( "(", @oldExits)) {#VAR pos %pos( "(", @oldExits);#VAR exits %delete( @oldExits, @pos, 1);#VAR newDoor %copy( @oldExits, @pos, %pos( ")", @oldExits) - @pos);#VAR newDoor %replace( @newDoor, "(", "");#DOOR @newDoor;#VAR exits %delete( @oldExits, %pos( ")", @oldExits), 1)}}
#VAR DESC {The sounds of the forest are quite relaxing. Does not even
seem as though a horrific slaughter took place here not long
ago. It feels as if there are other people around, someone
with watching eyes. The elves surely did not leave themselves
open to another attack once again.
}
#VAR t_desc {open to another attack once again. }
#VAR name {Path through the Sylvan Wood}
#VAR exits {north east south west}
#VAR oldexits {north east south west}
#VAR pos {1}
#VAR newDoor {east}
#TRIGGER {~[NEWBIE ALERT~]} {#NOMAP}
#TRIGGER {~[Music~]} {#NOMAP}
#TRIGGER {~[Answer~]} {#NOMAP}
#TRIGGER {~[Grats~]} {#NOMAP}
#TRIGGER {~[Newbie~]} {#NOMAP}
#TRIGGER {~[ ? ~]} {#NOMAP}
#TRIGGER {~((*)~)} {#NOMAP} "" {disable}
#TRIGGER {~[OOC~]} {#NOMAP}
#TRIGGER {You have to climb to go in that direction.} {#NODIR;#NOMAP}
#TRIGGER {You need a boat to go there.} {#NODIR;#NOMAP}
#TRIGGER {You aren't allowed in there.} {#NODIR;#NOMAP}
#TRIGGER {The %1 is closed.} {#NODIR;#NOMAP}
#TRIGGER {Alas, you cannot go that way.} {#NODIR;#NOMAP}
#TRIGGER {Nah... You feel too relaxed...} {#NODIR;#NOMAP}
#TRIGGER {In your dreams, or what?} {#NODIR;#NOMAP}
#TRIGGER {You climb the} {#OK}
#TRIGGER {It's already open.} {#OK}
#TRIGGER {Bids start at} {#NOMAP}
#TRIGGER {You rest.} {#NOMAP}
#TRIGGER {~[AUCTION~] (*)} {#NOMAP}
#TRIGGER {~[AFK~]} {#NOMAP}
#TRIGGER {~[IC~]} {#NOMAP}
#TRIGGER {^~((*)~|(*)~|(*)~)} {#NOMAP}
#TRIGGER {^~((*)~|(*)~|(*)~|(*)~|(*)~|(*)~|(*)~)} {#TAG prompt}
#TRIGGER "description" {^~[&9~]} {#VAR name {};name = %line2;#TAG name @name;#VAR desc {};#T- description;#T+ description2}
#TRIGGER "exit" {^~[Exits: (*)~]} {#T- description2;#SUB {%ansi( high, cyan)~(%ansi( white)Exits: %ansi( grey)%1%ansi( high, cyan)~)};#VAR oldexits "%1";#VAR exits %replace( %replace( "%1", "(", ""), ")", "");#TAG desc,exit {@desc} {@exits};#T+ description;createDoors}
#TRIGGER "description2" {^&12&{t_desc}} {#ADD desc {@t_desc %cr%lf}} "" {disable}
#KEY F5 {mapingon}
#KEY ALT-F5 {mapingoff} "" {chain}
#CLASS 0
#CLASS {Map|exit2}
#TRIGGER {^~[Exits: (*)~]} {#SUB {%ansi( high, cyan)~(%ansi( white)Exits: %ansi( grey)%1%ansi( high, cyan)~)};#OK}
#CLASS 0
And yes, thanks for all the help. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Fri Jul 12, 2002 10:36 pm |
Well, then, you are going to have to call the alias yourself after you move into the room and it is created. You could create a button to make this task easier.
Kjata |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Jul 12, 2002 11:23 pm |
An expression type trigger might work, but I believe I had some nasty problem with it in the past. On that note take precautionary measures like backing up and then saving setting before you attempt to move with it active.
#TRIGGER {%lastdir=%null} {CreateDoors}
You will have to set the type to expression, also you may want to disable it most of the time and enable it only when doors are detected. |
|
|
|
kognesty Newbie
Joined: 08 Jan 2001 Posts: 8 Location: USA
|
Posted: Sat Jul 13, 2002 8:22 pm |
Eureka! It was so simple too. In the createDoors alias, the altering line #VAR %delete() and so forth, the variable name is exits. It should have been oldexits! How 'bout that. Works like a charm now, and all my worries are gone, the script functions like it should and I have some mapping to do.
Thanks for all the help, and I like that trigger expression idea but like you said it would be tricky to use. |
|
|
|
|
|
|
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
|
|