MLPV2 Reference Manual

From Second Life Wiki
Jump to navigation Jump to search
  • NOTE* -- work in progress, and much of the text below is erroneous.

MLPV2 Reference Manual

.MENUITEMS* files

When MLP2 starts or is "Menu Reset", it reads all *.MENUITEMS* files, in the same order as they're listed in object contents ("*" can be anything). You can have as many as you want or just one. MLP2 essentially reads them all as though they've been concatenated into one big file.

The first two things (other than comments) it reads has to be two POSE statements, first for "default" and second for "stand" -- even if you don't use the STAND button anywhere.

After that, it expects directives and menu configurations.

Comments

Comments begin with "//". Any subsequent text on that line is igored.

Directives

Directives affect the behavior of MLP2. They don't cause a button to appear, and it doesn't matter where in the .MENUITEMS* files they are.

MENUORDER

This directive causes all menu buttons to appear in menus in the same order as they appear in the .MENUITEMS* files. If absent, menus are in the group-by-3-backwards order typical of SL menus, like original MLP. If present *anywhere* in the .MENUITEMS files, it affects all menus.

NORELOAD

This directive causes MLP2 not to do a menu reset when rezzed.

Menu configurations

Menu configurations create menus. The first MENU created is the main menu, which a user gets on touching the object. The remaining menus are reached via buttons configured using TOMENU.

MENU

MENU mname | who

or

MENU mname | who | ballcolors

This creates a menu named name.

Those who can access it are specified by who, one of the following:

ALL anyone can use it
GROUP only those who are wearing a group tag that matches the object's group can use it
OWNER only the object owner can use it

This is optionally followed by a set of ball colors to be used for all poses in this menu. Currently supported colors are:

BLUE PINK

To change the actual color for the balls, see the ~ball script inside the ~ball object. This is an advanced topic. The next release of MLP2 will support more colors.

Zero to four balls can be specified, supporting poses for up to 4 participants. If a menu has no ball colors listed, it should have no POSE buttons. The balls are rezzed as necessary, when a pose in the menu is selected.

The menu's buttons are configured following the MENU statement.

If there is no TOMENU statement on another menu, and if there are "TOMENU -" statements for the main menu, a button for this menu (labeled name) is added to the main menu.

Example:

MENU boy-girl | ALL | BLUE PINK

TOMENU

TOMENU mname

This creates a button labeled mname, leading to menu name, which is usually configured in a subsequent MENU statement.

POSE

POSE pname | animname ...

This creates a button for a pose labeled pname, using the animations listed after the vertical bar. The animations are applied to the balls specified, in order. That is, if the ball colors are "PINK BLUE PINK", three animations should be listed. The first applies to the first pink ball, the second to the blue ball, and the third animation applies to the third ball, which is pink.

The ball positions are specified in a .POSITIONS* file, discussed below. If there is no .POSITIONS entry for a pose, the default pose is used. It's a good idea to always set up the default pose first for a new bed, to avoid balls rezzing underground or in other inconvenient locations.

Each animation name should identify an animation in the object's contents. In addition, the animation name specified here can contain a suffix indicating an expression:

suffix expression
* mouth open
::1 mouth open
::2 surprise
::3 tongue out
TBD TBD
::20 eyes closed

Note that this suffix appears only in the configuration; the animation name in the object's contents should *not* have this suffix.

LINKMSG

LINKMSG name | menu,primnum,lm-num-arg,lm-str-arg

This creates a button labeled name that will send the specified link message to other scripts in the object when the button is used. This is useful for adding scripted features to MLP2 without having to modify MLP2 scripts.

| parameter | meaning | | menu' | 1 if the script receiving the button will pop up a menu. It causes MLP2 not to repost its menu, to avoid menus stacking up. 0 otherwise -- doesn't inhibit MLP2's remenu feature. | | primnum' | primitive number (e.g. LINK_ROOT, LINK_SET, LINK_ALL_OTHERS, LINK_ALL_CHILDREN,LINK_THIS. See llMessageLinked() documentation in LSL Wiki on the web) | | lm-num-arg | 'num' arg for llMessageLinked() | | lm-str-arg | 'str' arg for llMessageLinked() |

The menu user's key is passed as the 'key' argument for llMessageLinked().

SWAP

This swaps positions between the first and second balls for any pose. It has no effect on any third or fourth balls in a pose.

BACK

This creates a button labeled "BACK" that, when used, displays the menu one level up in the menu hierarchy.

STOP

This creates a button labeled "STOP" that, when used, deletes any rezzed balls and unseats any participants.

Note though that it does not turn off the "listen" that the menu script is doing for menu commands. It will keep on listening, even when not in use.

OFF

Often referred to in menu cards as "Shutdown, using an alias for the button name like this:

OFF ShutDown!

This first sends out a llDie() command to any balls out there, then unseats any participants, then resets the ~run script.

Upon restarting, the ~run script is set to set all other scripts to not running (until the prim is clicked again, at which point it turns them back on again.)

This has the effect of shutting off the listen that is in the ~menu script. It also turns off the four other listens in each of these scripts: ~poser, poser1, poser2, and poser3.

With all the listens turned off, as well as all the other scripts, this helps to reduce the "footprint" of an MLP product in a sim.

RESET

Restarts the following scripts by resetting them:
~menu
~menucfg
~pos
~pose
~poser
~poser 1
~poser 2
~poser 3

RELOAD

Resets just the ~memory script.

RESTART

Does what both RESET and RELOAD do, combined.

POSRESET

MENURESET

ADJPOS

The ADJUST command makes the balls turn into long, translucent beams for easy editing to manoeuvre them into their proper positions for each pose.

TIP! Finding the beams hard to see? First, make sure that you have set world to noon. If you still find them difficult to edit, haul one out of your prim.

Edit the script in it, and look for this part of the script in the listen event:

       } else if (str == "ADJUST") {
           llSetAlpha(0.2,ALL_SIDES);
           llSetText("Adjust",<1.0,1.0,1.0>,1.0);
           llSetScale(<0.1,0.1,5.0>);


It's the llSetAlpha setting it to only .2 that makes it hard to see. Try it at .4, or point 6.

Save, take the ball into inventory, then delete the old one in the prim and replace it with your adjusted one.

SAVEPOS

MEMDUMP

Lists in open chat all positions currently stored in script memory. The user is meant to then copy/paste this information into the .POSITIONS notecard for backup. NOTE! It is for this reason that the .POSITIONS notecard should be released to customers as MODIFY.

Automore

.POSITIONS* files

The default pose

If on the main blue menu you do not see a button called "adj-default", do the following:

1) Create a notecard with the file name of:

.MENUITEMS.zz-default

Paste the following in as content (minus the solid lines, of course):

__________________________

// The "default" pose below is for adjusting "default" position.
// Since there are currently no other items in this menu, you can comment out the whole menu
// or simply delete this file when you've done that.

MENU adj-default | ALL | BLUE | PINK | BLUE | PINK
POSE default | sit_ground | sit_ground | sit_ground | sit_ground
SWAP
ADJUST
SAVE Save Pos
DUMP Mem Dump
BACK
__________________________


Drop this into the prim where you are working with MLPV2.

2) Make sure the main menu notecard has a spare TOMENU slot to fit the adj-default choice into:

TOMENU -


3) restart it.

Tip! If the product you are making is only for 1 or 2 people, then you don't need to include all 4 balls that are listed in the menu above.

For a solo product, you can just do instead:

MENU adj-default | ALL | BLUE
POSE default | sit_ground ADJUST
SAVE Save Pos
DUMP Mem Dump
BACK

Menu reset on rez