Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
Pose stand + Pose attachment
#1
Ich fang mal an paar Skripte zu posten, die ich im OSgrid getestet hab. Die meisten sind zwar ziemlich nutzlos  Wink aber vielleicht kann der eine oder die andere doch was draus entnehmen.

Hier mal ein Pose stand, der beliebig viele Posen enthalten kann. Aber so ab 150 wird das Öffnen dann schon elend langsam. Einfach die Posen rein, anklicken und Reset drücken und dann draufstellen. Der Stand verschwindet dann, man kann per Menü die Posen durchschalten und die Drehung um 30 Grad.

Als zweites das gleiche noch mal, nur als tragbare Version, falls mal wo das Rezzen nicht erlaubt ist. Wieder nur die Posen rein, ins Inventar packen und bei Bedarf anziehen. Ach ja und AO bitte ausmachen.

Viel Spass  Smile
LG Reb

Code:
// script copyright by Rebekka Revnik

// Pose stand without access

vector SIT_POSITION = <0,0,1>;
rotation SIT_ROTATION = ZERO_ROTATION;

string TURNL = "<-";
string TURNR = "->";
list Anis;
integer Degree = 0;
vector Eul;
string CurAni;

string NEXT = ">>>";
string PREV = "<<<";
integer DLGCHANNEL;

integer DlgPage = 0;
integer Listener;

key User;

list DlgNice(list Dlg)
{
    list l = [];
    integer i;
    Dlg = [TURNL, TURNR] + Dlg;
    while(llGetListLength(Dlg) < 12) Dlg += [" "];
    integer ip = llListFindList(Dlg, [PREV]);
    integer in = llListFindList(Dlg, [NEXT]);
    if(in != -1)
    {
        Dlg = llDeleteSubList(Dlg, in, in);
        Dlg += [NEXT];
    }
    if(ip != -1)
    {
        Dlg = llDeleteSubList(Dlg, ip, ip);
        Dlg = llListInsertList(Dlg, [PREV], 9);
    }
    for(i = 0; i< 3; i++) l += llList2List(Dlg, i + 9, i + 9);
    for(i = 3; i< 6; i++) l += llList2List(Dlg, i + 3, i + 3);
    for(i = 6; i< 9; i++) l += llList2List(Dlg, i - 3, i - 3);
    for(i = 9; i< 12; i++) l += llList2List(Dlg, i - 9, i - 9);
    return l;
}

DlgShow(list DlgItems)
{
    list Dlg = [];
    list l = [];
    integer Count = llGetListLength(DlgItems);
    integer Start = 0;
    if(DlgPage > 0) Start = (DlgPage - 1) * 8 + 9;
    string msg = "";
    l = llList2List(DlgItems, Start, Start + 9);
    if(DlgPage == 0 && Count > 10) l = [NEXT] + l;
    else if(DlgPage > 0)
    {
        l = [PREV] + l;
        if(Count > Start + 9) l = [NEXT] + l;
    }
    l = llList2List(l, 0, 9);
    integer x = llGetListLength(l);
    if(llListFindList(l, [PREV]) != -1) x--;
    if(llListFindList(l, [NEXT]) != -1) x--;
    for(Count = 0; Count < x; Count++)
    {
        msg += (string)(Start + Count + 1) + " - " + llList2String(DlgItems, Start + Count) + "\n";
        Dlg += [(string)(Start + Count + 1)];
    }
    if(llListFindList(l, [PREV]) != -1) Dlg = [PREV] + Dlg;
    if(llListFindList(l, [NEXT]) != -1) Dlg = llListInsertList(Dlg, [NEXT], 2);
    if(msg == "") return;
    llListenRemove(Listener);
    Listener = llListen(DLGCHANNEL, "", User, "");
    llDialog(User, msg, DlgNice(Dlg), DLGCHANNEL);
    //llDialog(User, msg, Dlg, DLGCHANNEL);
}

integer DlgMain(string msg)
{
    integer result = TRUE;
    if(msg == PREV)
    {
        DlgPage--;
        DlgShow(Anis);
        return result;
    } else if(msg == NEXT)
{
    DlgPage++;
    DlgShow(Anis);
    return result;
} else if(msg == " ")
{
    DlgShow(Anis);
    return result;
} else result = FALSE;
    return result;
}

Init()
{
    llSay(0, "Initialisiere..");
    Anis = [];
    CurAni = "";
    integer x = llGetInventoryNumber(INVENTORY_ANIMATION);
    integer i;
    for(i = 0; i < x; i++)
    {
        Anis += [llGetInventoryName(INVENTORY_ANIMATION, i)];
    }
    DLGCHANNEL = (integer) (-llFrand(1000) - 100);
    llSay(0, (string)llGetListLength(Anis) + " Posen geladen.");
}

default
{
    state_entry()
    {
        llSetSitText("Pose");
        llSitTarget(SIT_POSITION, SIT_ROTATION);
    }
    on_rez(integer start_param)
    {
        Init();
        rotation rot = llGetRot();
        Eul = llRot2Euler(rot);
        Eul *= RAD_TO_DEG;
        Eul.z = Degree;
        rot = llEuler2Rot(DEG_TO_RAD * Eul);
        llSetRot(rot);
    }
    touch_start(integer total_number)
    {
        User = llDetectedKey(0);
        if(llAvatarOnSitTarget() != NULL_KEY) return;
        llListenRemove(Listener);
        Listener = llListen(DLGCHANNEL, "", User, "");
        llDialog(User, "Was willst du tun", ["Reset", "Posen", "Ende"], DLGCHANNEL);
    }
    changed(integer change)
    {
        if(change & CHANGED_LINK)
        {
            User = llAvatarOnSitTarget();
            integer perm = llGetPermissions();
            if(User != NULL_KEY)
            {
                if(!(perm & PERMISSION_TRIGGER_ANIMATION))
                {
                    llRequestPermissions(User, PERMISSION_TRIGGER_ANIMATION);
                    return;
                }
                llSetAlpha(0, ALL_SIDES);
                CurAni = llList2String(Anis, 0);
                if (perm & PERMISSION_TRIGGER_ANIMATION)
                {
                    llStopAnimation("sit");
                    llStartAnimation(CurAni);
                }
                DlgPage = 0;
                DlgShow(Anis);
            } else
        {
            if (perm & PERMISSION_TRIGGER_ANIMATION) llStopAnimation(CurAni);
            llListenRemove(Listener);
            llSetAlpha(1, ALL_SIDES);
        }
        }
    }
    listen(integer channel, string name, key id, string msg)
    {
        if(DlgMain(msg)) return;
        if(msg == TURNL)
        {
            Degree = (Degree - 30) % 360;
            Eul.z = Degree;
            llSetRot(llEuler2Rot(DEG_TO_RAD * Eul));
            DlgShow(Anis);
            return;
        } else if(msg == TURNR)
    {
        Degree = (Degree + 30) % 360;
        Eul.z = Degree;
        llSetRot(llEuler2Rot(DEG_TO_RAD * Eul));
        DlgShow(Anis);
        return;
    } else if(msg == "Reset")
    {
        Init();
        return;
    } else if(msg == "Posen")
    {
        DlgPage = 0;
        DlgShow(Anis);
        return;
    }else if(msg == "Ende") return;
        else if((integer)msg > 0)
        {
            integer x = (integer)msg;
            string s = llList2String(Anis, x-1);
            if(s != "")
            {
                if(CurAni != "") llStopAnimation(CurAni);
                integer perm = llGetPermissions();
                if (perm & PERMISSION_TRIGGER_ANIMATION) llStartAnimation(s);
                CurAni = s;
            }
            DlgShow(Anis);
            return;
        }
    }
    run_time_permissions(integer permissions)
    {
        if(permissions & PERMISSION_TRIGGER_ANIMATION)
        {
            llSetAlpha(0, ALL_SIDES);
            CurAni = llList2String(Anis, 0);
            llStopAnimation("sit");
            llStartAnimation(CurAni);
            DlgPage = 0;
            DlgShow(Anis);
        }
    }
}

Code:
// script copyright by Rebekka Revnik

// Pose attachment

vector SIT_POSITION = <0,0,1>;
rotation SIT_ROTATION = ZERO_ROTATION;

string TURNL = "<-";
string TURNR = "->";
list Anis;
integer Degree = 0;
vector Eul;
string CurAni;

string NEXT = ">>>";
string PREV = "<<<";
integer DLGCHANNEL;

integer DlgPage = 0;
integer Listener;

key User;
key User1;

list DlgNice(list Dlg)
{
    list l = [];
    integer i;
    //Dlg = [TURNL, TURNR] + Dlg;
    while(llGetListLength(Dlg) < 11) Dlg += [" "];
    integer ip = llListFindList(Dlg, [PREV]);
    integer in = llListFindList(Dlg, [NEXT]);
    if(in != -1)
    {
        Dlg = llDeleteSubList(Dlg, in, in);
        Dlg = llListInsertList(Dlg, [NEXT], 11);
    }
    if(ip != -1)
    {
        Dlg = llDeleteSubList(Dlg, ip, ip);
        Dlg = llListInsertList(Dlg, [PREV], 9);
    }
    Dlg = llListInsertList(Dlg, ["Ende"], 10);
    for(i = 0; i< 3; i++) l += llList2List(Dlg, i + 9, i + 9);
    for(i = 3; i< 6; i++) l += llList2List(Dlg, i + 3, i + 3);
    for(i = 6; i< 9; i++) l += llList2List(Dlg, i - 3, i - 3);
    for(i = 9; i< 12; i++) l += llList2List(Dlg, i - 9, i - 9);
    return l;
}

DlgShow(list DlgItems)
{
    list Dlg = [];
    integer Count = llGetListLength(DlgItems);
    integer Start = 0;
    if(DlgPage > 0) Start = (DlgPage - 1) * 9 + 10;
    integer End = Count - 1;
    if((End - Start) > 11) End = Start + 11;
    integer i;
    for(i = Start; i <= End; i++) Dlg += [(string)(i + 1)];
    string msg = "";
    if(DlgPage == 0)
    {
        if(Count > 11) Dlg = llList2List(Dlg, 0, 1) + [NEXT] + llList2List(Dlg, 2, 9);
    } else
{
    if(Count < Start + 10) Dlg = [PREV] + llList2List(Dlg, 0, 9);
    else Dlg = [PREV] + llList2List(Dlg, 0, 0) + [NEXT] + llList2List(Dlg, 1, 8);
}
    integer x = llGetListLength(Dlg);
    if(llListFindList(Dlg, [PREV]) != -1) x--;
    if(llListFindList(Dlg, [NEXT]) != -1) x--;
    for(Count = 0; Count < x; Count++)
    {
        msg += (string)(Start + Count + 1) + " - " + llList2String(DlgItems, Start + Count) + "\n";
    }
    llListenRemove(Listener);
    Listener = llListen(DLGCHANNEL, "", User, "");
    llDialog(User, msg, DlgNice(Dlg), DLGCHANNEL);
}

integer DlgMain(string msg)
{
    integer result = TRUE;
    if(msg == PREV)
    {
        DlgPage--;
        DlgShow(Anis);
        return result;
    } else if(msg == NEXT)
{
    DlgPage++;
    DlgShow(Anis);
    return result;
} else if(msg == " ")
{
    DlgShow(Anis);
    return result;
} else result = FALSE;
    return result;
}

Init()
{
    llOwnerSay("Initialisiere..");
    Anis = [];
    CurAni = "";
    integer x = llGetInventoryNumber(INVENTORY_ANIMATION);
    integer i;
    for(i = 0; i < x; i++)
    {
        Anis += [llGetInventoryName(INVENTORY_ANIMATION, i)];
    }
    DLGCHANNEL = (integer) (-llFrand(1000) - 100);
    llOwnerSay((string)llGetListLength(Anis) + " Posen geladen.");
}

default
{
    on_rez(integer start_param)
    {
        llSetAlpha(1.0, ALL_SIDES);
    }
    attach(key attached)
    {
        integer perm = llGetPermissions();
        User = attached;
        if(attached != NULL_KEY)
        {
            llSetAlpha(0, ALL_SIDES);
            Init();
            if(!(perm & PERMISSION_TRIGGER_ANIMATION))
            {
                llRequestPermissions(User, PERMISSION_TRIGGER_ANIMATION);
                return;
            }
            CurAni = llList2String(Anis, 0);
            llStopAnimation("sit");
            llStartAnimation(CurAni);
            DlgPage = 0;
            DlgShow(Anis);
        } else
    {
        if (perm & PERMISSION_TRIGGER_ANIMATION) llStopAnimation(CurAni);
    }
    }
    listen(integer channel, string name, key id, string msg)
    {
        llListenRemove(Listener);
        if(DlgMain(msg)) return;
        if(msg == "Ende")
        {
            integer perm = llGetPermissions();
            if (perm & PERMISSION_TRIGGER_ANIMATION) llStopAnimation(CurAni);
        } else if((integer)msg > 0)
    {
        integer x = (integer)msg;
        string s = llList2String(Anis, x-1);
        if(s != "")
        {
            if(CurAni != "") llStopAnimation(CurAni);
            llStartAnimation(s);
            CurAni = s;
        }
        DlgShow(Anis);
        return;
    }
    }
    run_time_permissions(integer permissions)
    {
        if(permissions & PERMISSION_TRIGGER_ANIMATION)
        {
            CurAni = llList2String(Anis, 0);
            llStopAnimation("sit");
            llStartAnimation(CurAni);
            DlgPage = 0;
            DlgShow(Anis);
        }
    }
}
Leider ist meine Signatur ausserhalb Sachsens nicht verfügbar.
Zitieren
#2
Huhu Rebekka ;D

Danke für das Script ;D Da es ein fertiges Script ist, verschieb ich es mal in Fertige Scripts und mach ein Antwort Thread in Scripting auf.

Diskussionen zu diesem Script bitte in diesem Posting posten:

Tschöö

Bogus | PinguinsReisen.de
Zitieren
#3
Ups sorry Bogus, da sollte es auch hin, hab mich wohl vertan  Big Grin
Leider ist meine Signatur ausserhalb Sachsens nicht verfügbar.
Zitieren
#4
kein problem ;D
Tschöö

Bogus | PinguinsReisen.de
Zitieren


Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste