I am trying to get started creating my world, but I have already run into some difficulty. I want to set an object as the Master Room Parent, but I am unaware of the code. I know I once was on a blooming mush, and there were lines in the code like:
&DESC_HEADER Master Room Parent= [ansi(bh,[left([repeat(~-_-,20)],79)])]
And I know what that does, but when I set it on the soon to be parent, and then parent a room to it, it does nothing. do you think you could point me in the right direction?
-Arathor
The &DESC_HEADER code was part of other softcoded commands which formatted and displayed the description of the room.
Many older room parents put their own code in the parent's @DESCRIBE attribute, forcing you to put your description in another, similarly-named attribute such as &DESC1.
Newer patchlevels of PennMUSH make this unnecessary if the room parent makes proper use of the following attributes:
@NAMEFORMAT - Overrides the display of the roomname. Can contain lots of softcode to dress up the room name, show zone names, and anything else youd like to display before the description.
@DESCFORMAT (sometimes known as @DFORMAT on games that want to avoid name conflicts with @DESCRIBE) - overrides the display if the Description itself, allowing the room parent to control colors, wrapping, and whatever else you can add softcode for. Putting your formatting softcode here lets the builders just put plain descriptions in @DECRIBE without lots of extra work.
@EXITFORMAT - Inhibits the display if exits from the room, allowing you to add code that displays the exits formatted in whatever way you choose.
@CONFORMAT - Unhibits the display of room contents, allowing you to write code that displays the contents in any way you choose. You'll have to add your own support for the DARK and LIGHT flags, however.
Proper use of the above attributes can allow builders to build normally without having to use custom attributes or commands or set additional flags or do anything out of the ordinary, yet *still* benefit from all the formatting code of the room parent.
On the MUSH I help administrate, we've added some attributes for parents and zones:
@APARENT - Triggered on the *parent* when a new child is added. Allows the parent to perform setup steps or even allow the parent to determine if the child is valid and detach it if not.
@ACHZONE - Triggered on the *zone object* whenever a new item is added to the zone. Since a new room is automatically @Chzoned upon creation to the zone the builder is standing in, you could add code that would automaticall set up parents and any default attributes.
The end result could be a room that needs only digging and describing, while softcode fills out all the rest of the details with defaults. Then you can change anything you want just by overriding the defaults...