Change font size
It is currently Tue Jul 17, 2018 11:27 pm

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 6 posts ]
Author Message
 Post subject: Sync Poseballs
PostPosted: Mon Feb 22, 2010 8:12 pm 
OSG Elite
User avatar

Joined: Thu Dec 11, 2008 7:51 am
Posts: 392
Location: England UK
Buildage
--------------
Create two prims (usually spheres 0.2-0.3m) and link them, drop the main script into one along with animation A and drop the slave script into the other along with animation B.

Usage
--------------
You and another avatar hop on the balls and away you go!
The anims will sync whenever an avatar gets on either of the balls, or can be manually synced by issuing the chat command /1sync (either avatar can do this). There is also a configurable timer (in the main script) for an auto sync (set at 2 minutes default). the auto sync can be disabled by setting to 0.

Commands:
/1show - shows the balls
/1hide - hides the balls
/1sync - syncs the balls

Main Script:
{L_CODE}:
//d'Elle Tech Sync Poseball Script (Main) by Adelle Fitzgerald


//Licenced under Creative Commons Attribution-Share Alike 3.0 Unported - http://creativecommons.org/licenses/by-sa/3.0/


//You are free:

//    * to Share — to copy, distribute and transmit the work
//    * to Remix — to adapt the work

//Under the following conditions:

//    * Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).

//    * Share Alike — If you alter, transform, or build upon this work, you may distribute the resulting work only under the same, similar or a compatible license.

//With the understanding that:

//    * Waiver — Any of the above conditions can be waived if you get permission from the copyright holder.
//    * Public Domain — Where the work or any of its elements is in the public domain under applicable law, that status is in no way affected by the license.
//    * Other Rights — In no way are any of the following rights affected by the license:
//          o Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations;
//          o The author's moral rights;
//          o Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights.
//    * Notice — For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page.

//Disclaimer

//The Commons Deed is not a license. It is simply a handy reference for understanding the Legal Code (the full license) — it is a human-readable expression of some of its key terms. Think of it as the user-friendly interface to the Legal Code beneath. This Deed itself has no legal value, and its contents do not appear in the actual license.

//Creative Commons is not a law firm and does not provide legal services. Distributing of, displaying of, or linking to this Commons Deed does not create an attorney-client relationship.



string animation;
string text = "Sit";
vector target = <-0.5,0,-0.4>;
vector rot = <0,-90,180>;
key otherAvie;
integer debug = FALSE;
integer reSyncTimer = 120; //Timer for auto-resync - set to 0 for disabled.

default
{
    on_rez(integer start_param)
    {
        llResetScript();
    }

    state_entry()
    {
        animation = llGetInventoryName(INVENTORY_ANIMATION, 0);
        llListen(1,"","","");
        llSetText(text,<1,1,1>,1);
        llSetAlpha(1.0,ALL_SIDES);
        llSitTarget(target,llEuler2Rot(rot*DEG_TO_RAD));
    }
   
    listen(integer channel, string name, key id, string message)
    {                 
        if(message == "show")
        {
            llSetAlpha(1.0,ALL_SIDES);
            llSetText(text,<1,1,1>,1);
            llMessageLinked(LINK_ALL_OTHERS, 0, "show", "NULL_KEY");
        }           
        if(message == "hide")
        {
            llSetAlpha(0.0,ALL_SIDES);
            llSetText("",<1,1,1>,1);
            llMessageLinked(LINK_ALL_OTHERS, 0, "hide", "NULL_KEY");
        }
        if (id == llAvatarOnSitTarget() || id == otherAvie)
        {           
            if(message == "sync")
            {
                if (debug) llSay(0,"Re-syncing main");
                llMessageLinked(LINK_ALL_OTHERS, 0, "sync", "NULL_KEY");
                llStopAnimation(animation);
                llStartAnimation(animation);
            }
        }
           
    }

    changed(integer change)
    {
        if(change & CHANGED_LINK)
        {
            key avatar = llAvatarOnSitTarget();
            if(avatar != NULL_KEY)
            {
                llRequestPermissions(avatar,PERMISSION_TRIGGER_ANIMATION);
            }
            else
            {
                if (llGetPermissionsKey() != NULL_KEY)
                {
                    llStopAnimation(animation);
                    llResetScript();
                }
            }
        }       
    }

    run_time_permissions(integer parm)
    {
        if(parm == PERMISSION_TRIGGER_ANIMATION)
        {
            llStopAnimation("sit");
            llMessageLinked(LINK_ALL_OTHERS, 0, "sync", "NULL_KEY");
            llStartAnimation(animation);
            llSetAlpha(0.0,ALL_SIDES);
            llSetText("",<1,1,1>,1);
            llSetTimerEvent(reSyncTimer);
        }
    }
    link_message(integer int,integer num,string str,key id)
    {
        if(str == "sync")
        {
            if (debug) llSay(0,"Re-syncing main");
            llStopAnimation(animation);
            llStartAnimation(animation);
        }
        else if (str == "otherAvie")
        {
            if (debug) llSay(0,"Other Avie: " + (string)id);
            otherAvie = id;
        }
    }
    timer()
    {
        if (debug) llSay(0,"Re-syncing main");
        llStopAnimation(animation);
        llMessageLinked(LINK_ALL_OTHERS, 0, "sync", "NULL_KEY");
        llStartAnimation(animation);
    }
}


Slave Script:
{L_CODE}:
//d'Elle Tech Sync Poseball Script (Slave) by Adelle Fitzgerald


//Licenced under Creative Commons Attribution-Share Alike 3.0 Unported - http://creativecommons.org/licenses/by-sa/3.0/


//You are free:

//    * to Share — to copy, distribute and transmit the work
//    * to Remix — to adapt the work

//Under the following conditions:

//    * Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).

//    * Share Alike — If you alter, transform, or build upon this work, you may distribute the resulting work only under the same, similar or a compatible license.

//With the understanding that:

//    * Waiver — Any of the above conditions can be waived if you get permission from the copyright holder.
//    * Public Domain — Where the work or any of its elements is in the public domain under applicable law, that status is in no way affected by the license.
//    * Other Rights — In no way are any of the following rights affected by the license:
//          o Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations;
//          o The author's moral rights;
//          o Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights.
//    * Notice — For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page.

//Disclaimer

//The Commons Deed is not a license. It is simply a handy reference for understanding the Legal Code (the full license) — it is a human-readable expression of some of its key terms. Think of it as the user-friendly interface to the Legal Code beneath. This Deed itself has no legal value, and its contents do not appear in the actual license.

//Creative Commons is not a law firm and does not provide legal services. Distributing of, displaying of, or linking to this Commons Deed does not create an attorney-client relationship.



string animation;
string text = "Sit";
vector target = <-0.5,0,-0.2>;
vector rot = <0,-90,180>;
integer debug = FALSE;

default
{
    on_rez(integer start_param)
    {
        llResetScript();
    }

    state_entry()
    {
        animation = llGetInventoryName(INVENTORY_ANIMATION, 0);
        llSetText(text,<1,1,1>,1);
        llSetAlpha(1.0,ALL_SIDES);
        llSitTarget(target,llEuler2Rot(rot*DEG_TO_RAD));
    }
   
    link_message(integer int,integer num,string str,key id)
    {                   
        if(str == "sync")
        {
            if (debug) llSay(0,"Re-syncing slave");
            llStopAnimation(animation);
            llStartAnimation(animation);
        }         
        if(str == "show")
        {
            llSetAlpha(1.0,ALL_SIDES);
            llSetText(text,<1,1,1>,1);
        }           
        if(str == "hide")
        {
            llSetAlpha(0.0,ALL_SIDES);
            llSetText("",<1,1,1>,1);
        }
    }

    changed(integer change)
    {
        if(change & CHANGED_LINK)
        {
            key avatar = llAvatarOnSitTarget();
            if(avatar != NULL_KEY)
            {
                llRequestPermissions(avatar,PERMISSION_TRIGGER_ANIMATION);
            }
            else
            {
                if (llGetPermissionsKey() != NULL_KEY)
                {
                    llStopAnimation(animation);
                    llResetScript();
                }
            }
        }       
    }

    run_time_permissions(integer parm)
    {
        if(parm == PERMISSION_TRIGGER_ANIMATION)
        {
            llStopAnimation("sit");
            llMessageLinked(LINK_ALL_OTHERS, 0, "otherAvie", llAvatarOnSitTarget());
            llMessageLinked(LINK_ALL_OTHERS, 0, "sync", "NULL_KEY");
            llStartAnimation(animation);
            llSetAlpha(0.0,ALL_SIDES);
            llSetText("",<1,1,1>,1);
        }
    }   
}

_________________
"Nothing lasts forever; It's scientific"
~David Byrne (Talking Heads)


Top
 Profile  
 
 Post subject: Re: Sync Poseballs
PostPosted: Tue Feb 23, 2010 9:02 am 
Furious Typer

Joined: Wed Jan 21, 2009 10:17 am
Posts: 85
Wow... what a great thing to provide the community! Thanks Adelle!


Top
 Profile  
 
 Post subject: Re: Sync Poseballs
PostPosted: Sat Feb 27, 2010 8:55 am 
User avatar

Joined: Sun Nov 29, 2009 11:24 pm
Posts: 15
Thank You!!!


Top
 Profile  
 
 Post subject: Re: Sync Poseballs
PostPosted: Sat Feb 27, 2010 9:41 am 
OSG Elite

Joined: Wed Aug 05, 2009 1:59 am
Posts: 417
Kewl, now a crash course on how to make the actual animations :D

Thanks Adelle


Top
 Profile  
 
 Post subject: Re: Sync Poseballs
PostPosted: Sat Feb 27, 2010 11:46 pm 

Joined: Sat Feb 27, 2010 11:45 pm
Posts: 2
Thanks for scripts =)

And Poser works great to make animations.
it can also make skins.


Top
 Profile  
 
 Post subject: Re: Sync Poseballs
PostPosted: Sun Feb 28, 2010 6:29 am 
Now we can waltz and tango!


Top
  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 6 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:  
cron


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