Wednesday 11 February 2009

Second Life -- Global Warming with Animations...

float p_size = 0.1;
string anim = "";
default
{

state_entry()
{
llSay(0, "Hello, Avatar!");
llSetPrimitiveParams( [ PRIM_GLOW, ALL_SIDES, 0 ] ) ;
llParticleSystem([]);
llSetText("In The Future", <1,0,0>, 1.0);
}

collision_start(integer num_detected)
{
llSay(0, llDetectedName(0) + " Start!");

}//End of collision start

collision(integer num_detected)
{

if (llDetectedName(0) == "2020")
{
anim = "express_surprise";
integer perm = llGetPermissions();
if (perm & PERMISSION_TRIGGER_ANIMATION) {
llStartAnimation(anim);
llSay(0, "I am Surprised its too HOT");
}
else {
llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
}

llSetPrimitiveParams( [ PRIM_GLOW, ALL_SIDES, .1 ] ) ;
llParticleSystem([ PSYS_PART_FLAGS, PSYS_PART_TARGET_POS_MASK | PSYS_PART_EMISSIVE_MASK,
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE | PSYS_SRC_BURST_RADIUS,
PSYS_PART_START_SCALE,,
PSYS_PART_END_SCALE,,
PSYS_SRC_BURST_PART_COUNT,5,
PSYS_SRC_ANGLE_BEGIN,0.2,
PSYS_SRC_TARGET_KEY,(key)llDetectedKey(0),
PSYS_PART_START_COLOR, <1,1,1>
]);

}

if (llDetectedName(0) == "2050")
{
anim = "drink";
integer perm = llGetPermissions();
if (perm & PERMISSION_TRIGGER_ANIMATION) {
llStartAnimation( anim);
llSay(0, "Drinking Water Its Very Hot");
}
else {
llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
}

llSetPrimitiveParams( [ PRIM_GLOW, ALL_SIDES, .5 ] ) ;
llParticleSystem([ PSYS_PART_FLAGS, PSYS_PART_TARGET_POS_MASK | PSYS_PART_EMISSIVE_MASK,
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE | PSYS_SRC_BURST_RADIUS,
PSYS_PART_START_SCALE,,
PSYS_PART_END_SCALE,,
PSYS_SRC_BURST_PART_COUNT,10,
PSYS_SRC_ANGLE_BEGIN,0.57,
PSYS_SRC_TARGET_KEY,(key)llDetectedKey(0),
PSYS_PART_START_COLOR, <1,1,1>
]);

}

if (llDetectedName(0) == "2070")
{
anim = "dead";
integer perm = llGetPermissions();
if (perm & PERMISSION_TRIGGER_ANIMATION) {
llStartAnimation( anim);
llSay(0, "I can not live anymore... I am DEAD :(");
}
else {
llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
}

llSetPrimitiveParams( [ PRIM_GLOW, ALL_SIDES, 1 ] ) ;
llParticleSystem([ PSYS_PART_FLAGS, PSYS_PART_TARGET_POS_MASK | PSYS_PART_EMISSIVE_MASK,
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE | PSYS_SRC_BURST_RADIUS,
PSYS_PART_START_SCALE,,
PSYS_PART_END_SCALE,,
PSYS_SRC_BURST_PART_COUNT,75,
PSYS_SRC_ANGLE_BEGIN,1.57,
PSYS_SRC_TARGET_KEY,(key)llDetectedKey(0),
PSYS_PART_START_COLOR, <1,1,1>
]);

}

}//End of collision start

collision_end(integer num_detected) {
llSay(0, llDetectedName(0) + " Ends!");
llSetPrimitiveParams( [ PRIM_GLOW, ALL_SIDES, 0 ] ) ;
llParticleSystem([]);
integer perm = llGetPermissions();
if (perm & PERMISSION_TRIGGER_ANIMATION) {
llStopAnimation(anim);
}
}

touch_start(integer num_detected) {
llRequestPermissions(llDetectedKey(0), PERMISSION_ATTACH);
llRequestPermissions(llDetectedKey(0), PERMISSION_TRIGGER_ANIMATION);
}

run_time_permissions(integer perm) {
if (perm & PERMISSION_ATTACH) {
llAttachToAvatar(ATTACH_HEAD);
}
}

attach(key attached)
{
if (attached == NULL_KEY) // object has been detached
{
llWhisper( 0, "You Dont Want to Enter the Future?" );
// etc.
}
else // object has been //attached//
{
llWhisper( 0, "Now you can enter the future -> " + llKey2Name(attached) );
// etc.
}
}
}

No comments:

Post a Comment

Azure OpenAI Architecture Patterns & Deployment Patterns

Sharing some useful links that will help customers architect Azure OpenAI solution using the best practices: (1) Azure OpenAI Landing Zone r...