My Mood Package
Moods and statuses for the visitors of your scene. A visitor types /Mood in Nearby Chat (or clicks an object) and a menu opens on their screen: "AFK", "Busy", "Dancing", "In Love", "Team Red"... They pick one, and the mood can post a message in the chat, show an item that follows their avatar (a sign above the head, a crown, hearts), play a sound, play an animation on their avatar, color their skin, and tint their clothes and their menu in the colors of a team. Moods can be grouped in categories (dances, teams, emotions): one mood per category at a time, several categories at once. Each mood ends by its own rules: the first step, the first chat message, a duration, another mood of its category, or the < Reset All Moods > row.
This package is standalone - it does not require any other MPP script to function. Three scripts delivered as one asset: one Menu per scene, one Entry per mood, and an optional Category per group of moods.
First release on the Store (V3.1.5). Everything a visitor sees is the same from one scene to another: the title of the menu, its rows, the four chat commands and the help are fixed in the script. The Build panel only holds what you choose: who can use the moods, how the menu looks, and one Entry per mood.
What You Get
The asset holds three script modules. When you add the script to an object, Sansar asks which module to use:
| Module | Put it on | Role |
|---|---|---|
| MPP - My Mood Menu | One object of the scene (any object, even a hidden one) | The chat commands, the menu, access and cooldown, the end of every mood, the chat messages, the skin and outfit colors. One per scene, always needed. |
| MPP - My Mood Entry | One object per mood (a small hidden cube is fine; several Entries can share one object) | Everything that makes one mood: its label, its category, its shortcut command, its item, animation, skin color, team colors, sound, messages and end rules. |
| MPP - My Mood Category | One object per category (optional; several Categories can share one object) | The options of one category of moods: its place in the menu, its enter and leave messages, Quiet Switch, the random row, Shortcut Prefix, Auto Switch, Command Opens Here. Without it, a category named by the Entries exists with the same rows and no option. |
Everything about a mood lives in its Entry. Copy an Entry object to make a new mood, change its label and what you like; delete an Entry and its row leaves the menu. Moods that share a Mood/Category are grouped in a submenu and exclude each other (one at a time); moods of different categories combine. The Menu finds the Entries and the Categories by itself, in any start order: nothing to link.
Quick Start
A - A first mood in two minutes. Add the Menu module to any object. Add the Entry module to another object: its defaults already make an "AFK" mood (message "Name is AFK.", ends at the first step or the first chat message, "Name is back."). Build the scene, type /Mood in Nearby Chat and pick "AFK".
B - A second mood. Copy the Entry object, then on the copy change Mood/Label (for example "Busy") and Activation/Shortcut Command (for example /busy). Set End/End On Move and End/End On Chat Off: a busy visitor can walk and talk. Your visitors can now type /busy directly; typed again, it removes the mood.
C - An item above the head. On an Entry, drop a sign from your inventory into Item/Mood Item. For the sign to follow the avatar, its object must have Movable From Script checked and a Keyframed rigid body (or none) before you save it to your inventory.
D - A clickable sign. On the Menu, set Activation/Enable Click On: clicking the Menu object opens the menu, for visitors who do not know /Mood.
E - Categories. On three Entries set Mood/Category to Dances: the menu now shows a << Dances >> row that opens them, and a visitor dances one dance at a time, while keeping their other moods. Add the Category module on any object with Category/Name = Dances to give the category its messages and its options (a shortcut prefix, a silent change of dance, an automatic change).
F - A team in its color. On an Entry of a Teams category, set Colors/Item Tint, Colors/Menu Tint and Colors/Outfit Tint to FF0000: the marker, the menu accent and the clothes of the red team turn red, and come back when the player leaves the team.
More ideas in "Recipes" at the end of this guide.
How It Works
- A visitor opens the menu (
/Moodor a click) and picks a mood, or types its shortcut (/afk). - The Menu checks access and the visitor's cooldown, then:
- if the visitor already has another mood of the same category (or another mood without category), it is replaced: its item goes away and its animation stops (inside a category that is not quiet, its leaving message is posted first);
- the moods of the other categories stay: a visitor can dance, wear a team marker and be AFK at the same time;
- the skin and the clothes take the colors of the mood (if it has some);
- the Entry shows the item, plays the sound and the animation;
- the mood message is posted.
- Each mood lasts until one of its own end rules triggers (see "Ending a Mood"). Then its item goes away, its animation stops, the colors of the previous mood (or the real ones) come back and the Back Text is posted.
What an avatar has only once. Items and sounds are independent: each mood has its own. The skin color, the outfit color and the animation are not: when a visitor takes a mood that colors the skin or the clothes, or plays a looping animation, while another one already does, the newest mood wins; when it ends, the previous one takes over again (its animation starts again from its beginning). A one-shot animation is never resumed.
When a visitor leaves the scene, or changes avatar (Look Book), every mood ends: the old avatar object is gone, and its item, animation and skin color with it.
The Menu
- Rows: "< Reset All Moods >" first (only for a visitor who has a mood: it removes all their moods), then the visitor's own mood, marked ("* AFK"), then the moods without category from A to Z (
Menu/Sort AlphabeticallyOn; Off, the default: by theMood/Orderof each Entry, 1 = top, then by label), then one row per category (<< Dances >>,<< Teams >>; byCategory/Order, then by name), then ">>> Settings...". - Marks: the rows that are not moods carry marks added by the menu, so a visitor tells them from the moods at a glance: one chevron for an action ("< Reset All Moods >", "< Reset Dances >", "< Random Dances >", "< Random switch: On >"), two for a category ("<< Dances >>"), three for the navigation ("<<< Back", "<<< Previous", "Next >>>", ">>> Settings..."). The texts are fixed in the script. The rows of the settings page keep their own text.
- Title: "My Mood" at the top level, "My Mood: Dances" inside a category, "My Mood: Settings" on the settings page.
- Subtitle:
Current: {mood}shows the visitor's moods, separated by commas ("Current: AFK, Salsa, Red"), or "none". - Picking the mood you already have keeps it: only its duration and its start position start again. No message.
- Shortcut tip: when a visitor picks in the menu a mood that has a shortcut command, they get a private message "Tip: type /afk in Nearby Chat to set AFK directly." (
Messages/Shortcut Tip Text, empty = none). - Many moods: the Sansar menu panel shows about 5 rows at a time and scrolls. Up to 32 rows fit in one menu. Above
Menu/Rows Per Page(20 by default; 32 is the Sansar maximum), the menu gets "<<< Previous" and "Next >>>" rows, at the top level and inside a category. - Colors:
Menu/Panel Background Color,Menu/Text ColorandMenu/Accent Colorare Sansar colors, set with the color picker of the Build panel. The alpha of the background is the transparency of the panel (0.25 by default: a see-through dark panel; 1 = opaque). Keep the alpha of the text and of the accent at 1: under 0.05 they become invisible, and the script console warns you. A mood withColors/Menu Tintgives the accent its own color to the visitor who has it (see Team Colors); the panel keeps its background. - >>> Settings...: the last row of the list opens the settings of this visitor (see below).
- Position:
Menu/Horizontal Position(6 by default) is the start side; the other side is its mirror (100 minus it: 94). Sansar has a menu placement bug acknowledged by its team: today only the horizontal position works, and only a little (6 = a bit to the left, 94 = a bit to the right, 10 to 50 look centered);Menu/Vertical Positionhas no effect yet. At 50 there is no other side and no side switch.
The menu is shown to one visitor at a time: other visitors never see it. Its title "My Mood", its footer "MPP - My Pretty Pixels" and the texts of its rows are fixed in the script: the Build panel only holds what changes from one scene to another.
Categories
A category groups moods in a submenu and makes them exclusive: a visitor has one mood of each category at a time, plus one mood without category. Set Mood/Category on the Entries (same name, case ignored). A category row (<< Dances >>) opens the submenu:
| Row of a category | Effect |
|---|---|
| <<< Back | Back to the top level |
| < Reset Dances > | Shown to a visitor who has a mood of this category: it removes that mood only |
| * Salsa | The visitor's mood of this category, marked, right after the reset row |
| Salsa, Tango, ... | The moods of the category, in menu order |
| < Random Dances > | A mood of the category picked at random, never the one the visitor has (shown when the category has two moods or more and Menu/Random Row of its module is On) |
| < Random switch: Off > / < Random switch: On > | The last row, shown when Auto/Switch Minutes is set: the visitor's own automatic switch, Off by default (Auto/Switch Default), turned On or Off with a click, for the visit. Turned On by a visitor who has no mood of the category, it starts a random one at once, like the Random row; a visitor who has one keeps it |
The Category module (MPP - My Mood Category, one per category, optional) names the category (Category/Name) and gives it:
Category/Order(50): its place among the category rows (1 = first), then by name.Messages/Enter TextandMessages/Leave Text(empty = the moods' own texts): posted when a visitor takes a mood of the category ("{name} starts dancing.") and when their mood of the category ends or gives way to another ("{name} stops dancing."), instead of the mood's Chat Text and Back Text; a change inside a quiet category posts nothing.{name},{mood},{category}.Messages/For EveryoneOff = private.Messages/Quiet Switch(Off): On = changing from one mood of the category to another posts nothing; Off = the change posts the leaving message first (the Leave Text, or the old mood's Back Text: "Bob leaves team Red.") then the entering one (the Enter Text, or the new mood's Chat Text: "Bob joins team Blue!").Chat/Shortcut Prefix(empty): every mood of the category without a shortcut of its own gets the prefix followed by its label without spaces:/Teamand "Red" give/TeamRed(typed again, it removes the mood).Auto/Switch Minutes(0 = Off): every that many minutes, the visitor's mood of the category changes to another mood of the category, at random (a dance that changes by itself), for the visitors who turned their "Random switch" row On (or everyone, whenAuto/Switch Defaultis On). A visitor who has no mood of the category and turns the row On starts a random one at once. No cooldown; the messages follow Quiet Switch.Menu/Command Opens Here(Off): On =/Mood(and the click on the Menu object) opens the menu in this category for a visitor whose last choice was made here, a mood, the Random row or the reset row, so a dancer changes dance in one click; "<<< Back" goes to the top level. Off = the menu opens at the top level (the teams).Menu/Random Row(On): Off = no "< Random {category} >" row in this category (a team is chosen, not drawn).
Without a module, a category named by the Entries exists with the same rows ("<< Dances >>", "< Reset Dances >", "< Random Dances >") and no option (no prefix, no messages, no auto switch). Two modules with the same name: the first one keeps the category (warning). A module whose name matches no Entry gives no row.
Settings of each visitor
">>> Settings..." opens a second page of the same menu, with the visitor's height offset under the title ("MoodItem Height Offset: +40 cm"):
| Row | Effect |
|---|---|
| <<< Back | Back to the moods |
| Move Menu Right >> / << Move Menu Left | The menu goes to the other side of the screen and opens again there. Useful to keep it clear of the Nearby Chat window, wherever the visitor placed it |
| MoodItem Higher (+20 cm) / MoodItem Lower (-20 cm) | Every mood item of this visitor goes 20 cm higher or lower, from -100 to +200 cm. The item of the current mood moves at once (at the next mood when that Entry has Item/Follow Avatar Off) |
| Reset MoodItem Position | Shown while the visitor's offset is not 0 cm: it goes back to 0 (the Avatars/Height Rules of the scene are not touched) |
| Buy My Mood (Sansar Store) | The last row: it opens the Sansar Store on the listing of My Mood, for a visitor who wants it in their own scene. The menu does not open again: the visitor is in the Store |
/MoodSet in Nearby Chat opens this page directly. Each click opens the settings again, so the visitor can click several times in a row (the Store row does not). Nothing here starts the cooldown or ends the mood.
Remembered from one visit to the next (Settings/Remember Settings, On by default): the side and the item height are saved for each visitor (by their persona, 2 seconds after their last click, or when they leave), in every scene that uses My Mood: a visitor who fixed the height for their avatar once finds it everywhere. Off: they last for the visit. Only these two values are saved, nothing else about the visitor. A side is saved only once the visitor has chosen one: until then, each scene opens the menu on its own side.
The rows of the settings page are fixed in the script; only Settings/Remember Settings is in the Build panel. The side switch shows when the menu position has another side (see Position).
The Store row. It opens the Sansar Store on the listing of the MyMood Package Script. The link is fixed in the script.
Chat Commands
All commands are typed in Nearby Chat. Exact match, case ignored (/mood works too).
| Command | Set on | Effect |
|---|---|---|
/Mood | Menu (fixed) | Opens the menu (in the category of the visitor's last choice when that category has Menu/Command Opens Here On) |
/NoMood | Menu (fixed) | Removes every mood of the visitor (never delayed by the cooldown) |
/MoodSet | Menu (fixed) | Opens the visitor's settings directly (menu side, MoodItem height, the Store row) |
/MoodHelp | Menu (fixed) | Sends the help again, in private |
/afk, /salsa... | each Entry, Activation/Shortcut Command | Sets that mood directly (it replaces the visitor's mood of the same category); typed again, removes it |
/TeamRed, /TeamBlue... | Category, Chat/Shortcut Prefix | The prefix and the label without spaces, for every mood of the category that has no shortcut of its own |
The four commands of the Menu are fixed in the script. If a shortcut is also a command of the Menu, the Menu wins and the shortcut is ignored (warning in the script console). Two Entries with the same shortcut: the first one in menu order wins (warning).
Ending a Mood
Each Entry chooses its own rules. They add up: the first one that triggers ends the mood. Each mood of a visitor ends on its own: a step ends "AFK" and leaves the team marker.
| Rule | Settings (Entry) | Detail |
|---|---|---|
| Moving | End/End On Move (On), End/Move Tolerance Meters (0.25), End/Turn Tolerance Degrees (20) | Ends when the avatar moves or turns more than the tolerances. The start position is taken one second after the mood starts. 180 degrees = turning never ends it (for a dance that spins). |
| Chatting | End/End On Chat (On) | Ends at the visitor's first Nearby Chat message. Messages starting with / (commands of any script) never count, nor the first 5 seconds (so "AFK" then "brb 5 min" keeps the mood). Only the author's own moods end. |
| Time | End/Duration Seconds (0 = no limit) | Ends by itself after that time. |
| Reset | Menu: the "< Reset All Moods >" row, or /NoMood | The visitor removes all their moods. |
| Category reset | The "< Reset Dances >" row of the category | The visitor removes their mood of that category only. |
| Shortcut | Entry: Activation/Shortcut Command (or the category prefix) | Typed again, removes that mood only. |
| Auto switch | Category: Auto/Switch Minutes, the visitor's "Random switch" row | The mood gives way to another mood of the category, at random. |
When another mood of the same category replaces it (with its Back Text or the category's Leave Text, unless the category is quiet), when the visitor leaves, or when the visitor changes avatar (every mood ends then, with its Back Text), the mood ends too.
Items
Item/Mood Item: any object from your inventory (sign, icon, crown, hearts, halo). Empty = no item.Item/Position Offset: meters from the avatar's feet, Z = up.<0,0,2.2>(default) is above the head of an average avatar,<0,0,1.85>to<0,0,1.9>sits on the head,<0,0,0.05>on the ground.Item/Rotation Offset: degrees around X, Y and Z. The item always turns with the avatar, so it keeps facing the same way relative to them.Item/Follow Avatar(On): the item follows the avatar while they walk, run or fly, and jumps with them after a teleport. The item's object needs Movable From Script, and a Keyframed rigid body or none (a Static or Dynamic one cannot be moved by a script). If it cannot follow, it stays where it appeared and the script console says why, once. Off: the item stays where it appeared.Item/Follow Avatar Scale(On): the wholePosition Offsetfollows the avatar scale given by Sansar, which includes the Scale of the character editor and the scale set by a script (a giant zone, a shrinking potion). At scale 2,<0,0,2.2>becomes 4.4 m, so the item stays above the head; at scale 0.5 it comes down to 1.1 m. The item moves when the scale changes during the mood. At scale 1 (normal size) nothing changes. Off: the offset never changes.- The item keeps its own size: no script can resize an object while the scene runs.
- The avatar never bumps into its own item: an item with a collision no longer pushes its avatar. Other avatars can still bump into it: a floating item is best without a rigid body.
Limits/Max Active Items(Menu, 0 = unlimited by default): the most mood items in the scene at once. When it is reached, a new mood is set without its item (everything else works). 0 = unlimited.
Tall and small avatars
No script can read the height of an avatar's body: an avatar made taller in a 3D tool (a custom avatar, or an avatar raised for high heels such as the H2AI system, up to about 20 cm) counts as a normal one, and an item set for normal avatars can sink into its head. Three ways, which add up:
- Keep
Item/Position Offsethigh enough for your usual visitors (2.2 m by default). - MoodItem Higher / Lower in the visitor's Settings: each visitor fixes it for their own avatar, once (remembered); Reset MoodItem Position puts it back to 0.
Avatars/Height Rules(Menu): a list ofword = centimetersrules, for exampleTall = 60orh2ai = 15, one per line or several on a line separated by semicolons or commas (Tall = 60; h2ai = 15). When a mood with an item starts, the Menu searches each word (case ignored) in the names of the avatar's materials; the first rule that matches raises all its items by that height (from -100 to +200 cm). It is checked again at each mood and at each MoodItem Higher / Lower click, so a visitor who changes avatar gets the right height. An invalid rule is named in the script console.
Scripts cannot read the name an avatar has in the Look Book (for every avatar they only see "CharacterHead_1", "CharacterHead_2"...): choose a word that only the materials of that avatar use, not a clothing material that other avatars may wear. To see them, set Debug/Debug Logging On on the Menu and give that visitor a mood: the console shows "Name: avatar, female skeleton, N material(s).", then "Name: materials: ..." on one or more lines, then the rule applied.
The height of a rule and the visitor's own setting add up, and both follow the avatar scale.
Animations
Emote/Animation: an animation from your inventory (imported or bought). Sansar's built-in emotes and the visitor's own animations cannot be started by a script. Empty = no animation.Emote/Female Skeleton Animation: optional; used instead for avatars with a female skeleton. WithDebug/Debug LoggingOn on the Entry, the console names the skeleton each time ("animation started (loop, full body, female skeleton, female animation)"): a way to check that an avatar creator set the right skeleton.Emote/Loop(On): repeats until the mood ends. Off: plays once, and the mood goes on (useEnd/Duration Secondsto end it too).Emote/Upper Body Only: only the upper body moves, so the avatar can still walk (good withEnd On MoveOff). Some animations have no upper-body part: test them.Emote/Speed: 1 = normal, from 0.1 to 10.Emote/Allow In VR(On): Off = VR visitors with their hands active keep control of their hands and get no animation.
When a looping mood ends, its animation is stopped. Sansar stops every animation of that body part then, including one started meanwhile by another object (a dance ball, a seat). A one-shot animation is never stopped.
Skin Color
- On the Entry:
Skin/Colorin RRGGBB, as copied from Photoshop (FFC4DA, a leading#is optional). Empty = the skin is not changed (the default). An invalid color is not used either: the skin is not changed and the script console names the value to fix.Skin/Fade Secondsgives a smooth change to the color and back (0 = instant, up to 10). - The color multiplies the skin:
FFFFFFchanges nothing, a light pastel (FFE9C7) gives a natural shade, a saturated color a strong effect. It can darken or color a skin, never lighten it. - The skin never becomes transparent: only the color changes, each material keeps its own transparency.
- The real colors are saved the first time and restored when the mood ends. Going from one colored mood to another changes the color directly.
How the skin is recognized. Clothes, hair and eyes are parts of the same avatar as the skin, so the Menu tells them apart by their material names and shaders:
- a material whose name contains a word of
Skin/Excluded Words(eye, hair, lash, brow, teeth, tongue, nail, makeup...) is never skin; - a material whose name or shader contains a word of
Skin/Skin Words(subsurface, the Sansar default avatar names) is skin; - a material whose whole name is one of
Skin/Skin Names(face, torso, arms, legs; an ending such as.001is ignored) is skin.
The default lists recognize the skin of the Sansar default avatars and of the common custom avatars (checked against the materials of 21 real avatars). An avatar whose skin cannot be recognized keeps its color, and the script console names it. To add an avatar, set Debug/Debug Logging On on the Menu, give that visitor a colored mood and read the list of their materials in the script console (name, shader, skin or not), then add a word or a name. Empty list = default words. A line of a list holds one word, or several separated by commas or semicolons (eye, hair; lash): a way to group them, and to stay under the 20 lines of the Build panel. Creature and furry avatars often name their skin body (add it to Skin/Skin Names) or fur (add it to Skin/Skin Words; a clothing material with "fur" in its name would take the color too).
Team Colors
Three colors on the Entry, each RRGGBB, empty = Off, for a team mood or any other:
Colors/Item Tint: every material of the Mood Item takes the color when the item appears, each keeping its own transparency. Only that Entry's item: the items of the other moods keep their colors. The mesh of the item must be Scriptable (the script console names the item otherwise).Colors/Menu Tint: while the visitor has the mood, the accent of their menu (title, border, highlighted row) takes the color; the panel keeps its background. Several moods with a Menu Tint: the newest wins, the previous one comes back when it ends.Colors/Outfit Tint: the clothes and accessories of the avatar take the color, withSkin/Fade Seconds, and their real colors come back when the mood ends. The outfit is every tintable material that the Menu does not take for skin and whose name has no excluded word (eye, hair, lash, brow, teeth, tongue, gums, nail, mouth, iris, cornea, sclera, pupil, tear, beard, makeup): as far as names tell, so read the material list withDebug/Debug Loggingfor a custom avatar. An avatar without clothes gets a Debug line, no warning. Skin and outfit are two layers with the same rules: the newest mood wins, the previous one takes over again, everything is restored once at "Reset All Moods"; a mood may color both.
Sound
Sound/Mood Sound: played at the avatar when the mood starts. The avatars nearby hear it, the avatars far away do not.Sound/Sound Volume0 to 200 percent (100 = original, 0 = no sound).Sound/Play Count: 1 = once (the default), 2 to 20 = that many times in a row, without a gap, 0 = in a loop until the mood ends. The length of the sound is read from the sound itself: nothing to set.Sound/Fade In Seconds(0 by default): the sound rises from silence to its volume in that time. Keep 0 for short sounds (a laugh, a clap) so they keep their attack.Sound/Fade Out Seconds(2 by default): when the mood ends while its sound still plays (end of the duration, first step, chat message, Reset, another mood), the sound goes down to silence in that time, then stops. 0 = it stops at once. A sound that has finished by itself needs no fade. When the visitor leaves the scene, their sound stops at once.- A sound that follows the avatar: a sound played at a position stays where it started. Put an audio emitter (an Audio component) in the Mood Item: the sound then plays on it and follows the avatar with the item. That item stays until the fade out has ended, then goes. Without an emitter, the sound plays at the avatar position, which is enough for a mood that ends at the first step.
Messages
- Help for newcomers: the help is sent in private to an allowed visitor 5 seconds after they arrive, at their first visit to this scene only (
Messages/Help On First Visit, On). By default: "Moods here: /Mood opens the mood menu, /NoMood removes your mood, /MoodSet sets your menu side and MoodItem height, /MoodHelp shows this help." The text and the commands are fixed in the script./MoodHelpsends it again at any time. A visitor who is not allowed gets no help. The first visit is remembered in the same Sansar data store as the settings, one mark per scene: when Sansar gives no data store, the help comes at every visit. Messages/Chat Text(at the start) andMessages/Back Text(at the end, and when another mood of the category replaces it unless the category is quiet; not when a loose mood replaces a loose mood):{name}= the visitor,{mood}= the label,{category}= its category (nothing without one). Empty = no message.Messages/For EveryoneOff: private messages to the visitor.- Category texts: a Category module's
Messages/Enter TextandLeave Textreplace the Chat Text and Back Text of its moods when filled, andMessages/Quiet SwitchOn silences the switches inside the category (see "Categories"). - Nearby only:
Messages/Nearby Meters(Menu, 0 = everyone) sends every public message (Chat Text, Back Text, category texts) in private to the avatars within that distance of the visitor, the visitor included, instead of the whole experience. Less chat noise in a big scene.
Access and Cooldown
Access/Permission Mode (1-3)(Menu, 3): who can open the menu and use the shortcuts. The scene owner is always allowed. 1 = owner only, 2 = owner +Access/Whitelist, 3 = everyone exceptAccess/Blacklist(empty = everyone). Lists take avatar handles or UUIDs, separated by commas or semicolons (@and case ignored).Access/Denied Text: private message to a refused visitor who opens the menu or types a shortcut, at most every 5 seconds.Access/Hide From DeniedOn: refused visitors do not even see the click on the Menu object.Activation/Cooldown Seconds(Menu, 2): the minimum time between two moods set by the same visitor. Removing a mood is never delayed.Activation/Cooldown Noticetells a visitor who is too fast how long to wait ({time},{seconds}), at most every 3 seconds.
Editor Properties Reference (27 + 34 + 12)
Menu - Activation
| Property | Type | Default | Description |
|---|---|---|---|
| Activation/Enable Click | bool | Off | A click on the Menu object opens the menu |
| Activation/Hover Text | string | "My Mood" | Hover text of that click; empty = My Mood |
| Activation/Cooldown Seconds | number, 0-600 | 2 | Minimum time between two moods set by the same visitor; a silent 0.1 s always remains |
| Activation/Cooldown Notice | bool | On | Private message to a visitor who is too fast |
| Activation/Cooldown Notice Text | string | "Please wait {time} before changing your mood again." | That message; {time} {seconds} |
Menu - Menu
| Property | Type | Default | Description |
|---|---|---|---|
| Menu/Sort Alphabetically | bool | Off | On = A to Z; Off = by Order, then label |
| Menu/Rows Per Page | int, 5-32 | 20 | Rows of one page, navigation included |
| Menu/Horizontal Position | number, 0-100 | 6 | Start side (6 = a bit left today); the side switch uses its mirror (94); 50 = no switch |
| Menu/Vertical Position | number, 0-100 | 50 | No effect yet (Sansar placement bug) |
| Menu/Panel Background Color | color | (0.08, 0.08, 0.08, 0.25) | Background of the menu; its alpha = transparency |
| Menu/Text Color | color | (0.95, 0.95, 0.95, 0.75) | Rows, subtitle, footer |
| Menu/Accent Color | color | (1, 0.25, 0.5, 1) | Title, border, row under the pointer |
Menu - Settings (of each visitor)
| Property | Type | Default | Description |
|---|---|---|---|
| Settings/Remember Settings | bool | On | Side and item height kept from one visit to the next, in every My Mood scene; Off = for the visit |
Menu - Skin, Limits, Avatars
| Property | Type | Default | Description |
|---|---|---|---|
| Skin/Skin Words | list | subsurface, def_male, def_female | Name or shader word that means skin; several per line, with commas or semicolons |
| Skin/Skin Names | list | face, torso, arms, legs, head, body, skin, hands, alinaavsg3, alinaavsg5 | Whole material names that mean skin; several per line |
| Skin/Excluded Words | list | eye, lash, brow, iris, cornea, sclera, pupil, tear, hair, beard, teeth, tongue, tonque, mouth, moanth, gums, nail, makeup, alinaavsg1, alinaavsg7 | Name words that are never skin nor outfit; several per line |
| Limits/Max Active Items | int, 0-100 | 0 | Mood items in the scene at once; 0 = unlimited |
| Avatars/Height Rules | list | - | word = centimeters: items higher for an avatar with a material whose name contains the word; first match wins; several rules per line, with semicolons |
Menu - Access, Messages, Debug
| Property | Type | Default | Description |
|---|---|---|---|
| Access/Permission Mode (1-3) | int | 3 | 1 owner only, 2 owner + Whitelist, 3 everyone except Blacklist |
| Access/Whitelist | string | "" | Handles or UUIDs for mode 2 |
| Access/Blacklist | string | "" | Handles or UUIDs for mode 3 |
| Access/Denied Text | string | "You are not allowed to use this mood menu." | Private refusal, at most every 5 s; empty = silent |
| Access/Hide From Denied | bool | Off | Refused visitors do not see the click |
| Messages/Help On First Visit | bool | On | The help, in private, 5 s after the first visit of an allowed visitor to this scene; Off = only with /MoodHelp |
| Messages/Shortcut Tip Text | string | "Tip: type {command} in Nearby Chat to set {mood} directly." | Private tip after a menu pick; {command} {mood} {name} {category} |
| Messages/Nearby Meters | number, 0-1000 | 0 | Public messages go in private to the avatars within this distance of the visitor; 0 = everyone |
| Debug/Debug Logging | bool | Off | Writes every registration, menu, change, end reason, refusal and the avatar material list to the script console; Off = two start lines and the warnings |
Entry
| Property | Type | Default | Description |
|---|---|---|---|
| Activation/Shortcut Command | string | "" | Sets the mood directly, typed again removes it; empty = Off (or the category's Shortcut Prefix + label) |
| Mood/Label | string | "AFK" | Row in the menu and {mood}; empty = not shown |
| Mood/Order | int, 1-99 | 50 | Place when Sort Alphabetically is Off (1 = top) |
| Mood/Category | string | "" | Category of the mood (a submenu and a layer; case ignored); empty = no category |
| Item/Mood Item | object | - | Item shown on the avatar; empty = none |
| Item/Position Offset | vector | <0,0,2.2> | Meters from the feet, Z = up |
| Item/Rotation Offset | vector | <0,0,0> | Degrees, from the direction the avatar faces |
| Item/Follow Avatar | bool | On | The item follows the avatar (Movable From Script needed) |
| Item/Follow Avatar Scale | bool | On | The Position Offset follows the avatar scale (character editor and scripts; 2 = offset doubled) |
| Emote/Animation | animation | - | Animation from your inventory; empty = none |
| Emote/Female Skeleton Animation | animation | - | Used instead for female skeletons |
| Emote/Loop | bool | On | Off = plays once |
| Emote/Upper Body Only | bool | Off | The avatar can still walk |
| Emote/Speed | number, 0.1-10 | 1 | Animation speed |
| Emote/Allow In VR | bool | On | Off = no animation for VR visitors with hands |
| Skin/Color | RRGGBB | "" | Skin color while the mood lasts (multiplies the skin); empty = no change |
| Skin/Fade Seconds | number, 0-10 | 0.5 | Smooth change and return; 0 = instant (the outfit too) |
| Colors/Item Tint | RRGGBB | "" | Color of the Mood Item (every material, alpha kept); empty = its own colors |
| Colors/Menu Tint | RRGGBB | "" | Accent of the visitor's menu while they have the mood; empty = the Menu's Accent Color |
| Colors/Outfit Tint | RRGGBB | "" | Color of the clothes and accessories (not the skin, not the excluded words), Skin fade; empty = no change |
| End/End On Move | bool | On | Moving or turning ends the mood |
| End/Move Tolerance Meters | number, 0.05-5 | 0.25 | Distance allowed |
| End/Turn Tolerance Degrees | number, 1-180 | 20 | Angle allowed; 180 = turning never ends it |
| End/End On Chat | bool | On | A chat message ends the mood (not / commands, not the first 5 s) |
| End/Duration Seconds | number, 0-3600 | 0 | Ends after that time; 0 = no limit |
| Sound/Mood Sound | sound | - | Played at the avatar at the start, heard nearby; on the Mood Item's audio emitter if it has one |
| Sound/Sound Volume | int, 0-200 | 100 | Percent; 0 = no sound |
| Sound/Play Count | int, 0-20 | 1 | 1 = once, N = N times in a row, 0 = loop until the mood ends |
| Sound/Fade In Seconds | number, 0-10 | 0 | Rise from silence; 0 = none |
| Sound/Fade Out Seconds | number, 0-10 | 2 | Down to silence when the mood ends while the sound plays; 0 = stop at once |
| Messages/Chat Text | string | "{name} is {mood}." | At the start; {name} {mood} {category}; empty = none |
| Messages/Back Text | string | "{name} is back." | At the end, and when another mood of the category replaces it (not in a quiet category, nor for a loose mood); empty = none |
| Messages/For Everyone | bool | On | Off = private messages |
| Debug/Debug Logging | bool | Off | Writes the start line and every item, animation, sound and follow event of this mood; Off = the warnings only |
Category
| Property | Type | Default | Description |
|---|---|---|---|
| Category/Name | string | "Dances" | Name of the category, as in Mood/Category of its moods (case ignored); empty = the module does nothing |
| Category/Order | int, 1-99 | 50 | Place among the category rows (1 = first), then by name |
| Menu/Command Opens Here | bool | Off | /Mood and the click open the menu in this category for a visitor whose last choice was made here |
| Menu/Random Row | bool | On | Off = no "< Random {category} >" row in this category |
| Messages/Enter Text | string | "" | Posted when a visitor takes a mood of the category, instead of the mood's Chat Text; {name} {mood} {category}; empty = the mood's text |
| Messages/Leave Text | string | "" | Posted when the mood of the category ends or gives way to another, instead of the mood's Back Text; empty = the mood's text |
| Messages/Quiet Switch | bool | Off | On = a change of mood inside the category posts nothing |
| Messages/For Everyone | bool | On | Enter and Leave Text public; Off = private |
| Chat/Shortcut Prefix | string | "" | Prefix + label without spaces = the shortcut of every mood of the category without one; empty = none |
| Auto/Switch Minutes | number, 0-120 | 0 | The mood of the category changes to another one, at random, every N minutes, for the visitors whose switch is On; 0 = Off |
| Auto/Switch Default | bool | Off | On = the automatic switch is on for every visitor until they turn it off; Off = off until they turn it on |
| Debug/Debug Logging | bool | Off | Writes the start line and the registration of the category; Off = the warnings only |
Version Notes
| Version | What changed |
|---|---|
| V3.1.5 (this version) | First release on the Store. |
Recipes
AFK. Entry defaults, plus a sign "AFK" as Item/Mood Item and /afk as shortcut.
Busy (stays until removed). End/End On Move Off, End/End On Chat Off, Duration Seconds 0, a red "Busy" sign. It ends with /busy, "< Reset All Moods >" or another mood without category.
Sitting and chatting. A sitting animation (loop, full body), End On Chat Off, Turn Tolerance Degrees 45, empty Chat Text and Back Text (no chat noise).
Dancing. A dance animation (loop), Move Tolerance Meters 1.5, Turn Tolerance Degrees 180, End On Chat Off.
Laughing (a short burst). A laugh animation with Loop Off and Upper Body Only On, a laugh sound (Play Count 1), Duration Seconds 8, End On Move and End On Chat Off, empty Back Text.
Applause. A clapping animation (loop, upper body), an applause sound with Play Count 0 (loop) and Fade Out Seconds 2, Duration Seconds 6: the applause fades out at the end.
On the phone, with a ringtone that follows. A phone item with an audio emitter, a ringtone with Play Count 3, End On Move Off: the ringtone follows the visitor who walks.
In Love. Floating hearts, Skin/Color FFC4DA, Fade Seconds 2, Duration Seconds 60.
A tall custom avatar. Ask that visitor to open ">>> Settings..." and click "MoodItem Higher (+20 cm)" until the item floats above their head: it is remembered for their next visits ("Reset MoodItem Position" puts it back to 0). For a group of avatars that share a word in the names of their materials, add a line to Avatars/Height Rules instead, for example h2ai = 15.
Teams for a game. One Entry per team with Mood/Category = Teams: "Red", "Blue"... each with a colored marker as Item/Mood Item, Messages/Chat Text "{name} joins team {mood}!", Back Text "{name} leaves team {mood}.", End On Move and End On Chat Off. A Category module named Teams with Chat/Shortcut Prefix /Team (so /TeamRed joins Red); the rows read "<< Teams >>", "< Reset Teams >" and "< Random Teams >". Players keep their team while they take other moods, and a player who joins Blue leaves Red by itself. Colors: on the Red Entry, Colors/Item Tint FF0000 (the marker turns red), Colors/Menu Tint FF0000 (a red player has a red menu accent) and Colors/Outfit Tint FF0000 (their clothes turn red, and back when they leave the team); the same in blue on the Blue Entry. Menu/Random Row Off on the Teams module if the teams are chosen rather than drawn.
Dances. One Entry per dance with Mood/Category = Dances, its animation (loop, full body), End On Chat Off, Turn Tolerance Degrees 180, Move Tolerance Meters 1.5, empty Chat Text and Back Text. A Category module named Dances with Messages/Enter Text "{name} starts dancing.", Messages/Leave Text "{name} stops dancing.", Messages/Quiet Switch On (changing dance says nothing) (the rows read "< Reset Dances >" and "< Random Dances >"), Menu/Command Opens Here On (/Mood reopens the dances for a dancer), and Auto/Switch Minutes 3 for a dance that changes by itself for the dancers who turn "Random switch" On (a visitor who is not dancing and turns it On starts dancing at once). A dancer who takes "In Love" (skin color, hearts) keeps dancing.
Troubleshooting
| Symptom | Check |
|---|---|
/Mood does nothing | A Menu in the scene? The visitor allowed by Access/Permission Mode? The script console shows "My Mood Menu V3.1.5 initialized." at the start |
| What the script console shows | With every Debug/Debug Logging Off: two lines at the start, "My Mood Menu V3.1.5 initialized." and "Entries: 12 (12 shown in the menu), 2 categories.", then only the warnings. A missing mood? Set Debug Logging On on its Entry (its start line and its registration appear) and on the Menu ("Entry registered: ...") |
| "N scripts of the package are not V..." | Those entries or category modules were not updated with the Menu: they keep working, update them to the same version |
| "No mood is available here right now." | No Entry registered: each Entry needs a Mood/Label. The console shows "Entries: N" at the start and, with Debug Logging On on the Menu, "Entry registered: ..." for each one |
| A mood is missing from the menu | Two Entries with the same label (the copy is hidden), or a label equal to a row of the menu itself ("< Reset All Moods >", ">>> Settings...", "<<< Previous", "Next >>>"): a warning in the console names it |
| A shortcut does nothing | Empty, used by another Entry, or equal to a Menu command: a warning names it |
| The item does not follow | Its object needs Movable From Script, and a Keyframed rigid body or none; save it to the inventory again. The console says it once |
| The item sinks into the head of a tall avatar | That visitor uses ">>> Settings..." then "MoodItem Higher (+20 cm)" (remembered); or add a line to Avatars/Height Rules (see "Tall and small avatars") |
| The item pushes other avatars | Remove the rigid body of the item's object: a floating item needs no collision (its own avatar already ignores it) |
| The item is too high above a small avatar | Lower Item/Position Offset a little, keeping it above your usual visitors; a small avatar can also use "MoodItem Lower (-20 cm)" |
| A height rule does nothing | Debug Logging On on the Menu, then a mood: the console shows the material names a rule can match, then the rule applied. The name of the avatar in the Look Book cannot be matched |
| The help comes again after I rebuild the scene | It should not. Set Debug Logging On on the Menu: the start lines show "Scene key=..." and a read the data store refused shows its reason |
| No item appears | Limits/Max Active Items reached? Item/Mood Item set? |
| The skin does not change | Skin/Color filled with six digits (RRGGBB)? An invalid color is named in the console at the start. The console says "No skin material found on the avatar of ..." for an avatar it cannot recognize: see "Skin Color" |
| The sound stays behind when the avatar walks | A sound follows the avatar only on an audio emitter: add an Audio component to the Mood Item |
| A sound stops abruptly | Sound/Fade Out Seconds 0? Set 1 or 2 |
| Clothes or hair change color | That material's name contains a skin word: add a word of its name to Skin/Excluded Words |
| The mood ends by itself right away | End On Move with an animation that moves or turns the avatar: raise the tolerances, set Upper Body Only, or End On Move Off |
| The menu hides my Nearby Chat window | ">>> Settings..." at the end of the menu, then "Move Menu Right >>" (or "<< Move Menu Left"): it goes to the other side, and stays there at the next visits |
| A visitor gets no help at arrival | Not their first visit to this scene (/MoodHelp shows it), not allowed by Access/Permission Mode, or Messages/Help On First Visit Off |
| The help comes at every visit | Sansar gave no data store: the script console said "The visitor settings cannot be remembered" at the start |
| The settings are not remembered | Settings/Remember Settings On? The script console says "The visitor settings cannot be remembered" when Sansar gives no data store |
| The "Buy My Mood" row does nothing | Sansar refused or delayed the opening of the Store (the script console says so with Debug Logging On): click the row again |
| A mood is not in its category | Its Mood/Category is spelled differently (spaces count; case does not) |
| The options of a Category module are not used | Its Category/Name must match the moods' Mood/Category; with Debug Logging On on the Menu, the console shows "Category registered: ..." with the number of moods |
| My dance animation stopped when I took another mood | That mood has an animation too: the newest one wins, and the dance starts again when it ends |
| The clothes of a visitor did not take the team color | Their avatar names its clothes with a skin or excluded word, or those materials have no tint: Debug/Debug Logging On on the Menu lists the materials ("outfit" or "not outfit", with the reason); adjust the Skin lists |
| The Mood Item kept its colors | Its mesh is not Scriptable (the script console names the item), or Colors/Item Tint is not a RRGGBB color (warning at the start) |
| The dance never changes by itself | The visitor's "Random switch" row is Off (Off by default): they click it, or set Auto/Switch Default On |
| A dance started when the visitor clicked "Random switch" | They had no dance: turning the switch On starts a random one. A visitor who is dancing keeps their dance |
/Mood opens a category instead of the list | Menu/Command Opens Here is On on that category: the visitor's last choice was made there; "<<< Back" goes to the top level |
| A mood ended by itself with "avatar changed" | The visitor changed avatar (Look Book): every mood ends then |
| Some visitors do not get the chat messages | Messages/Nearby Meters is set: only the avatars within that distance of the visitor get them |
| "Another MPP - My Mood Menu is in the scene" | Keep one Menu only: the second one stops by itself |
| A mood or a category module is missing from the menu, without any warning | Its Entry or Category module runs a version older than 3.1.0 (their registrations are no longer read): update every script of the package to the same version |
| "No MPP - My Mood Menu answered" | An Entry without a Menu: add one Menu to the scene |
Limits
- Only a VR head can be read by a script, not a desktop camera:
End On Movereacts to the avatar's position and facing. - Animations come from the inventory of the person who sets the Entry. Sansar's built-in emotes cannot be started by a script.
- The skin color multiplies the skin: it cannot lighten it. An avatar whose skin has neither a recognized name nor a skin shader keeps its color.
- Stopping a looping mood animation stops the other animations of that body part too.
- No script can read the height of an avatar's body, nor its name in the Look Book: the item follows the avatar scale (character editor and scripts), and the height rules (material names) and each visitor's MoodItem Higher / Lower make up for the rest. The item keeps its own size.
- In the first 20 seconds of a scene the Sansar data store may not answer yet: the settings and the first-visit mark of the first visitors are read again until it does, so their help may come a few seconds later. A visitor already in the scene when the Menu starts is read at that moment.
- A menu shows up to 32 rows; the Sansar panel shows about 5 at a time and scrolls.
- A visitor has one mood per category (and one without): the moods of one category exclude each other. The skin color and the animation belong to the newest mood that has one.
- The menu cannot be dragged: its place is set by the script, and Sansar's placement bug only leaves a left and a right side today.
- The visitor settings are kept in a Sansar data store shared by every scene that uses My Mood, one entry per persona (side and item height only).
- Public messages go to everyone in the experience, unless
Messages/Nearby Meterslimits them to the avatars nearby.
Related MPP Items
| Item | What it adds |
|---|---|
| Commands Help On Chat Script | A help text for all the commands of your scene, and a public greeting: list /Mood, /MoodHelp and your mood shortcuts there (My Mood's own help only covers the mood commands, in private). Store: https://www.sansar.com/store/listings/fea2df6b-21ce-48eb-94fc-4b7a7aad2777/commands-help-on-chat-script |
| Rotator Script | A Mood Item that turns while it follows the avatar: a spinning crown, a rotating sign. Put it on the item before you save it to your inventory. Store: https://www.sansar.com/store/listings/89d478b4-0897-4f94-a690-4bf992e138da/rotator-script |
MPP - My Pretty Pixels. MyMood Package Script (modules MPP - My Mood Menu, MPP - My Mood Entry and MPP - My Mood Category). Store: https://www.sansar.com/store/listings/1d1554e6-1b14-4dcb-9f33-29f2f39c6e91/mymood-package-script