Jump to content

Poseball with Adjust Menu


Tristesse Absinthe
 Share

You are about to reply to a thread that has been inactive for 366 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

First, I tried to search for a script(s) to use and I kept buying ones that weren't what I wanted. So, I asked scripters for help and tried it myself and well coding turns out to not be my thing. I searched all over marketplace but with any words I use I can't find this!

Just need a poseball for ONE animation so the user sits, they are in the pose and a menu auto pops up (they don't need to click object since the poseball will go invis after sitting) to adjust their av spot (like x, y, z, etc). I have seen so many other stores and photo places use this so I am surprised it's so hard for me to find it. And, this is for a photo place with backdrops+poses (like Sunny's for example) so I don't want to give permission for anyone to move the poseball and risk them moving it way out where it needs to be.

Please help!! >.<

Link to comment
Share on other sites

list gPosIncrements = [0.025, 0.1, 0.25 ];
list gRotIncrements = [1, 5, 25];

vector gTextColor = <0,1,0>;
integer gChanListen = 475;

integer gNIncrements = 3; 
integer gIndexIncrement;
float gPosIncrement;
float gRotIncrement;

integer gHandleListen;

string gsMain = "Poseball menu";
list glMain = ["Edit Position","Edit Rotation"];

string gsPos = "Edit position:";
list glPos = ["-X","-Y","-Z","+X","+Y","+Z","-increment","[BACK]","+increment"]; 

string gsRot = "Edit Rotation:";
// N.B. button names must be distinct; add a space.
list glRot = ["-X ","-Y ","-Z ","+X ","+Y ","+Z ","-increment ","[BACK]","+increment "];

list gAxes = [<1,0,0>,<0,1,0>,<0,0,1>];

do_menu(string text, list l, key ID)
{   text += "\n Position Increment: "+llDeleteSubString((string)(gPosIncrement),5,-1);
    text += "\n Rotation Increment: "+(string)((integer)(gRotIncrement));
    llDialog(ID,text,l,gChanListen);
}

default
{
    state_entry()
    {
        llSetClickAction(CLICK_ACTION_SIT);
        llSitTarget(<0,0,-0.25>,ZERO_ROTATION);
        gNIncrements = llGetListLength(gPosIncrements);
        if(gNIncrements != llGetListLength(gRotIncrements))
        {   llOwnerSay("Warning, unequal list lengths!");
        }
        gPosIncrement = llList2Float(gPosIncrements,gIndexIncrement);
        gRotIncrement = llList2Float(gRotIncrements,gIndexIncrement);
    }
    touch_start(integer n)
    {   key ID = llDetectedKey(0);
        if(ID==llAvatarOnSitTarget())
        {   do_menu(gsMain,glMain,ID);
        }
    }
    changed(integer c)
    {   if(c&CHANGED_LINK)
        {   key ID = llAvatarOnSitTarget();
            if(ID)
            {   llListen(gChanListen,"",ID,"");
                do_menu(gsMain,glMain,ID);
                llSetAlpha(0.0,ALL_SIDES);
                llSetText("", <0,0,0>, 0.0);
                llRequestPermissions(ID,PERMISSION_TRIGGER_ANIMATION);
            }else
            {   llListenRemove(gHandleListen);
                llSetAlpha(1.0,ALL_SIDES);
                llSetText(llGetObjectDesc(),gTextColor,1.0);
            }
        }
    }
    run_time_permissions(integer perms)
    {   if(perms&PERMISSION_TRIGGER_ANIMATION)
        {   llStopAnimation("sit");
            llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION,0));
        }
    }
    listen(integer Channel, string Name, key ID, string Text)
    {   list lText = [Text];
        integer i = llListFindList(glMain,lText);
        if(0==i) // position
        {   do_menu(gsPos,glPos,ID);
        }else if(1==i) // rotation
        {   do_menu(gsRot,glRot,ID);
        }else
        {   
            string s = gsPos;
            list   l = glPos;
            integer r; // set TRUE for rotation
            i = llListFindList(glPos,lText);
            if(i==-1)
            {   i = llListFindList(glRot,lText);
                r = 1;
                s = gsRot;
                l = glRot;
            }
            if(i==-1)
            {   llSay(0,"parsing error!");
                do_menu(gsMain,glMain,ID);
                return;
            }
            if(i==6)
            {   gIndexIncrement*= (--gIndexIncrement>=0); // decrement, but floor at 0.
                gPosIncrement = llList2Float(gPosIncrements,gIndexIncrement);
                gRotIncrement = llList2Float(gRotIncrements,gIndexIncrement);
                do_menu(s,l,ID);
            }else if(i==7)
            {   do_menu(gsMain,glMain,ID);
            }else if(i==8)
            {   ++gIndexIncrement;
                if(gIndexIncrement>=gNIncrements) gIndexIncrement = gIndexIncrement-1;
                gPosIncrement = llList2Float(gPosIncrements,gIndexIncrement);
                gRotIncrement = llList2Float(gRotIncrements,gIndexIncrement);
                do_menu(s,l,ID);
            }else
            {   vector axis = llList2Vector(gAxes,i%3);
                integer dir = ((i/3)*2)-1; // integer division, convert to -/+ 1.
                if(r) // rotation
                {   rotation prev = llList2Rot(llGetLinkPrimitiveParams(2,[PRIM_ROT_LOCAL]),0);
                    llSetLinkPrimitiveParamsFast(2,[PRIM_ROT_LOCAL,
                        llAxisAngle2Rot(axis,dir*gRotIncrement*DEG_TO_RAD)*prev]);
                }else
                {   vector prev = llList2Vector(llGetLinkPrimitiveParams(2,[PRIM_POS_LOCAL]),0);
                    llSetLinkPrimitiveParamsFast(2,[PRIM_POS_LOCAL,
                        prev+ (dir*gPosIncrement*axis) ]);
                }
                do_menu(s,l,ID);
            }
        }
    }
}

 

  • Like 2
Link to comment
Share on other sites

9 hours ago, Quistess Alpha said:
list gPosIncrements = [0.025, 0.1, 0.25 ];
list gRotIncrements = [1, 5, 25];

vector gTextColor = <0,1,0>;
integer gChanListen = 475;

integer gNIncrements = 3; 
integer gIndexIncrement;
float gPosIncrement;
float gRotIncrement;

integer gHandleListen;

string gsMain = "Poseball menu";
list glMain = ["Edit Position","Edit Rotation"];

string gsPos = "Edit position:";
list glPos = ["-X","-Y","-Z","+X","+Y","+Z","-increment","[BACK]","+increment"]; 

string gsRot = "Edit Rotation:";
// N.B. button names must be distinct; add a space.
list glRot = ["-X ","-Y ","-Z ","+X ","+Y ","+Z ","-increment ","[BACK]","+increment "];

list gAxes = [<1,0,0>,<0,1,0>,<0,0,1>];

do_menu(string text, list l, key ID)
{   text += "\n Position Increment: "+llDeleteSubString((string)(gPosIncrement),5,-1);
    text += "\n Rotation Increment: "+(string)((integer)(gRotIncrement));
    llDialog(ID,text,l,gChanListen);
}

default
{
    state_entry()
    {
        llSetClickAction(CLICK_ACTION_SIT);
        llSitTarget(<0,0,-0.25>,ZERO_ROTATION);
        gNIncrements = llGetListLength(gPosIncrements);
        if(gNIncrements != llGetListLength(gRotIncrements))
        {   llOwnerSay("Warning, unequal list lengths!");
        }
        gPosIncrement = llList2Float(gPosIncrements,gIndexIncrement);
        gRotIncrement = llList2Float(gRotIncrements,gIndexIncrement);
    }
    touch_start(integer n)
    {   key ID = llDetectedKey(0);
        if(ID==llAvatarOnSitTarget())
        {   do_menu(gsMain,glMain,ID);
        }
    }
    changed(integer c)
    {   if(c&CHANGED_LINK)
        {   key ID = llAvatarOnSitTarget();
            if(ID)
            {   llListen(gChanListen,"",ID,"");
                do_menu(gsMain,glMain,ID);
                llSetAlpha(0.0,ALL_SIDES);
                llSetText("", <0,0,0>, 0.0);
                llRequestPermissions(ID,PERMISSION_TRIGGER_ANIMATION);
            }else
            {   llListenRemove(gHandleListen);
                llSetAlpha(1.0,ALL_SIDES);
                llSetText(llGetObjectDesc(),gTextColor,1.0);
            }
        }
    }
    run_time_permissions(integer perms)
    {   if(perms&PERMISSION_TRIGGER_ANIMATION)
        {   llStopAnimation("sit");
            llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION,0));
        }
    }
    listen(integer Channel, string Name, key ID, string Text)
    {   list lText = [Text];
        integer i = llListFindList(glMain,lText);
        if(0==i) // position
        {   do_menu(gsPos,glPos,ID);
        }else if(1==i) // rotation
        {   do_menu(gsRot,glRot,ID);
        }else
        {   
            string s = gsPos;
            list   l = glPos;
            integer r; // set TRUE for rotation
            i = llListFindList(glPos,lText);
            if(i==-1)
            {   i = llListFindList(glRot,lText);
                r = 1;
                s = gsRot;
                l = glRot;
            }
            if(i==-1)
            {   llSay(0,"parsing error!");
                do_menu(gsMain,glMain,ID);
                return;
            }
            if(i==6)
            {   gIndexIncrement*= (--gIndexIncrement>=0); // decrement, but floor at 0.
                gPosIncrement = llList2Float(gPosIncrements,gIndexIncrement);
                gRotIncrement = llList2Float(gRotIncrements,gIndexIncrement);
                do_menu(s,l,ID);
            }else if(i==7)
            {   do_menu(gsMain,glMain,ID);
            }else if(i==8)
            {   ++gIndexIncrement;
                if(gIndexIncrement>=gNIncrements) gIndexIncrement = gIndexIncrement-1;
                gPosIncrement = llList2Float(gPosIncrements,gIndexIncrement);
                gRotIncrement = llList2Float(gRotIncrements,gIndexIncrement);
                do_menu(s,l,ID);
            }else
            {   vector axis = llList2Vector(gAxes,i%3);
                integer dir = ((i/3)*2)-1; // integer division, convert to -/+ 1.
                if(r) // rotation
                {   rotation prev = llList2Rot(llGetLinkPrimitiveParams(2,[PRIM_ROT_LOCAL]),0);
                    llSetLinkPrimitiveParamsFast(2,[PRIM_ROT_LOCAL,
                        llAxisAngle2Rot(axis,dir*gRotIncrement*DEG_TO_RAD)*prev]);
                }else
                {   vector prev = llList2Vector(llGetLinkPrimitiveParams(2,[PRIM_POS_LOCAL]),0);
                    llSetLinkPrimitiveParamsFast(2,[PRIM_POS_LOCAL,
                        prev+ (dir*gPosIncrement*axis) ]);
                }
                do_menu(s,l,ID);
            }
        }
    }
}

 

 

Thanks so much for giving me all the help! Perfectly got what I needed with this and the help of others!

  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 366 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...