Change font size
It is currently Thu Nov 22, 2018 5:35 am

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 2 posts ]
Author Message
 Post subject: Multi Animation Sync Poseball (Scene Poseball)
PostPosted: Wed Apr 13, 2011 1:24 pm 

Joined: Sat Mar 05, 2011 4:44 pm
Posts: 2
Poseball men
{L_CODE}:
//First value is the waiting animation, second and else is for motion. The order is respected!
//Example: list animation = ["wait", "motion1", "motion2", "motionN"];
list ANIMS = ["waiting", "1", "2", "3"];

string  BUTTON      =   "Play";    // text of the pie menu
string  TITLE       =   "LoveTime";     // floating text
float   TIMEOUT     =   29.5;      // time to play each anim listed
vector  ROTATION    =   <0,0,0>;   // euler in degrees (like the edit box)
vector  OFFSET      =   <0,0,-0.2>; // how far the person sits from the ball. ( <X,Y,Z> )

//do not edit after this line if you are not confortable with programmin languages

string  BALL = "MAL"; integer RUN  = TRUE; integer MAL; integer FEM; integer INDEX;

show() { RUN = TRUE; llSetText(TITLE, <1.0,1.0,1.0> ,1.0); llSetAlpha(1.0, ALL_SIDES); }

hide() { RUN = FALSE; llSetText("", ZERO_VECTOR, FALSE); llSetAlpha(0.0, ALL_SIDES); }

stopAnims() {
    integer i; list anims = llGetAnimationList(llGetPermissionsKey());           
    for (i=0;i<llGetListLength(anims);++i) llStopAnimation(llList2Key(anims, i));
}
   
default {
    state_entry() {
        llSitTarget(OFFSET, llEuler2Rot(ROTATION * DEG_TO_RAD));
        if (llAvatarOnSitTarget()) { llUnSit(llAvatarOnSitTarget()); }
        llSetSitText(BUTTON); if (RUN) show(); else hide(); MAL = FALSE; FEM = FALSE;
    }

    link_message(integer sender_num, integer num, string str, key id) {
        if ((string)id=="BALL") {
            if (str=="MAL") { MAL=num; } else if (str=="FEM") { FEM=num; }
            if (FEM && MAL) { llMessageLinked(LINK_SET, TRUE, "ANIMS", NULL_KEY); }
            else if (FEM || MAL) { llMessageLinked(LINK_SET, FALSE, "ANIMS", NULL_KEY); }
            else { llResetScript(); }
        }
        else if (str=="ANIMS") {
            if (num) { INDEX = 0; llSetTimerEvent(0.01); }
            else { llSetTimerEvent(0.0); if (llAvatarOnSitTarget()) { stopAnims(); llStartAnimation(llList2String(ANIMS,0)); } }
        }
    }

    timer() { if (++INDEX==llGetListLength(ANIMS)) { INDEX=TRUE; } llStartAnimation(llList2String(ANIMS,INDEX)); llSetTimerEvent(TIMEOUT); }
   
    changed(integer change) {
        if(change & CHANGED_LINK) { key avatar = llAvatarOnSitTarget();
            if (avatar!=NULL_KEY) {
                if(llGetPermissionsKey() != avatar) { llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION); }
                hide(); llMessageLinked(LINK_SET, TRUE, BALL, (key)"BALL");
            }
            else if ((llGetPermissionsKey()!=NULL_KEY) && (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)) {
                show(); llMessageLinked(LINK_SET, FALSE, BALL, (key)"BALL"); stopAnims();
    }    } if (change & CHANGED_INVENTORY) { llResetScript(); }    }

    run_time_permissions(integer perm) {
        key avatar = llAvatarOnSitTarget();
        if(perm & PERMISSION_TRIGGER_ANIMATION && llKey2Name(avatar) != "" && avatar == llGetPermissionsKey()) {
            stopAnims();
            llStartAnimation(llList2String(ANIMS,0));
            hide();
    }   }   }



Poseball female
{L_CODE}:
//First value is the waiting animation, second and else is for motion. The order is respected!
//Example: list animation = ["wait", "motion1", "motion2", "motionN"];
list ANIMS = ["waiting", "1", "2", "3"];

string  BUTTON      =   "Play";    // text of the pie menu
string  TITLE       =   "";     // floating text
float   TIMEOUT     =   29.5;      // time to play each anim listed
vector  ROTATION    =   <0,0,0>;   // euler in degrees (like the edit box)
vector  OFFSET      =   <0,0,-0.2>; // how far the person sits from the ball. ( <X,Y,Z> )

//do not edit after this line if you are not confortable with programmin languages

string  BALL = "FEM"; integer RUN  = TRUE; integer MAL; integer FEM; integer INDEX;

show() { RUN = TRUE; llSetText(TITLE, <1.0,1.0,1.0> ,1.0); llSetAlpha(1.0, ALL_SIDES); }

hide() { RUN = FALSE; llSetText("", ZERO_VECTOR, FALSE); llSetAlpha(0.0, ALL_SIDES); }

stopAnims() {
    integer i; list anims = llGetAnimationList(llGetPermissionsKey());           
    for (i=0;i<llGetListLength(anims);++i) llStopAnimation(llList2Key(anims, i));
}
   
default {
    state_entry() {
        llSitTarget(OFFSET, llEuler2Rot(ROTATION * DEG_TO_RAD));
        if (llAvatarOnSitTarget()) { llUnSit(llAvatarOnSitTarget()); }
        llSetSitText(BUTTON); if (RUN) show(); else hide(); MAL = FALSE; FEM = FALSE;
    }

    link_message(integer sender_num, integer num, string str, key id) {
        if ((string)id=="BALL") {
            if (str=="MAL") { MAL=num; } else if (str=="FEM") { FEM=num; }
            if (FEM && MAL) { llMessageLinked(LINK_SET, TRUE, "ANIMS", NULL_KEY); }
            else if (FEM || MAL) { llMessageLinked(LINK_SET, FALSE, "ANIMS", NULL_KEY); }
            else { llResetScript(); }
        }
        else if (str=="ANIMS") {
            if (num) { INDEX = 0; llSetTimerEvent(0.01); }
            else { llSetTimerEvent(0.0); if (llAvatarOnSitTarget()) { stopAnims(); llStartAnimation(llList2String(ANIMS,0)); } }
        }
    }

    timer() { if (++INDEX==llGetListLength(ANIMS)) { INDEX=TRUE; } llStartAnimation(llList2String(ANIMS,INDEX)); llSetTimerEvent(TIMEOUT); }
   
    changed(integer change) {
        if(change & CHANGED_LINK) { key avatar = llAvatarOnSitTarget();
            if (avatar!=NULL_KEY) {
                if(llGetPermissionsKey() != avatar) { llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION); }
                hide(); llMessageLinked(LINK_SET, TRUE, BALL, (key)"BALL");
            }
            else if ((llGetPermissionsKey()!=NULL_KEY) && (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)) {
                show(); llMessageLinked(LINK_SET, FALSE, BALL, (key)"BALL"); stopAnims();
    }    } if (change & CHANGED_INVENTORY) { llResetScript(); }    }

    run_time_permissions(integer perm) {
        key avatar = llAvatarOnSitTarget();
        if(perm & PERMISSION_TRIGGER_ANIMATION && llKey2Name(avatar) != "" && avatar == llGetPermissionsKey()) {
            stopAnims();
            llStartAnimation(llList2String(ANIMS,0));
            hide();
    }   }   }


Top
 Profile  
 
 Post subject: Re: Multi Animation Sync Poseball (Scene Poseball)
PostPosted: Wed Aug 08, 2012 4:16 pm 

Joined: Wed Aug 08, 2012 2:34 am
Posts: 2
This script seems to work awesome, but...

Is there any possibility to make the poses work like this:

If one avatar sits on the poseball the animations sequence starts, but when another avatar sits on another ball linked with this one, the sequence synchronizes and starts from the beginning for two avatars and so on as many avatars as balls linked?

The best example would be TaiChi balls from Second Life.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 2 posts ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net