Automatic success messages on exits

OOC Notes
This is a transfer of an old forum post. It is has not been wiki formatted.


I have created a "Smart Exit Parent" that you can @parent your exits to, which will generate automatic @succ/@osucc/@odrop messages that should be sensible in most cases. This post explains how to use it.

Prerequisite:

- Type this (one time only):

&CMD_EID me=$eid *:@switch locate(me,%0,e)=#-1,,#-2,,{@parent #$=#11;think [ansi(h,name(#$))](#$[flags(#$)])%rDESC: [objeval(#$,s(get(#11/Desc)))]%rSUCC: [objeval(#$,s(get(#11/Succ)))]%rOSUCC: [objeval(#$,s(get(#11/OSucc)))]%rODROP: [objeval(#$,s(get(#11/ODrop)))]}

- Type this (one time only): @set me=!no_command

After you have completed the above setup procedure, you can now automatically set the exit messages for an exit with a simple command. One caveat:

- The exit's @name must start with <destination>;<direction-alias>;<direction>. For example: Village Center;N;North, or Yuriba Gym;E;East.

To set the exit messages for an exit after you have satisfied the above, simply type "eid <exit>", for example, "eid e". This will parent the exit to the Smart Exit Parent, and show you what the exit messages would be. (If you are not satisfied with these exit messages, you can set them manually and they will override the default.)

To indicate that a room is outdoors, @set here=light To indicate that a room's name should not be prefixed with "the", @set here=opaque



The code for the Smart Exit Parent is on #11. Type 'ex #11' if you wish to see the code (it is complicated).

Documentation for the Smart Exit Parent:

- All rooms without the LIGHT flag are considered indoors. - All rooms with the LIGHT flag are considered outdoors. - <src> is the name of the room containing the exit. It is prefixed with "the" unless that room is set OPAQUE. - <dest> is the name of the room that the exit leads to. It is prefixed with "the" unless the room is set OPAQUE. - <dir> is the direction of the exit (e.g. "north"). It is taken from the third part of the exit name. - <opp-dir> is the opposite direction of the exit. It is derived from <dir> (only works for north, south, east, west, northeast, northwest, southeast, southwest). - The name of a room can be overridden by setting the NAME attribute on the room.

You can override the values of the above variables by setting the SRC, DEST, DIR and OPP_DIR attributes on your exit.

Exits going from outdoors to indoors (i.e. exiting a building):

 SUCC: You enter the <dest> to the <dir>.
 OSUCC: enters the <dest> to the <dir>.
 ODROP: enters the <src> from the <opp-dir>.
 DESC: An entrance into <dest>.

Exits going from indoors to outdoors (i.e. entering a building):

 SUCC: You leave the <src>, heading <dir>.
 OSUCC: leaves the <src>, heading <dir>.
 ODROP: comes out of the <src> from the <opp-dir>.
 DESC: An exit out of <src>.

Exits going from indoors to indoors (i.e. within a building):

 SUCC: You go to the <dest> to the <dir>.
 OSUCC: goes to the <dest> to the <dir>.
 ODROP: comes from the <src> to the <opp-dir>.
 DESC: (none)

Exits going from outdoors to outdoors (i.e. walking around outside):

 SUCC: You go <dir> to <dest>.
 OSUCC: goes <dir> to <dest>.
 ODROP: comes from <src> the <opp-dir>.
 DESC: A street leading to <dest>.
Retrieved from "https://www.yuriba.com/mwiki/index.php?title=Automatic_success_messages_on_exits&oldid=12115"