MLPV2 Tutorial

From Second Life Wiki
Jump to navigation Jump to search

Setting up MLPV2

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

  1. get the scripts and notecards and drop them into a prim (CREATE YOUR OWN PRIM -- so folks know who made it!)
  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 XStreetSL. Cost, L$1. Also available at jPose Island, in the FREEBIES section. The inworld version is always the latest. The

Take a good look at the .readme file.

Install scripts

Copy its contents into inventory and then into your furniture.

Delete the notecards ending in "examples", along with the ~pillow object and any example animations you don't plan to use.

Life is easiest if you use your object's 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.) Below, we'll call this prim the "MLP prim".

[Tip: You'll thank yourself later in life if you try to keep the orientation of the MLP prim the same across your products, for example, with rotation 0,0,0. This makes it easier to transfer between products.]

Click the MLP 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.

Drop this notecard into the object. [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. As of Nov/2009, there's also an issue with editing notecards in object inventory. Unless you've heard the "all clear" on this, or know the workaround, it's best to edit in your avatar inventory.]

Create a menu:

MENU MyMenu | ALL | PINK | BLUE

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

where

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

Zero, one, or two spaces are allowed around the vertical bars. Avoid extra spaces.

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:

STOP
SWAP
BACK
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, by default. You can configure MLPV2 what to do for poses with multiple balls, [LINNK TBD].
BACK makes a button labeled BACK that goes back to the previous menu. Every menu should have one of these!
TOMENU makes a button labeled MyOtherMenu, which goes to the MyOtherMenu 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:

SWAP
STOP
BACK

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 set old MLP configs to using this new (sane) menu order, see here: [1]

Repeat the above for each menu you want. Poses with different numbers of participants have to be in different menus, since the MENU line gives the number and colors of the balls.

For a menu with 3 or more poses, the POSE line would list that number of animations, separated by vertical bars ("|").

Continuation menus

As we all know, you get at most 12 buttons in an SL menu. However, starting with MLPV2.1, you can have more than 12 buttons in a configured MENU. If there are more than 12, MLPV2.1 and later 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 to automatically a BACK button whenever it adds a MORE--> button, add the AUTOBACK directive to your .MENUITEMS config card. It doesn't matter where it is, but convention is to put it near the top. Put it alone on a line.

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. (A reset is 'not required for missing animations; just drop in the anim. If you don't have some of them yet, don't worry, this won't do any harm.

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 "MenuReset" will not re-read positions from the positions card. PosReset 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 (6 balls arranged in a hexagon, 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.

The stand pose

MLPV2 uses the stand pose whenever STOP is used (or on any reset button in the Shutdown menu), just before unseating the avatars. This helps avoid them popping high into the sky, which happens when poseballs are buried inside the object.

I suggest using the default pose for the stand pose. Simply duplicate the "{default} ..." line in .POSITIONS and change "default" to "stand".

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 (right-click -> Edit) and adjust 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:

 [xx:xx]  : {pose1} <... numbers ...>

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

Delete the {default} line. (Note: if you changed the default pose, save this line in .POSITIONS notecard.) Delete the {stand} line. (Note: if you changed the stand 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! For those using old MLP .MENUITEMS files: 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 (MLPV2.1)

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.

SEQUENCES (MLPV2.3)

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

It's a little complicated. You need to:

(1) set up menus (and often poses as well) for the sequences to draw on;
(2) set up a control menu for the user to access the sequences;
(3) program the sequences.

1. Set up the menus (and poses)

In the .MENUITEMS notecard, create menus for the sequences to draw on. These menus:

(a) tell sequences how many balls to rez, and of what colour;
(b) can be used if needed to set up poses for the sequences

These menus you will almost always hide with the HIDDEN parameter, as they aren't meant for users to be able to pick items from.

Example 1:

MENU ROMNIGHT|HIDDEN|PINK|BLUE2
POSE 00|postwaitf|postwaitm
POSE 01|postf1|postm1
POSE 02|postf2|postm2
POSE 03|postf3|Postm3

This is a menu for a sequenced animation that has been purchased as a sequenced animation. These particular animations need to be played one after the other for them to make any sense; they are part of a mini-scene, as it were. You wouldn't want users to try to choose just random parts of it, so the poses don't exist in any other menu that the user can see. Thus, in addition to the menu line, we need to define the poses here.


Example 2:

In this instance, we are working on setting up a sequence that will draw on poses already defined in other menus. We just want to pull the poses together and make a nice, progressive scene out of them.

For this, all we need to do for the sequence in the .MENUITEMS notecard is to give it the basic line setting up the menu with balls -- nothing else.

MENU SONG&DANCE|HIDDEN|PINK|BLUE2


Summary: if under regular menus you have already defined poses that you want to re-use in sequences, then you *don't* need to redefine them under special menus created just for sequences. Under menus specially for sequences, you only need to create poses that aren't defined anywhere else.


2. Create a control menu for 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
LINKMSG PAUSE | 0,-4,-12001,PAUSE
LINKMSG RESUME | 0,-4,-12001,RESUME
SWAP
STOP
BACK

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. Alternatively, if you didn't PAUSE, RESUME 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.

3. 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 control menu in .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.

MENU | Example...

The line above tells us that we'll be using poses from the "Example..." menu. (Note the required pipe symbol | , 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.)

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.

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:

SEQUENCE | Tour1-seq | NOCHAT

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.

Tips

Expandability

For expandability, we recommend that each .MENUITEMS* file contain one "unanchored" menu at the top, 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. We also suggest dividing menus & positions into separate notecards making it easy for customers to delete the ones they won't use.

MLPV2 loads the notecards in the same order they appear in object inventory. The buttons for the unanchored menus in these notecards are added to the main menu in the same order. So, name your extensions so your notecards sort in the order you want these buttons to appear.

Main menu

By convention, the top, "main menu" often includes buttons such as OPTIONS, SHUTDOWN, etc, as well as buttons providing access to the sub-menus. By convention, this menu is defined in the .MENUITEMS notecard (note, no suffix).

Don't attempt to put actual poses in the menus found here. They won't work reliably, since these menus don't list the number and color of poseballs.

Help button

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

Put this line at the end of the "TOMENU -" lines below MAIN MENU.

Then 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.


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