Simple bit of Code to Help Builders ~ Managing Long Room Names

Submitted by MrWigggles on Sun, 2011-10-16 05:39

When you're building, occasionally the name of a room, can get quite long, and the length of the room name can be awkward to deal with. In my experience, the long room names, comes from, by denoting an interior room of a sub set of an area.

Example:

Rome Coliseum of Rome - Gladiator Ready Room

A possible solution, is by simply making the Coliseum its own Zone, which may be a good solution, if the Coliseum is large enough to be its own grid area. Though, if it's just a sub area of the Zone, then it seems a little silly to make it, its own Zone

So, then lets treat it as its own sub area, a Sub Zone. By making a Sub Zone, we don't have to much around with zone control issues, or locks, and it allows us to break the long room name, into something more manageable. Now, that Coliseum of Rome is a subzone, we name use it in the room parent, or where, with greater ease, then the lengthy room name.

This is a very simple piece of code.

@create Builder Commands
&cmd-subzone Builder Commands=$+subzone *: @break and(haspower(%#,builder),gt(strlen(secure(%0)),0))={@nspemti %#=Game: You've set your Subzone to [secure(%0)]. ; &dat-subzone %#=[secure(%0)]} ; @nspemit %#=[if(haspower(%#,builder),Game: You need to enter a subzone. ,Huh? \(Type "help" for help.\))]
&cmd-clearzone Builder Commands=$+subzone/clear:@break haspower(%#,builder)={@nspemit %#=You've cleared your Subzone. ; &dat-subzone %#=};@nspemit %#=Huh? \(Type "help" for help.\)
&cmd-setzone Builder Commands=$+subzone/set: @break and(haspower(%#,builder),hasattrval(%#,dat-subzone))={@nspemit %#=Subzone Set. ; &subzone %L=[xget(%#,dat-subzone)]};@nspemit %#=[switch(haspower(%#,builder)[hasattrval(%#,dat-subzone)],0*.Huh? \(Type "help" for help.\),10,Game: Please set your subzone.)]

Now, if you're employing the automatic room parent setter, via the Event System, then instead of using the command +subzone/set, we can add a simple addition to the Parent Setter, to also set the Subzone, if it's present on the Builder.


&object`create =@switch type(%0)=room,{@parent %0=[xget(%#,rparent)] ; th [if(hasattrval(%#,dat-subzone),[attrib_set(%0/subzone,xget(%#,dat-subzone))])]}

If this is used, then as the Builder is digging the grid, it'll now set the room parent automatically, and if a subzone is set on the Builder, it'll also set the subzone.

Now, for room parents, locks, and other possible Mu* systems, can make use of the &SubZone attribute, being a sub area of the Zone, with its own interior rooms.