Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Face expression animations script

Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
07-17-2005 06:54
It has taken around a one third year since I began to learn LSL who didn't know any program language. I go on much these sample scritpts in this forum. I return a favor even though a little.
This is a face expression animations script. It is used a built-in animatiions.
CODE
// Created by Seagel Neville
// Thanks to Catherine Omega, the dialog boxes came to keep showing.
// You can not only just put this script in your attached object, but also
// put into a prim you rez to execute.

integer CHANNEL = 42; // dialog channel

list MENU_UNHAPPY = // The limit of dialog is only twelve. So I cannot help
[ // separating the list.
"disdain", "repulsed", "anger",
"bored", "sad", "cry",
"embarrased", "frawn","shrug",
"afraid", "worry", "surprise"
];

list MENU_HAPPY =
[
"wink", "toungue out", "kiss",
"toothesmile", "smile", "laugh",
"open mouth"
];


default {
state_entry()
{
llListen(CHANNEL, "", NULL_KEY, "");
llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
llInstantMessage(llGetOwner(), "Just typing \"/42menu\", you can express your emotions");
}
on_rez(integer total_number)
{
llResetScript();
}
listen(integer channel, string name, key id, string message)
{

if (llListFindList(MENU_UNHAPPY, [message]) != -1) // verify dialog choice
{
if (message == "afraid")
{
llStartAnimation("express_afraid_emote");
}
if (message == "anger")
{
llStartAnimation("express_anger_emote");
}
if (message == "bored")
{
llStartAnimation("express_bored_emote");
}
if (message == "cry")
{
llStartAnimation("express_cry_emote");
}
if (message == "disdain")
{
llStartAnimation("express_disdain");
}
if (message == "embarrased")
{
llStartAnimation("express_embarrassed_emote");
}
if (message == "frawn")
{
llStartAnimation("express_frown");
}
if (message == "repulsed")
{
llStartAnimation("express_repulsed_emote");
}
if (message == "sad")
{
llStartAnimation("express_sad_emote");
}
if (message == "shrug")
{
llStartAnimation("express_shrug_emote");
}
if (message == "surprise")
{
llStartAnimation("express_surprise_emote");
}
if (message == "worry")
{
llStartAnimation("express_worry_emote");
}
llDialog(llGetOwner(), "What do you want to express?", MENU_UNHAPPY, CHANNEL);
// The dialog box keeps showing until you chose "Ignore".
}
if (llListFindList(MENU_HAPPY, [message]) != -1) // verify dialog choice
{
if (message == "kiss")
{
llStartAnimation("express_kiss");
}
if (message == "laugh")
{
llStartAnimation("express_laugh_emote");
}
if (message == "open mouth")
{
llStartAnimation("express_open_mouth");
}
if (message == "smile")
{
llStartAnimation("express_smile");
}

if (message == "toungue out")
{
llStartAnimation("express_tongue_out");
}
if (message == "toothesmile")
{
llStartAnimation("express_toothsmile");
}
if (message == "wink")
{
llStartAnimation("express_wink_emote");
}
llDialog(llGetOwner(), "What do you want to express?", MENU_HAPPY, CHANNEL);
// The dialog box keeps showing until you chose "Ignore".
}
else if (message == "menu")
//If you cleard the dialog boxes, you could recall them by /42menu.
{
llDialog(llGetOwner(), "What do you want to express?", MENU_UNHAPPY, CHANNEL);
llDialog(llGetOwner(), "What do you want to express?", MENU_HAPPY, CHANNEL);
}
}
}

Hope you enjoy it. :)
_____________________
:) Seagel Neville :)
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Discussion thread
07-19-2005 21:49
/54/8c/54514/1.html
_____________________
i've got nothing. ;)