Simple bit of Code to Help Builders ~ Automatic Parent Setting

Submitted by MrWigggles on Sat, 2011-10-15 00:48

Building, will probably always be one of the more tedious and time consuming aspects for a mush. Though, much to Penn's credit, they've taken great strides to reduce the amount of commands that you have to type in, in order to build.
However, the very important parents, still need to be set per room built, and thats a separate command.

Its a separate command, that can be done automatically however.

How?

With the Event System.
The Event System, allow for soft code to happen, triggered by hardcode events in Penn. Its quite a marvelous system they've recently introduce into Penn.

@create Event Handler
@set Event Handler=Wizard

@config/set event_handler=[num(Event Handler)]

&object`create Event Handler=@switch type(%0)=room,{@force %#=@parent %0=[xget(%#,rparent)]}

Now, what that &object`create will do is, at every instance a room is created, that it'll set the room parent, as the attribute on the builder, rparent.

Now on the Builder, you'll want to include the attribute &rparent which will hold the DB# of the room parent you want to use.

As the Builder, digs the grid, the room parent will be set atomically, reducing the work load of the builder, removing a little bit more of the tedium.