Watch Your Step - Trapdoor.MUF

As with most programming projects this started out because I wanted to achieve a certain effect and there was no program to do it. Since I couldn't do it with some MPI tricks (because I have to move characters and their riders around) I started learning MUF. This is my first MUF program as a matter of fact. Nothing like starting out with leap rather than a tiny step.

I first started working on this program in January of 1999, maybe December of 1998. In either case I set it aside in a somewhat buggy but 'good enough' version on January 29th 1999. I finished it at while visiting my best friend in March of 2001. Kazin now has a pretty good idea what I'm like when I'm coding. Poor guy. :)

The source is available here. Do not alter or remove my contact information. If the code must be altered to meet requirements on your MUCK please contact me and supply a copy of the altered program as well as the name of the MUCK you installed it on.

Currently trapdoor.muf is available on the following mucks:

MUCK

trapdoor.muf

Realms #4235
Timescape #23764
FurryMUCK #191283

While there is sufficient documentation in the source to use the program an annotated version with the whys and wherefores follows:

This program allows an exit to be set to deliver the user to an alternate destination a certain percentage of the time.

Pretty simple idea. Take one exit and make it go to one of two rooms based on 'a roll of the dice.' I wrote it to construct a path that would have players slip off of it occasionally but it could be used for other things like a fun/haunted house or maze.

To use this program link the exit to this program

When you create your exit out of a room use @open exit=#12345 where #12345 is the db# of trapdoor.muf on your MUCK. For Timescape you'd use #23764 for instance.

And set the following props on the exit:

_trapdoor/chance:

This is the chance of the trapdoor being triggered expressed in a terms of a "one in" chance. If you set this property to 5 you'll go to your second destination once in five trips through the exit, or 20% of the time. If you set this number to 1 you will always go to the second destination of course, which makes the use of this program pretty silly. The number must be a whole number greater than 1 to work.

The following properties are for the primary destination. Set them for which ever room you want people to end up in more often.

_trapdoor/pdest/dest:

This is the db# of the primary destination room. You must include the # symbol with your number like this:
@set exit=_trapdoor/pdest/dest:#1234 (Where #1234 is your room db#.)

_trapdoor/pdest/succ: @success message.
_trapdoor/pdest/osucc: @osuccess message.
_trapdoor/pdest/odrop: @odrop message.

The above three properties are just like you would do them on a regular exit, they're just put in a different location. The success message is shown to the person going through the exit when they are going to the primary destination. The osuccess is shown to the people in the room they are leaving, and the odrop is shown to the people in the room they are walking into. Just like standard 'o' messages the name of the player going through the exit will prefix the osuccess and odrop messages.

Your osuccess might look like this:
@set exit=_trapdoor/pdest/osucc:edges along the rickety old bridge, making it safely to the other side.

Just like regular messages pronoun substitutions can be made:

%s = he/she/it (subject pronoun: she did it)
%o = him/her/it (object pronoun: it was done to her)
%r = himself/herself/itself (reflexive pronoun)
%p = his/her/its (possessive pronoun: her cat)
%a = his/hers/its (absolute pronoun: the cat is hers)

To capitalize just capitalize the substitution: %S = He/She/It

You set the same properties for the secondary destination, just replacing pdest for sdest leaving you with these properties:

_trapdoor/sdest/dest:#123456 The room db# with # sign.
_trapdoor/sdest/succ: @success message.
_trapdoor/sdest/osucc: @osuccess message.
_trapdoor/sdest/odrop: @odrop message.

Now for things to set on the rooms:

Both destination rooms must be set _trapdoor_OK?:yes for the program to work. This is a security feature to prevent the program from being used to get around room bans and locks.

Go into each room and type: @set here=_trapdoor_OK?:yes
OR
Use the rooms db#s to set the property: @set #23456=_trapdoor_OK?:yes

Set the source room and both destination rooms Jump_OK. Some MUCKS make all rooms jump_ok by default. It might not be required to make the program work but it's simple way to avoid problems to just set the rooms jump_ok first.

Go into each room and type: @set here=j
OR
Use each room's db#: @set #23456=j

Do not set the @success, @osuccess, or @odrop messages on the exit. While it shouldn't cause functional problems it will give you double messages when people use the exit.

So far as I can tell this last step is only needed for Realms:

For the exit to work with riders you must override the lock checking of RIDE in both destination rooms. To do that set the property _yesride to yes.

Go into each destination room and type: @set here=_yesride:yes
OR
Use each room's db#: @set #23456=_yesride:yes

Code Main

 

©1997-2001 Lynn A. Davis