MLPV2 Tutorial

From Second Life Wiki
Revision as of 12:41, 29 August 2009 by Chaz Longstaff (Talk | contribs)

Jump to: navigation, search

Setting up MLPV2

These instructions look long, but it's easier than it looks. Here's the overview:

  1. get the scripts and install them in a prim
  2. put your anims in the same prim
  3. Create and edit one or more .MENUITEMS.* notecards (use whatever you want for "*"). Configure menus and add poses to the menus. Mostly the same as old MLP, with enhancements and no need to edit the main menu.)
  4. Reset and try the menu
  5. adust each pose (same way as old MLP)
  6. dump memory and save positions in notecard (nearly same way as old MLP; sellers may want to use modular .POSITIONS.* files)

These instructions are oriented for someone setting up a new object. However, those who bought one and are adjusting it or adding poses can simply skip the obvious steps that the maker would already have done.

Get the scripts

Get MLPV2 (empty) from SLExchange. Cost, L$1. I also recommend the configured example for L$100.

Take a good look at the .readme file.

Install scripts

Either copy its contents into inventory and then into your furniture, or else edit the prim and use it in your bed. Life is easiest if you use the root prim for MLPV2; instructions below for when it's not. For your first try, stick with root prim and keep life simple. (An easy way to add it to an existing bed is to just float it slightly above your mattress and then apply a totally clear texture, available in any freebie depot.) [Tip! You'll thank yourself later in life if you try to keep the prim that the MLP stuff is in, at a rotation of 0,0,0 -- makes it easier to transfer between products.]

Click the MLPV2 prim so that it starts up for the first time. If you get a menu, fine; you've already done this.

Install animations

Drag all the anims you'll use into the prim. (You can pull these out of poseballs you like. If the animations are no-copy, this will render the poseballs useless.)

Note: not all animations will work with MLP. See discussion here: MLPV2_Reference_Manual#TIP.21_Animations_Caveat

Create and edit your .MENUITEMS.* file

Create a new notecard, named ".MENUITEMS.mystuff", where "mystuff" can be anything you want. MLPV2 can take any number of these, and bed sellers can make different pose sets for different customers. (For expandability, Lear recommends each .MENUITEMS* file contain one unanchored menu, with any submenus in the notecard hanging off of that unanchored one. This allows 10 independent modules and only memory limitations on the total number of menus. He also suggests dividing menus & positions into separate notecards making it easy for customers to delete the ones they won't use. But for now we'll make just one, and talk about "pose packs" later.)

Drop this notecard into the object -- though you might want to do most of the editing first -- objects with lots of things in inventory react slowly to changes, and you might have a lot of animations.

Create a menu:


This creates a menu whose button in the top menu will be labeled MyMenu. ALL indicates that it will be accessible by everyone (alternatives here are GROUP, only allowing people in the same group as the object, or OWNER, only allowing the owner). After that, list each ball color for the poses in this menu. You can have up to six balls. If you have some solo poses, some couples poses, and some 3some poses, they have to be in different menus.

In this example, a pink and a blue poseball will be rezzed.

For each pose in this menu, add a line like this:

POSE pose1 | anim1 | anim2


pose1 will be the button name for this pose.
anim1 is the name for the animation for the first poseball (which happens to be pink in our example)
anim2 is the name for the animation for the second poseball (which happens to be blue in our example)

For facial expressions, you add a suffix to the animation names indicating the expression. Note that you don't change the actual name of the animation in the inventory, you just add the suffix in this configuration notecard. These are explained under MLPV2 Expressions below. For a simple example, appending "*" will give an astonished open-mouth expression.

The following can also be included in your menu:

TOMENU MyOtherMenu

STOP makes a button labeled STOP that de-rezzes the poseballs and unsits everyone. SWAP makes a button labeled SWAP that exchanges the first two balls. It currently has no effect on any 3rd or 4th ball. BACK makes a button labeled BACK that goes back to the previous menu. TOMENU makes a button labeled MyOtherMenu, which goes to another menu (which you must create).

With MLPV2 (assuming you're using the .MENUITEMS that comes with MLPV2 rather than an old MLP configuration), any MENU that is not found in a previous TOMENU entry is added to an empty slot in the top menu. I'll talk more about this below, under MLPV2 Submenus.

It's a good convention to end each menu with the following:


For MLPV2 (again, assuming you're using the .MENUITEMS that comes with MLPV2 rather than an old MLP config), buttons are placed in the menu in the same order they appear in the config notecard. To convert to using this new (sane) menu order, see here: [1]

Tip! By convention, the top, "main menu" often includes buttons such as OPTIONS, SHUTDOWN, etc, as well as buttons providing access to the sub-menus.

Don't attempt to put actual poses here. They may work sometimes, but the right number of balls won't always get generated for them here, depending on where the user was before. If the user was in a Solo submenu with one ball and comes back up to the top menu level and selects there a pose with two balls, the second ball won't be generated, because the main menu doesn't have any directives about the number of balls to generate.

You may wish to add at this top level a HELP button.

The configuration would be something like this:

LINKMSG HELP | 1,-4,987789,-Help for XYZProduct##Here's your help notecard

Then just drop in the ~give script add-on found here MLPV2_Give_Item_Add-on

It might be better to name the help notecard something other than just "Help", so that your users can identify it more easily when it ends up in their inventories.

Continuation menus

As we all know, you get at most 12 buttons in an SL menu. However, with MLPV2.1, you can have more than 12 buttons in a configured MENU. If there are more than 12, MLPV2.1 will automatically add a MORE--> button after the 11th item, leading to the remaining choices. (And also after the 22nd item, etc.)

If you wish MLPV2.1 to automatically a BACK button, add the parameter AUTOBACK in your .MenuItems config card. It doesn't matter where it is, but convention is to put it near the top.

Note that a BACK button will not be added to the top, main menu (because there is no further back there to go back up to.) Nor will it add it to the last page of a series of sub-menu pages, or to a single-page sub-menu -- you must add the word BACK yourself manually to these if desired.

Menu Reset

Save your changes. (If you're editing a copy in inventory, install it in the MLPV2 prim).

Click the MLPV2 object. If this is the first time since you installed the scripts, it will start up and read the configurations. If you get a menu, select OPTIONS -> ShutDown -> Menu Reset. This button causes it to re-read all .MENUITEMS.* files, including yours.

Watch for warning messages. The most common one is due to an animation being missing or misspelled in the configuration. Fix any mistakes and do another Menu Reset.

Click to get the menu. You should see the button for your new menu; click it. You should see the menu you configured. Click the first pose. You should see the right number and color balls appear. They may be in odd places.

Tip! Note that RESET will not re-read positions from the positions card. Only PosRest and RESTART will.

The default pose

The "default pose" is a set of poseball positions and orientations that is used for any new pose, since new poses don't have saved positions yet.

The default pose in the MLPV2 distribution assumes that the MLPV2 prim is essentially an unrotated box, flattened and stretched like a mattress cover. If your prim is rotated (as is likely if you're using a flattened cylinder lying on its side for the mattress, and MLPV2 is in the mattress), you will want to adjust the default pose so none of the balls are underground.

Go to main blue menu and select adj-default -> default.

Tip! If you don't have this choice, see here: [2]

If the default pose looks fine (4 balls arranged in a square, avs sitting facing each other), skip this step.

If the default pose looks wrong, adjust it following the instructions below, as for any pose you would add. You may have to be clever to get at balls that might end up under the floor or buried in your object.

When saving the default pose as described below, be sure to save it to the .POSITIONS notecard, rather than to your .POSITIONS.mystuff notecard.

Adjusting poses

MLPV2.2 and earlier

  • Use the menu to select whichever pose you want to adjust. If it's a new pose, it will get the default pose. Have avatars sit on the poseballs. Use the menu OPTIONS -> Adjust Pos to make the poseballs visible and easy to select for editing. (They get long and translucent, so we call them "beams".)
  • Select the beams and orient them as desired. When done, use the OPTIONS -> SavePos button.
  • You may continue with the next pose, or re-adjust this one. When someone stands, their poseball will go back to the normal shape. Just click the AdjustPos button to make it a beam again.
  • The AdjustPos button's only affect is to change the size and appearance of the poseballs. Feel free to adjust positions by selecting the clear tiny sat-upon poseballs and moving them, if you prefer.

MLPV2.3 and later

  • Select OPTIONS -> Adjust Pos at any time. Whenever anyone is sitting on a poseball, it will be long and translucent to be easy to find and select. We call these "beams". Participants can hop on and off balls at any time during adjustment.
  • Select the beams and orient them as desired. When done with a pose, simply select the next pose. The current pose's position is automatically saved. Also, you can save the current pose's position at any time using OPTIONS -> Save Pos.
  • To undo changes to the current pose, just select it again. Alternatively, just quit adjusting.
  • To quit adjusting, make sure the current pose is saved (if desired), and use either STOP or OPTIONS -> Adjust Pos. (Stop will also delete the balls and pop off any participants.)

Saving pose positions

NOTE WELL: The SavePos button saves the position in MLPV2 memory. A reset will cause it to forget. End users will probably want to save the changes, and sellers will need to.

[NOTE! It is for this reason that the .POSITIONS notecard should be ideally released to customers as MODIFY. Note as well, though, that if a notecard is placed in a no modify prim, people will not be able to open the notecard at all, regardless of the perms on the notecard. This is a SL system limitation.]

Saving pose positions, new object

Follow these instructions if this is a new object and you plan to sell it and possibly a line of related objects with MLPV2 poses. There is a simpler way for end users, below.

Create a .POSITIONS.mystuff notecard, where mystuff matches your .MENUITEMS.mystuff file name. (This isn't absolutely required, but makes life simple and I will assume that convention is followed in this tutorial.)

Use OPTIONS -> Dump Pos to dump all the positions. Using the chat history window, copy the text between the "-----" lines, which looks something like this:

MLPV2 (empty): {pose1} <... numbers ...>

It may include a timestamp.

Paste them into your notecard. It is not necessary to delete the stuff before {pose1}, but you can if you like things tidy.

Delete the {stand} line. Delete the {default} line. (Note: if you changed the default pose, save this line in .POSITIONS notecard.)

Save, and OPTIONS -> ShutDown -> PosReset. This causes the .POSITIONS.* files to be re-read, including yours.

That's about it; now you're ready to test your poses. Have fun!

Tip! If the PosReset button is not offered, look for the RESTART option. Note that RESET will not re-read positions from the positions card. Only PosReset and RESTART will.

Saving a single position that you've updated

When you use OPTIONS -> SavePos for, say, pose1, you'll see a line in chat looking like this:

MLPV2 (empty): {pose1} <... numbers ...>

There may be a timestamp. You can copy this line and replace it in the corresponding .POSITION.* file (e.g., the one already containing this pose's position).

Saving pose positions, simplified version for end users

If you're adjusting an object you bought that's already set up, and you've adjusted a lot of poses, this is the easiest way to save all your changes. Note, however, that if your product has pose pack modules and you might want to remove one to make room for other add-on poses, this might not be the best way.

Use OPTIONS -> Dump Pos to dump all the positions. Using the chat history window, copy the text between the "-----" lines, which looks something like this:

MLPV2 (empty): {pose1} <... numbers ...>

It may include a timestamp.

Paste them into the .POSITIONS notecard, replacing its previous contents. It is not necessary to delete the stuff before {pose1}, but you can if you like things tidy.

Delete all other .POSITIONS.* files in the MLPV2 prim's inventory.

If you later decide to delete a pose pack (a .MENUITEMS.* file) with poses you won't use, you can still do that. The positions for those poses will still be in the .POSITIONS notecard, and you can feel free to delete them manually.

Deleting adj-default menu button

Once you're happy with the default pose positions, simply delete .MENUITEMS.zz-default from the MLPV2 prim's inventory. You can always put it back by dragging that file from the MLPV2 distribution.


Props are objects that your MLP product will rez for poses. When you choose another pose or hit STOP, any rezzed prop disappears. If you delete the MLP object, any prop will disappear within 3 minutes.

For any pose, you can ONLY HAVE one prop. If you need more than one prop to rez, you'll have to link the items so that they can be treated by MLP as one object.

1) Start by adding these two buttons to your MLP menu (You may wish to put them under the OPTIONS menu.)

  • LINKMSG DumpProps | 0,-4,1,DUMPPROPS // dump all prop configs
  • LINKMSG SaveProp | 0,-4,1,SAVEPROP // save position/rotation for a prop

Save your work.

2) Have to hand a prim prop object that you want to rez.

3) Add to this prop object the "~prop" script (you'll find this inside the supplied "~pillow" object ), and drop your prop object into the MLP prim's inventory. Note: the prop object and everything in it will need to be copiable for next owner -- otherwise, it will only ever rez once for them!

4) Now, edit a .PROPS notecard or add a new one (named .PROPS.* where * is anything, for a modular config.) Copy this example line and paste it into your .PROPS file.

| mypose | myobject | <1,1,1>/<0, 0, 0>

  • Replace "mypose" with the name of the pose that the object should rez for.
  • Replace "myobject" with the name of the prop object. The object name cannot contain vertical bars.

Save your work.

5) Use the MLP menu's PosReset or RESTART button. When the MLP has restarted, select the pose that you set the prop for. The prop should appear. It might be underneath the MLP object, or some distance away, so look around -- it may be best to do this using a single prim MLP floating in the air, the first time.

6) Edit the prop, and use the editing arrows to move the prop to where you want it. Then, use the MLP menu button called "SaveProp" that you created earlier. To make the change permanent, select the text in the chat line (including the first vertical bar, and optionally any text before it) and replace the corresponding line in your .PROPS* file. Or, do all your props, saving their positions, and then use the DumpProps button. This works the same way as saving positions in .POSITIONS* files.

7) To get MLP to reread .PROPS* files, use PosReset (which resets positions as well as props), or RESTART.

Keep in mind that props and positions are saved separately, so if you adjust a pose and its prop, you need to save both pose position and prop.

Hand-held Props: For props to be used as hand-held items, use the ~give script add-on found here MLPV2_Give_Item_Add-on and have people wear the items.


MLPV2.3 allows you to create sequences of poses that run automatically once started.

It's a little complicated. You need to set up the poses, set up the menu for for the user to select and control the sequence(s), and program the sequences.

Set up the poses

Set up the poses you'll be using just as you would any other poses. Later, if you want to hide those poses and make them unavailable from the menu, that's possible. If you know you'll want to hide them later, put them all in the same menu, which'll make it easier later.

Create the menu to control the sequence(s)

See the .MENUITEMS.example notecard in MLPV2 distribution as an example. This menu has two buttons to start sequences, and two buttons to stop and continue them, along with the usual navigation and swap buttons:

// example menu containing 2 sequences, and sequence controls
MENU Tours...
LINKMSG *Tour* | 0,-4,-12001,SEQUENCE Tour1-seq
LINKMSG *Tour2* | 0,-4,-12001,SEQUENCE tour2-seq

In the above, "*Tour1*" and "*Tour2*" are button names -- that's what the user will see. The "| 0,-4,-12001,SEQUENCE" part is pure magic, don't mess with that unless you're a magician. "Tour1-seq" and "tour2-seq" are names of sequences in the .SEQUENCE* notecards.

PAUSE causes the sequence to stop. RESUME causes the sequence to resume where it left off. If you didn't PAUSE, it advances to the next step. This is handy for quickly testing a sequence with long wait times. STOP stops the sequence and unrezzes the balls. After a STOP, RESUME and PAUSE have no effect.

NOTE WELL Never have any two buttons in an MLP/MLPV2 menu with the same button name. Only the first of the two will work. Subsequent ones (duplicates) will only cause the first button's effect.

Programming a sequence

Create a notecard whose name starts with .SEQUENCES, followed by whatever you wish. In the MLPV2 distribution, this is SEQUENCES.example. I'll go through an example sequence explaining what each line does.

Start the sequence with the sequence name specified in the .MENUITEMS file; in this case, "Tour1-seq". The name is arbitrary, it just has to match between the MENUITEMS notecard and the SEQUENCES notecard. For example:

SEQUENCE | Tour1-seq

Next, tell what menu you'll be using for subsequent poses. Currently, this only sets the number and color of balls, but that might change in the future. You can change the menu later in the sequence using more MENU lines. The line below tells us that we'll be using poses from the "Example..." menu. (Note the pipe symbol | required, unlike in the .MENUITEMS card. Note as well that all you put is the name of the menu, none of the usual stuff that would follow it, as in the .MENUITEMS card. Note as well that in this example, the ... is part of the name of the menu being referred too, and is normally not required.)

MENU | Example...

Now, program the steps in the sequence as poses followed by timed pauses, and possibly waiting for participants to hop on. (Note the pipe symbol | required, unlike in the .MENUITEMS card. Note as well that you only list the name of the pose -- not any associated animation.)

POSE | standing

The line above starts the "standing" pose.

AVWAIT | 0 | Waiting for someone to sit on blue ball

The line above causes the sequence to wait for someone to sit on ~ball0. (To see which ball a ball is, pick the pose using the menu and right-click->Edit the ball. The number at the end of the name is the number to put between the "|" characters above. The text after the final "|" is optional; it's what the object chats if it needs to wait.

You can specify any number of balls here; for example, you can use:

AVWAIT | 0 1 2 3 | Waiting for all participants!

I highly recommend that any looping sequence have at least one AVWAIT in it. We don't want to disturb the neighborhood with an unused bed running endlessly through a sequence. In a future version, I might make it an error to have a loop without an avwait.

WHISPER | 0 | /0 and /1 stand together

The line above causes the object to whisper the given line on channel 0 (the number between the "|" characters). "/0" through "/5" get substituted with the first name of the av on the corresponding ball. If nobody is on the ball, it uses "somebody".

WAIT | 10

The line above causes the sequence to wait for 10 seconds before proceeding.

POSE | pillow-sit | 0 | /0 and /1 sit with a comfy pillow

The line above selects a new pose and whispers on channel 0. Note that we omitted this optional chat in the POSE line above. As earlier, /0 and /1 are replaced with the participant's first names.

WAIT | 10
POSE | sit2 | 0 | The pillow disappears
WAIT | 10

You should know by now what the lines above do.

The next line causes the whole sequence to repeat.


Alternatively, you can use a LABEL line anywhere in the sequence, and end the sequence with a GOTO line, as in the other example provided with the MLPV2 distribution:

LABEL | mylabel
GOTO | mylabel

Or, you can just have the sequence end by not adding any more steps (or, by starting a new sequence). If the sequence doesn't end with GOTO or REPEAT, it simply stops at the end.

Avoiding the posename chat

By default, MLPV2 chats the pose name whenever it starts, either by menu or sequence. If you don't want it chatting pose names during sequence, add "| NOCHAT" to the end of the SEQUENCE line, like this:


Hiding the poses from the menu

You can hide any MENU in the notecards from the user by using "HIDDEN" instead of "ALL", "GROUP", or "OWNER", as below:

MENU | seq1-poses | HIDDEN | PINK | BLUE

Put your sequenced poses in such a menu and they'll be invisible to the user. Just remember to set up the pose positions first! Of course, you can always use "Adjust pos", PAUSE in the sequence, and adjust.

Lear Cale 10:31, 14 May 2008 (PDT)