This page is part of the documentation on the MOOseum Tools Project, a collaboration between Kalí Tal and ConnectionsMOO. The purpose of this project is to provide a suite of tools based on a museum metaphor to humanities scholars who are interested in integrating new media technology into their courses. The tools, currently under development, will be distributed freely as a suite, and will run on LambdaCore, JHCore and enCOre MOOs. If you are interested in beta testing these tools, contact Kalí Tal.
Items typed <inside angle brackets> should be typed without the brackets when you give commands on the MOO. For instance, if you saw the following command:
@create #624 named <name of your animatronic>
You would type:
@create #624 MyAnimatronicName
[This tutorial created by John DiLorenzo, 9/30/99. You can find him in Skyward's Office on Connections, or via email: John@DiLorenzo.com]
The generic MOOseum random narrator and animatronic allow you to "push button on" them to make them speak. Sometimes, though, you don't want your users to push a button, but "change the channel" or "pull the string," and so on. There's no really simple way to change this, but here's a tutorial to walk you through the process. To see an example of this, examine #4996 on Connections MOO. That's a Krusty the Clown doll that talks when you pull its string.
When I made my Krusty the Clown doll, I wanted people to be able to pull the string on it to make it talk rather than push the button on it. I assume you're reading this tutorial because you have a similar goal.
What you need to do is put a new action on your object, and set that action to do the same thing as talking to the object or pushing the button. The first thing to do is to figure out the name of your command. Once you do that, you will create what is called a verb and add it to your object.
Step 1: Create the message that is displayed when a person uses that feature on your object.
The command is:
@prop <object>.<verbname_msg>
On Krusty, for example I did this:
@prop krusty.pull_msg
But the message can be whatever you decide. Examples might be:
change_msg, yank_msg, kick_msg, roll_msg, etc. depending on what you want the user to do
When you add the property, the moo will give you this message:
Property added with value 0.
Now if you use the command "@messages" on your object, you will see that there is a new message on you object that hasn't been set.
To see the messages on my object, I typed "@messages krusty"
Step 2: Setting the message
Now you need to set the message. The best way to do this is to copy the lines that I have here, and then modify them to fit your object.
Copy this line to your moo program and edit it accordingly.
@pull krusty is "%Nd %n:(pulls) the string on Krusty."
You need to put the action in parentheses so that the moo will know to display the message on your screen like "you PULL the string" and other people get the message: "Joe PULLS the string."
Step 3: Creating the action and putting it on your object
Copy this line to your moo program and edit it accordingly:
@verb krusty:pull this none none
The only thing you need you need to change on that line is the "krusty:pull" part, leave everything else as is.
Step 4: Programming the verb
Now we have to program the verb; that is, to let the MOO know what to do when somebody uses the new command on your object. When we enter the programming mode using the "@prog" command, you won't be able to do anything but program the verb. You enter the program line by line. Press enter after each line of code. If you make a mistake, type @abort to exit programming mode, but if you do that, you will have to start again from the beginning. The only things you need to change in the following lines of code are the verb names. You will see "this.pull_msg" in my code. You only need to change "pull" to your action, when it appears in the code.
Start editing your verb by using the @prog command. I used this:
@prog Krusty:pull
You'll substitute your own object's name or number for "Krusty" and your own verb for "pull"
You will then see this message:
Now programming krusty:pull(0).
[Type lines of input; use `.' to end or `@abort' to abort the command.]
Now that you are in programming mode, you need to copy the lines exactly as I have them here, except for changing the verb name "pull" to fit your object.
Copy these lines:
if (this.location == player)
$you:say_action(this.pull_msg);
this:speak();
return;
endif
if (player.location != this.location)
player:tell("How do you plan to pull the cord from this room?");
return;
endif
$you:say_action(this.pull_msg);
this:speak();
.
Make sure that you didn't overlook the period on the last line. If everything worked, you should see this message:
0 errors.
Verb programmed.
All that we have left are a few final changes. You can now use the command you entered by using this format "verbname objectname" I did this:
pull Krusty
Your object should have read the cue cards you put in it. If it didn't, you need to put cue cards in it, or drop your object. (For some reason, the narrators will not speak while you are holding them.)
Step 5: Adding an alias to your object
When I made my Krusty Doll, "pull Krusty" didn't seem right, I wanted to use "pull string" instead. If you want to do the same to your object, all you have to do is add another alias to it. For example, I did this for Krusty:
@addalias string to krusty
then I added another one, just in case somebody typed "pull cord"
@addalias cord to krusty
Step 6: Letting people know how to use your object
The last thing you need to do is to let people know how to use your object. If you look at your object, you will see the description you gave it and a message that says something like "If you want to hear Krusty talk, talk to krusty or type 'push button on krusty'." We need to change that message. Copy this next line and edit it to work with your object:
@desc_multiple_cards Krusty is "Each time you type 'pull string', %td will say something different."
That's all there is to it. Go ahead and play with your narrator object to make sure that everything works ok.
Docent | Exhibit Stand | Guestbook | Notepad | Random Narrator | Timecard