Building: A Basic Tutorial
-
A basic "how to" of how to build for Tinymux (potentially tinymux). Rhost / Penn may have different commands, but Tinymux/tinymush are pretty similar.
Contributors: @Cobaltasaurus, @2mspris, @Glitch, @Sponge
Starting: How do I make a room?
Starting: How do I connect rooms?
Starting: How do I link a room?
Starting: How do I describe a room?
Starting: How do I describe an exit?
Starting: What else do exits need?
Starting: How do I move rooms?
Starting: How do I parent a room?
Room Parent: How do I create a room parent?
Room Parent: How do I set up a stock room desc?
Room Parent: How do I format a player list?
Room Parent: How do I format an object list?
Room Parent: How do I format an exit list?
Advanced: How do I find a list of all rooms on the game?
Advanced: How do I find a list of rooms with a specific parent?
Advanced: How do I find a list of rooms missing a specific attribute?
-
How do I make a room room?
With our friend the '@dig' command. You will want to know the following information when you use the @dig command:
- Room name.
- Exit into the room's name.
- Exit out of the room's name.
- Some exit aliases. (I try to be really thorough but also unique here.)
The syntax for this command is:
@dig <room name>=<exit into the room>;<alias1>;<alias2>,<Exit Back>;<alias1>;<alias2>
So for example, say you are building a room with this information:
-
Room Name: Main Room - the Neon Cathedral
-
Exit into: Neon Cathedral
-
Exit back: Out (connected to the room 'main harbor')
@dig Main Room - the Neon Cathedral=Neon Cathedral <NC>;nc;neon cathedral;neon;cathedral;Main Harbor <O>;o;out;main harbor;harbor
This will build a room directly connected, via exit, to the room you are in and add an exit back to the room you are in.
What if I want to build a floating room, with no links?
Then just use '@dig <name>'. And it'll create a room that is 'floating', meaning that it isn't connected or link to anywhere else on the grid (which means the only way to get to it will be via @teleport).
@dig Neon Cathedral
What if I want to build a room with no exit back? Such as a TRAP?!
Then you can use @dig <name>=<exit to>;<alias>;<alias> without the part after the ','. It'll create a room linked to the one you are in via an exit, but not an exit back to the room you are in. (This is mean! Don't trap people without good reason!)
@dig Neon Cathedral=Neon Cathedral <NC>;nc;neon;neon cathedral;cathedral
A note on exit names and exit aliases.
When it comes to naming exits you can either be descriptive as to where they code, or descriptive as to what they are. Typically I name the exits after where they go to help with navigation and put what they are in the @desc. As well you don't have to put them in the above format, but this is the pretty standard one that is used. HOWEVER. I want to note that the first alias/name you put in the string of 'thing;thing;thing' is what is seen, everything after that is silent/hidden unless you examine the exit.
So if you set an exit to be: 'Neon Cathedral;nc' all that is going to show up is 'neon cathedral' and they won't know what the short alias is.
Again this is not something that is required, but typical standard, of naming an exit is to give it an alias that is one to three characters long -- some sort of abbreviation or anagram of the name, to make moving through an exit easier for people.
-
How do I connect rooms?
So you need two rooms that are not currently connected to be connected via exits? So you can go back and forth? This is pretty easy!
You'll want to be in one of the rooms, and have the #dbref of the other room. You can find it either by doing '@find <room name>' or examining the other room to get it. Once you have it you can use the @open command.
@open <exit name>;<alias>;<alias>=#dbref,<exit name>;<alias><alias>
So for example, I want to think the Neon Cathedral to the Industrial District as well. So I would type the following:
@open Industrial District <IND>;ind;industrial district;industrial=#1234,Neon Cathedral <NC>;nc;neon cathedral;neon;cathedral
A note on @open
You can use @open to link to a room, but not link back (maybe to represent a one-way exit like a slid or a trap door, but again please don't trap people into rooms without reason!) by not putting anything after the #dbref just drop the ',<alias>' part.
As well you can create an exit that goes no where by doing @open <exit>, and nothing else. You can then later @link it places, but I don't suggest just making blank exits.
-
How do I link rooms?
So you have a room with an exit that either goes nowhere, or you want to change where that exit goes? (Say you're moving the build around on the grid, for example.) That's okay! Here's where @link comes in.
@link <exit>=<room #dbref>
Like with @open you need to know the #dbref of the room you want to link to. You can find it either by examining that room, or using @find <room name>. One you have it you can link the room.
For example:
@open Main Harbor=#1235
Now the exit 'Main Harbor' will lead a person to the room '#1235', whatever room that is.
A note on @link
@link does a bunch of other stuff as well. Including setting the 'home' for players or objects. But I won't get much into that since this is a building tutorial.
-
How do I describe a room?
This is easy! It's as easy describing yourself! You will probably want to be in the room to describe it. Same command:
@desc here=<desc>
Example:
@desc here=%r%tWelcome to the Wildcard OOC room. This is an Anita Blake inspidred mush set in Taminkal (a fictional city in Washington). We use FAE (Fate Accelerated Edition) for our stats. We're still putting some finishing touches on things but the majority of information can be found at: %r%r%t http://wildcard.mechanipus.com/wiki/Main_Page
A note on descing:
Every mush and every builder as different standards. Some people want every paragraph set up with a tab or indent (%t), some want a tab AND a line between each paragraph (%t%r%r). Others just want a line between each paragraph (%r%r). If you are starting up your own game decide what you like best:
A desc like this:
Welcome to the Wildcard OOC room. This is an Anita Blake inspidred mush set in Taminkal (a fictional city in Washington). We use FAE (Fate Accelerated Edition) for our stats. We're still putting some finishing touches on things but the majority of information can be found at: http://wildcard.mechanipus.com/wiki/Main_Page
Like this:
Welcome to the Wildcard OOC room. This is an Anita Blake inspidred mush set in Taminkal (a fictional city in Washington). We use FAE (Fate Accelerated Edition) for our stats. We're still putting some finishing touches on things but the majority of information can be found at: http://wildcard.mechanipus.com/wiki/Main_Page
Or like this:
Welcome to the Wildcard OOC room. This is an Anita Blake inspidred mush set in Taminkal (a fictional city in Washington). We use FAE (Fate Accelerated Edition) for our stats. We're still putting some finishing touches on things but the majority of information can be found at: http://wildcard.mechanipus.com/wiki/Main_Page
How do I describe a room I am not in?
Well you need to know the #dbref of the room! Like before you can find this with @find <room name> or examining the room. You use the same command but instead of 'here' you put the #dbref.
So for example:
@desc #601=The isle of misfit code is fantasical place, filled with mischevious and delightful code that no longer belongs on the grid.
-
How do I describe an exit?
You use the same command as above! Now exits, like rooms, have different standards. You decide if you want a lot descriptive exit, or something short. I do typically suggest descing every exits-- with the exception of, sometimes, main grid exits.
@desc <exit>=<desc>
For example:
@desc NC=The front of the Neon Cathedral is a large brick face, broken by stained glass windows depicting pagan rights. From pan, to druids, to lupercalia. The main doors are large, brass, and handled with rings etched with old roman words.
Or you can just do:
@desc NC=Two large double doors with ring handles.
I prefer a more detailed @desc on my exits, but that's my opinion.
-
What else do exits need?
- @drop, somewhat optional
- @odrop
- @osucc
- @succ, somewhat optional
- @fail, somewhat optional
- @ofail, somewhat optional
Technically speaking these are all optional. Nothing "bad" will happen if you don't put them. However, they do serve important functions. However, you can stick a stock one of each of these on your room parent and then never have to do them again, if you don't want to, but again doing them for each non-basic-grid room does provide a bit more depth to your grid/build.
@drop, optional
This command will emit a message to a player when they go through an exit, the message arrives after they have entered the new room. For example Joe goes north to Wilderness, after the room desc for Wilderness has loaded he will get a message with what is specified in drop. This is optional, but I typically use it over 'succ' because it comes after you get spammed with a room desc. I also typically use it to describe what it is like to move from one room to the next.
@drop <exit>=<message>
Example:
@drop wilderness=You take the long winding highway either on foot or by wheel, eventually arriving in the sprawling wilderness outside of Taminal city limits.
(This is a little bit spammier than I would normally suggest, but I'd do something like that.)
@odrop
This command will emit a message to anyone in the room a person just entered. For example if Joe goes north to Wilderness and Sue and Bob are already in Wilderness, will get a message telling Joe has come into the room. As a note, the game should already have a 'Joe has arrived.' message already. So you could get away without having it, but it is nice to let people know where Joe came from. So I'd suggest having it at least on your room parent with code that references the room he just left.
@odrop <exit>=<message>
A note on this command is that the message that is sent is prefixed by '<name>'. So you don't it to be something like: 'The door flies open and %n flies in.' Because then you'd get Joe The door flies open and Joe flies in. Not very pretty is it?
Example:
@odrop wilderness=arrives either by wheel or foot to the wilderness beyond Taminkal.
This will get you: Joe arrives either by wheel or foot to the wilderness beyond Taminkal.
(That's kind of dopey, but you get the point.)
@osucc
This command will emit a message to the room a player just left. This is the reverse of '@odrop', basically. So it lets the folks you just know know that you have left. Again the game should have a stock 'Joe has left.' message, but I'd suggest having an @osucc on your room parent that at least references which room Joe went into.
@osucc <exit>=<message>
Like @odrop it will start the message with the player's name. So don't start it as a complete sentence.
Example:
@osucc wilderness=travels away from the city, either by wheel or foot, leaving for the wilderness.
This will give you: Joe travels away from the city, either by wheel or foot, leaving for the wilderness.
(Again, dopey, but work with me.)
@succ
I see this one as highly optional/slightly useless, and typically use @drop instead. Since a lot of the time a player won't even see the @succ message unless they scroll back up, or the room they are moving to has a very short @desc. Anywise, this will emit a message to a player upon going through an exit, triggered before they get the @desc of the new room.
@succ <exit>=<message>
Example:
@succ wilderness=You leave behind the city and head out into the wilderness either by foot or wheel.
@fail
This command comes into play when an exit has a lock on it. It will be triggered when a player tries a locked exit. It will send them a message. Now the game should have a stock 'you can't go that way' or 'you can't pass' message, anywise. So this is, frankly, just for flavor. You can do it if you want, but I wouldn't bother unless you really enjoy coming up with messages for people.
@fail <exit>=<message>
Example:
@fail wilderness=You try to leave the city but find the way out block by a police roadblock, or a raging inferno, or a supernatural forcefield. You are TRAPPED!
@ofail
Like @fail this is highly optional, and I wouldn't bother unless you really like to come up with build messages. I can't remember there is a stock 'Joe has failed to go X' message or not, but honestly people probably don't want to be spammed with it anywise. But for completion sake:
@ofail <exit>=<message>
Like @odrop and @osucc it'll start with the players name.
Example:
@ofail wilderness=tries to leave the city but finds that they are trapped within its confines by a herd of vicious kittens.
Will give you: Joe tries to leave the city but finds that they are trapped within its confines by a herd of vicious kittens.
A note: All of these commands can be used on objects and I think character objects. Why would bother I don't know.
-
How do I parent a room?
This is actually very simple! You can parent a room, an exit, an object, or a player with the same command:
@parent <thing>=<#parent>
So for example if your room parent is #25 you can parent it with:
@parent here=#25
This will set the room you are in to the room parent of #25. So anything set on #25 will be the default for the room you are in.
You can use this command on objects from afar by using
@parent #1234=#25
, if say '#1234' were the room you wanted to parent. -
How do I create a room parent?
You first step is simple. We're going to go back to our old friend
@dig
. So you'll dig your room that will be your room parent. You can do this for multiple room parents. Many games have had outdoor room parents and indoor room parents, so that that weather ambience (and possibly other reasons. I'm aware of) could be placed in the room easier.However, I mostly recommend a single room parent. You can link this to somewhere super secret staffly only, or you can link it nowhere and set it 'floating' (so you don't get annoying messages telling you that you own an unlinked room).
So lets make your room parent!:
@dig Room Parent @set Room Parent=inherit OR @set Room Parent=Wizard
-
How do I set up a stock room desc?
As I mentioned above, anything you set on your room parent will then be the default shown once a room is parented to that parent. So to set a default/stock description on rooms, you want to put it on your room parent. So find the #dbref of your room parent, and set the desc!
@desc #25=This is the stock room description. You may replace it using the command @desc here=. For this build to be complete you must set @desc, @osucc, @odrop, and either @succ or @drop. Your exits should be @desc'd with at least one or two words. And your description should start with %r%t and have %r%r%t between each paragraph and end with %r.
Now this will be the default description that shows up for any room that has been @parented to #25, but does not have a desc of its own.
-
How do I format a player list?
The way to do this is to edit your 'conformat' attribute on your room parent. You set this object by using
@conformat <room parent>=<code>
. You can do it in different ways, but I'll show you a basic way to do it now.You'll want to use iter(), lcon(), and a few other bits of a code. So you may want to read their help files if you plan to customize. (help lcon, help iter).
So first we need to build a list of players in the room so we start with:
lcon(%!) --> #42 #459 #79 #2526 #1127 #1186 #960 #12
Are all of those players? Also what are their names?
Here is where iter() comes in. We're going to put that list through an iter to give us the name of the objects in the room.
iter(lcon(%!), name(%i0), ,%,%b) --> Cobalt, Official, Census, Tributary, Locus: Parent Object, Nuker Object <NO>, Richard Doll, Demon Eightball, Grey
Okay so first of all those aren't all players, and they aren't all connected -- are they? The fix for that is to change the lcon() a little like this:
iter(lcon(%!, player), name(%i0), ,%,%b) --> Cobalt, Tributary, Grey
Now those are all the players in that room -- but Tributary and Grey are not connected. Do you want them still listed but marked as offline somehow? Or do you want them not listed? I'll show you how to do the latter first because it's easier. Once more we just change the lcon().
iter(lcon(%!, connect), name(%i0), ,%,%b) --> Cobalt
Now what if you want to have offline players listed, but noted as offline? Perhaps have their names greyed out or have a little asterisk by their name or something? This is a little complicated as you're going to have to check and see if the players have the 'connect' flag that tells the game if they are online at the time. And you'll need to to tell the code what to do if they do or don't, so we'll be using 'if()'.
iter(lcon(%!, player), if(hasflag(%i0, connect), name(%i0), ansi(hx, %([name(%i0)]%))), ,%,%b) --> Cobalt, (Tributary), (Grey)
(Where Tributary and Grey are grayed out (I put the %( %) around the name() so you could see it on the board.)
Now how do you put that in your room parent? Simple!
@conformat #25=[iter(lcon(%!, player), if(hasflag(%i0, connect), name(%i0), ansi(hx, %([name(%i0)]%))), ,%,%b)]
Or
@conformat #25=%r%r[iter(lcon(%!, connect), name(%i0), ,%,%b)]
If you want you can set an 'itemize()' around the outside of your code and it'll make it so that an 'and' is thrown in after the last item (and a coma between each item if you delimit your list differently, technically). To do that you would do:
@conformat #25=%r%r[itemize(iter(lcon(%!, player), if(hasflag(%i0, connect), name(%i0), ansi(hx, %([name(%i0)]%))), ,%,%b), %,%b)]
(Replacing #25 with the number of your roomparent of course. So so far our roomparent will look like this:
Conference Room(#80RI) This is the stock room description. You may replace it using the command @desc here=. For this build to be complete you must set @desc, @osucc, @odrop, and either @succ or @drop. Your exits should be @desc'd with at least one or two words. And your description should start with %r%tand have %r%r%t between each paragraph and end with %r. Cobalt and (Wizard) Obvious exits: OOC Room <O>
-
How do I format an object list?
We're going to be working with the same code as formatting a player list. So we'll be starting:
lcon(%!) --> #42 #342 #943 #684 #960 #13 #3503 #1127
Are all of those objects? No. So we need to get only the objects.
lcon(%!, object) --> #342 #684 #960 #3503 #1127
So what are those?
itemize(iter(lcon(%!, object), name(%i0), ,|), |). --> Forum Posting Functions, WelcomeBot, Hateball Eightball, Code Box, and Nuker Object <NO>.
So what do we do with that? With add that to our @conformat. So now we have:
@conformat #25=%r%rPLAYERS: [itemize(iter(lcon(%!, player), if(hasflag(%i0, connect), name(%i0), ansi(hx, %([name(%i0)]%))), ,%,%b), %,%b)]%rOBJECTS: [itemize(iter(lcon(%!, object), name(%i0), ,|), |)].
This gives us:
Conference Room(#80RI) This is the stock room description. You may replace it using the command @desc here=. For this build to be complete you must set @desc, @osucc, @odrop, and either @succ or @drop. Your exits should be @desc'd with at least one or two words. And your description should start with %r%tand have %r%r%t between each paragraph and end with %r. PLAYERS:Cobalt and (Wizard) OBJECTS: Forum Posting Functions, WelcomeBot, Hateball Eightball, Code Box, and Nuker Object <NO>. Obvious exits: OOC Room <O>
-
How do I format an exit list?
So we need to pull a list of exits. We'll do this with
lexits(<here|%!|#dbref>)
. This is a command that will give you the #dbrefs for all exits connected of the specified object. For our purpose we want %!, as we're putting it onto our room parent.So:
lexits(%!) --> #1111 #686 #2683 #2174 #441 #81 #393```
What are all of these exits?
iter(lexits(%!), name(%i0), , ) --> Cobalt's Closet Build Nexus Staff Quiet Room Purgatory Theno's Closet Closet Out
Well that isn't a very nice list it? Lets give that some punctuation.
itemize(iter(lexits(%!), name(%i0), , |), |). --> Cobalt's Closet, Build Nexus, Staff Quiet Room, Purgatory, Theno's Closet, Closet, and Out.
But how do we add the alias so we know what the short exit is to it? We will need to use
fullname()
but alsoextract()
to do that. Fullname will give you the long name of something.itemize(iter(lexits(%!), name(%i0) %([fullname(%i0)]%), , | ), | ). --> Cobalt's Closet (Cobalt's Closet;cc;cobalt's;cobalt's closet), Build Nexus (Build Nexus;bn), Staff Quiet Room (Staff Quiet Room;qr), Purgatory (Purgatory;pur), Theno's Closet (Theno's Closet;tc), Closet (Closet;cl), and Out (Out;o).
Well that's ugly! But notice how almost all of those have a short abbreviation as the second item after the ;? (That's a naming convention that is really helpful because you can use extract to pull out just one item.)
itemize(iter(lexits(%!), name(%i0) %([extract(fullname(%i0), 2, 1, ;)]%), , | ), | ). --> Cobalt's Closet (cc), Build Nexus (bn), Staff Quiet Room (qr), Purgatory (pur), Theno's Closet (tc), Closet (cl), and Out (o).
Isn't that much nicer?
So now we put that onto our room parent with
@exitformat
.@exitformat #25=[ansi(h, EXITS)]: [itemize(iter(lexits(%!), name(%i0) %([extract(fullname(%i0), 2, 1, ;)]%), , |), |)].
This finally gives us:
Conference Room(#80RI) This is the stock room description. You may replace it using the command @desc here=. For this build to be complete you must set @desc, @osucc, @odrop, and either @succ or @drop. Your exits should be @desc'd with at least one or two words. And your description should start with %r%tand have %r%r%t between each paragraph and end with %r. PLAYERS:Cobalt and (Wizard) OBJECTS: Forum Posting Functions, WelcomeBot, Hateball Eightball, Code Box, and Nuker Object <NO>. EXITS: Cobalt's Closet (cc), Build Nexus (bn), Staff Quiet Room (qr), Purgatory (pur), Theno's Closet (tc), Closet (cl), and Out (o).
-
Reading through this, I would like to submit to a couple of quick things (In one case, it was a thing that I spent years doing building work as staff and just never realized that this was a trick that could be done.). If it's more appropriate to drop this in another thread, I can move it. There was part of this under the section on linking rooms, but adding a part to it.
How can I quickly move a room from being attached to one to one place and to another?
Say, for the purpose of moving something finished from the Building Nexus of a game to the IC grid.
From the original linked-to room, pick up or take the exit.
take Blue House
Once you have picked up the exit, travel to the new room where the exit is to be linked. Once in that room, drop the exit.
drop Blue House
To finish you will need to have the #dbref of the room where the exit is to be linked, you can get that through the ways that were already suggested or you can examine the exit link that you just dropped and look for the #dbref that is listed as the source of the exit.
The source of the exit is what you need to link the exit coming out of the room you just drop to. From inside the room, it's a quick task of using the @link <exit>=<room #dbref> that was previously explained.
A small side note of warning with moving rooms around, they frequently get set to Halt when you do this. To clear the Halt on a room, from within that room:
@set here=!Halt
-
You know what I always needed help with? Finding rooms. I know there are search commands and whatnot but sometimes the help files read like a foreign language as I have no coding background.
For example, if I want a list of all room dbrefs, what would I type, exactly?
If I want a list of all rooms with a certain parent, such as an outdoor parent, what would I type?
How about a search for any rooms or exits without some attribute set? Say, desc or odrop? Then I could plow through to see what areas I haven't finished yet.
How can I use basic commands, such as @desc here, without being in the room? @desc dbref#=Text here?
Those are the sorts of things I'd love to see included in a tutorial, along with the standards.
-
@2mspris, no that's wonderful! I've added it to the main list with a link to your post, and set up a 'contributors' list in case anyone else wants to drop in any tips / How Tos for building. All build knowledge is great!
@Creepy: Some of that is a little bit of somewhat advanced code knowledge, and might be better suited in another tutorial? However, I've updated the 'desc' post to show you how to @desc from afar.
For the sake of answering you in case you're working on something and actually need/want those answers, give me a few and I'll post up some code you can c/p to find rooms.
-
@Cobaltasaurus said:
@2mspris, no that's wonderful! I've added it to the main list with a link to your post, and set up a 'contributors' list in case anyone else wants to drop in any tips / How Tos for building. All build knowledge is great!
@Creepy: Some of that is a little bit of somewhat advanced code knowledge, and might be better suited in another tutorial? However, I've updated the 'desc' post to show you how to @desc from afar.
For the sake of answering you in case you're working on something and actually need/want those answers, give me a few and I'll post up some code you can c/p to find rooms.
Nope. I'm currently an unemployed builder/desc'er. Just giving some general feedback on problems I've experienced in the past.
-
How do I find a list of all rooms on the game?
The likely easiest way to do this is with the function search() or @search. I personally prefer search() so that is what I'm going to show you. If someone else has a better way, please let me know!
The 'search()' function will look over pretty much everything on your game. Every object, every room, every exit, every player. It scans your entire database, so it can slow things don't so you should use it sparingly and don't run it wily nily if you have a really big game.
However, you need to tell search() what you're looking for, in this case we're looking for rooms so we'll do:
think search(type=room)
This will give you something like this:
#0 #2 #11 #48 #52 #55 #58 #63 #69 #73 #80 #87 #104 #113 #121 #125 #127 #134 #137 #140 #142 #143 #146 #149 #152 #155 #158 #161 #164 #167 #170 #173 #176 #181 #184 #198 #212 #215 #216 #219 #224 #227 #230 #235 #287 #296 #299 #305 #309 #312 #315 #320 #323 #326 #329 #332 #335 #346 #354 #357 #364 #368 #371 #374 #378 #383 #389 #390 #391 #402 #410 #418 #419 #425 #426 #428 #431 #432 #437 #440 #442 #449 #464 #469 #475 #483 #484 #488 #495 #500 #505 #507 #511 #514 #517 #523 #526 #532
Or you could use @search, which requires the same information to be given but will give you a different output. So example:
@search type=room
Will give you this:
ROOMS: Limbo(#0RAF) Master Room(#2RF) Auxilary Room(#11RF) Civic Center(#48RJL) Fairchild International(#52RM) Tilicum Park(#55R) Deep Forest(#58R) Churchyard - Childermas Church(#63R) Auditorium - Princess Theatre(#69RhJ) Sit n' Spin(#73RhJ) Conference Room(#80R) Club Floor - Bottom's Up(#87RhM) Room Parent(#104RI) Grey's Workspace(#113RF) Downtown(#121R) Central PA(#125R) The Deep Wreck(#127R) Harbourfront(#134R) South of Town(#137R) Mountains(#140R) A Taste of Time - Antiques(#142RhJM)
-
-
How do I find a list of all rooms lacking a specific attribute?
@Glitch said:
We'll use
eroom
andeexit
for these:@search eroom=not(get(##/desc)) @search eexit=not(get(##/odrop))