POSEBALL - visible ou pas

Répondre
Partager Rechercher
Bonjour,

J'utilise le script suivant, pour valider la position assis de mon personnage :

Code:
// Pose Ball script, Revision 4.3.3// decrappified by Strife Onizuka - December 11th (2006)// revised by SimonRaven Chippewa// fixed parsing of llListen handler// Notecard configuration enabled, switchable // link_message/touch_start/llListen support, sit_text, floating text, alpha.// Version 4.3 fixes link_set hide/show and permission sensing issues.// By CrystalShard Foo.// Work started - October 10th (2004).// Last compile - November 7th (2004).// Version 4.3.1 mods by Strife Onizuka// Modified to fix logic holes in permissions code when used on multi-sittarget objects.// Work started - Febuary 14th 2005.// Last compile - Febuary 14th 2005.// This script will let you choose if you want to turn the ball visible on // CLICK, or by using a SHOW/HIDE voice command.// You can also set the offset and the title of the ball, as well // as the sit button text - all with a notecard.// This script is free and comes without support. Dont contact me. // Ask a local geek for help if it gets messy.// ** This script is NOT FOR SALE **// You can use it in commercial products as long as you give this script to anyone who asks for it.// You can use this source, distribute it and modify it freely, but leave the credits intact!// (You can add your own name to the list, of course. Like, "Modified by John Doe")// Last Modified: 2006/12/09// Modification Author: SimonRaven Chippewavector ROTATION = <0,0,0>; //Euler in degrees (like the edit box)string TITLE = "Chill";            //This text will appear in the floating title above the ballstring ANIMATION = "";             //Put the name of the pose/animation herevector offset = <0,0,0.5>;    // You can play with these numbers to adjust                            // how far the person sits from the ball. ( <X,Y,Z> )integer use_voice = TRUE;string  gNotecard = "poseBall.conf";integer gLine = 0;integer listenHandle;integer masterswitch = TRUE;integer visible = TRUE;float base_alpha = 1.0;key avatar;key trigger;key dataserver_key = "";rotation rot;integer lowest = 0x7FFFFFFF;integer me;string animation;show(){    visible = TRUE;    llSetText(TITLE, <1.0,1.0,1.0>,1.0);             llSetAlpha(base_alpha, ALL_SIDES);}hide(){    visible = FALSE;    llSetText("", <1.0,1.0,1.0>,1.0);            llSetAlpha(0.0, ALL_SIDES);}init(){    if(llGetInventoryType(ANIMATION) != INVENTORY_ANIMATION)    {        if(llGetInventoryNumber(INVENTORY_ANIMATION) == 0)  // Make sure we actually got something to pose with.        {            llWhisper(0,"Error: No animation found. Cannot pose.");            animation = "sit";        }        else            animation = llGetInventoryName(INVENTORY_ANIMATION, 0);    }    else        animation = ANIMATION;    if(llGetInventoryType(gNotecard) == INVENTORY_NOTECARD)    {        dataserver_key = llGetNotecardLine(gNotecard, gLine = 0);    }    else //If we are here no configuration notecard was found... lets use the defaults.    {        llSetSitText(TITLE);        if(visible)            show();        else            hide();    }}default{    state_entry()    {        llSetText("Starting up", <1.0,1.0,1.0>, 1.0);        rot = llEuler2Rot(ROTATION * DEG_TO_RAD);        llSitTarget(offset, rot);        if(use_voice)            listenHandle = llListen(1, "", "", "");        me = llGetLinkNumber();        init();    }    link_message(integer sender_num, integer num, string str, key id)    {        if(num == 99)        {            if(str == "hide")            {                masterswitch = FALSE;                hide();            }            else if(str == "show")            {                masterswitch = TRUE;                if(llKey2Name(trigger) == "")                    show();            }            if(use_voice)            {                if(lowest > sender_num)                {//only adjust if it is lower then lowest.                    lowest = sender_num;                    if(sender_num < llGetLinkNumber())                    {                        llListenRemove(listenHandle);                        listenHandle = 0;                    }                    else if(!listenHandle)                    {                        listenHandle = llListen(1, "", "", "");                        llMessageLinked(LINK_ALL_OTHERS, num, "", id);                    }                }            }        }    }    touch_start(integer detected)    {        if(use_voice)            llWhisper(0, "/me "+llDetectedName(0)+", say '/1 hide' to hide me, or '/1 show' to make me show. Or just right-click and sit on me to use me.");        else        {            if(visible)                hide();            else if(llKey2Name(trigger) == "")                show();            llMessageLinked(LINK_ALL_OTHERS, 99, llList2String(["hide","show"], visible), "");        }    }    changed(integer change)    {        if(change & CHANGED_LINK)        {            avatar = llAvatarOnSitTarget();            if(llKey2Name(avatar))            {                if(trigger != avatar)                     llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION);                hide();            }            else if(trigger)            {                if(trigger == llGetPermissionsKey())//right user?                    if(llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)//got permissions?                        if(llKey2Name(trigger)) //user in the sim? modern permision system makes this last check unnecessary.                            llStopAnimation(animation);                if(masterswitch)                    show();                trigger = "";            }            else if(use_voice)            {                change = llGetLinkNumber();                if(change != me)                {                    if(me < change)                    {                        lowest += change - me;                        if(listenHandle)                            llMessageLinked(LINK_ALL_OTHERS, 99, "", "");                    }                    else                     {                        if(!listenHandle)                            listenHandle = llListen(1, "", "", "");                        if(change)//intended to reduce packet storm on large linksets.                            llMessageLinked(LINK_ALL_CHILDREN, 99, "", "");                    }                    me = change;                }            }        }        if(change & CHANGED_INVENTORY)        {            llSetText("Reloading configuration...",<1.0,1.0,1.0>,1.0);            init();        }    }    run_time_permissions(integer perm)    {        avatar = llAvatarOnSitTarget();        if(perm & PERMISSION_TRIGGER_ANIMATION && llKey2Name(avatar) != "" && avatar == llGetPermissionsKey())        {            trigger = avatar;            llStopAnimation("sit");            llStartAnimation(animation);            if(visible == TRUE)                base_alpha = llGetAlpha(ALL_SIDES);            hide();        }    }    listen(integer channel, string name, key id, string message)    {        if(llStringLength(message) == 4)        {            message = llToLower(message);            if(message == "show")            {                masterswitch = TRUE;                if(llKey2Name(trigger) == "")                    show();            }            else if(message == "hide")            {                masterswitch = FALSE;                hide();            }            else                return;            llMessageLinked(LINK_ALL_OTHERS, 99, message, "");        }    }    dataserver(key queryid, string data)    {        if(queryid == dataserver_key)        {            if(data != EOF)            {                integer command = llListFindList([";","title", "offset","rotation","voice","sit_button"], [llToLower(llList2String(llParseString2List(data, [" "], [":",";"]),0))]);                if(command > 0)                {                    data = llDeleteSubString(data, 0, llSubStringIndex(data,":"));                    if(command == 1)//title                    {                        if(llGetSubString(data, 0, 0) != " ")                            TITLE = data;                        else                            TITLE = llDeleteSubString(data, 0, 0);                        llSetSitText(TITLE);                        if(visible && masterswitch)                            show();                    }                    else if(command == 2)//offset                    {                        offset = (vector)data;                        if(offset); else                        {                            if((llSubStringIndex(data, "<") & 0x7FFFFFFF) < llSubStringIndex(data, ">"))//could be a valid vector                                offset = <0.0, 0.0, 0.01>;                            else                            {//definately isn't a valid vector                                llSay(0,"Error: The numbers in the offset value lack the '<' and '>' signs. (Should be something like <3,1,6> )");                                offset = <0.0, 0.0, 0.5>;                            }                        }                        rot = llEuler2Rot(ROTATION * DEG_TO_RAD);                        llSitTarget(offset, rot);                    }                    else if(command == 3)//rotation                    {                        ROTATION = (vector)data;                        rot = (rotation)data;                        if(<rot.x,rot.y,rot.z> != ROTATION)//allows us to use raw rotations & vectors at the same time.                            rot = llEuler2Rot(ROTATION * DEG_TO_RAD);                        llSitTarget(offset, rot);                    }                    else if(command == 4)//voice                    {                        if(llGetSubString(data, 0, 0) == " ")                            data = llDeleteSubString(data, 0, 0);                        use_voice = (llListFindList(["yes", "true", "on", "lag"], [llToLower(data)]) >= 0);                        if(use_voice)                        {                            if(!listenHandle)                                listenHandle = llListen(1, "", "", "");                        }                        else                        {                            llListenRemove(listenHandle);                            listenHandle = 0;                        }                    }                    else if(command == 5)//sit_button                    {                        if(llGetSubString(data, 0, 0) != " ")                            llSetSitText(data);                        else                            llSetSitText(llDeleteSubString(data, 0, 0));                    }                }                ++gLine;                dataserver_key = llGetNotecardLine(gNotecard, gLine);            }            else            {                if(visible)                    show();                else                    hide();            }        }    }}
J'ai une question vis à vis de ce code. Il fonctionne très bien, la seule chose que je voudrai vérifier, c'est que dans l'état actuel de ce script, lorsque je click dessus,
l'objet en question disparait

Exemple, je crée ma chaise, et je place le script directement dessus, mais si je click, la chaise en question disparait.

N'y aurait il pas une option à modifier dans le script afin d'éviter cela ?

Merci
salut , justement, je viens de faire la même chose, contactes moi en ligne, je te file le script,

Ou plus rapides, tu met ton alpha en 1.0 c'est peut-être pas très conventionnel et les vrai scripteurs vont verser une larme en lisant ça, mais ça fonctionne
Il ne disparait, mais il devient invisible (alpha 0.0). Il est encore visible avec CTRL-ALT-T.

Pour enlever la fonction qui permet de cliquer dessus, vire la section touch_start.
J'ai mal du m'expliquer, je suis désolé, mais mon souhait est que l'objet qui accueil le script de la pose reste justement visible, et non pas le contraire

Je place à nouveau mon script actuel :

Code:
// Pose Ball script, Revision 4.3.3
// decrappified by Strife Onizuka - December 11th (2006)
// revised by SimonRaven Chippewa
// fixed parsing of llListen handler
// Notecard configuration enabled, switchable 
// link_message/touch_start/llListen support, sit_text, floating text, alpha.
// Version 4.3 fixes link_set hide/show and permission sensing issues.
// By CrystalShard Foo.
// Work started - October 10th (2004).
// Last compile - November 7th (2004).
// Version 4.3.1 mods by Strife Onizuka
// Modified to fix logic holes in permissions code when used on multi-sittarget objects.
// Work started - Febuary 14th 2005.
// Last compile - Febuary 14th 2005.
// This script will let you choose if you want to turn the ball visible on 
// CLICK, or by using a SHOW/HIDE voice command.
// You can also set the offset and the title of the ball, as well 
// as the sit button text - all with a notecard.
// This script is free and comes without support. Dont contact me. 
// Ask a local geek for help if it gets messy.
// ** This script is NOT FOR SALE **
// You can use it in commercial products as long as you give this script to anyone who asks for it.
// You can use this source, distribute it and modify it freely, but leave the credits intact!
// (You can add your own name to the list, of course. Like, "Modified by John Doe")
// Last Modified: 2006/12/09
// Modification Author: SimonRaven Chippewa
 
vector ROTATION = <0,0,0>; //Euler in degrees (like the edit box)
string TITLE = "assoir";            //This text will appear in the floating title above the ball
string ANIMATION = "position_chef";             //Put the name of the pose/animation here
vector offset = <0,0,0.5>;    // You can play with these numbers to adjust 
                            // how far the person sits from the ball. ( <X,Y,Z> )
integer use_voice = TRUE;
string  gNotecard = "poseBall.conf";
integer gLine = 0;
integer listenHandle;
integer masterswitch = TRUE;
integer visible = TRUE;
float base_alpha = 1.0;
key avatar;
key trigger;
key dataserver_key = "";
rotation rot;
integer lowest = 0x7FFFFFFF;
integer me;
string animation;
show()
{
    visible = TRUE;
    llSetText(TITLE, <1.0,1.0,1.0>,1.0);         
    llSetAlpha(base_alpha, ALL_SIDES);
}
hide()
{
    visible = FALSE;
    llSetText("", <1.0,1.0,1.0>,1.0);        
    llSetAlpha(0.0, ALL_SIDES);
}
init()
{
    if(llGetInventoryType(ANIMATION) != INVENTORY_ANIMATION)
    {
        if(llGetInventoryNumber(INVENTORY_ANIMATION) == 0)  // Make sure we actually got something to pose with.
        {
            llWhisper(0,"Error: No animation found. Cannot pose.");
            animation = "sit";
        }
        else
            animation = llGetInventoryName(INVENTORY_ANIMATION, 0);
    }
    else
        animation = ANIMATION;
    if(llGetInventoryType(gNotecard) == INVENTORY_NOTECARD)
    {
        dataserver_key = llGetNotecardLine(gNotecard, gLine = 0);
    }
    else //If we are here no configuration notecard was found... lets use the defaults.
    {
        llSetSitText(TITLE);
        if(visible)
            show();
        else
            hide();
    }
}
default
{
    state_entry()
    {
        llSetText("Starting up", <1.0,1.0,1.0>, 1.0);
        rot = llEuler2Rot(ROTATION * DEG_TO_RAD);
        llSitTarget(offset, rot);
        if(use_voice)
            listenHandle = llListen(1, "", "", "");
        me = llGetLinkNumber();
        init();
    }
    link_message(integer sender_num, integer num, string str, key id)
    {
        if(num == 99)
        {
            if(str == "hide")
            {
                masterswitch = FALSE;
                hide();
            }
            else if(str == "show")
            {
                masterswitch = TRUE;
                if(llKey2Name(trigger) == "")
                    show();
            }
            if(use_voice)
            {
                if(lowest > sender_num)
                {//only adjust if it is lower then lowest.
                    lowest = sender_num;
                    if(sender_num < llGetLinkNumber())
                    {
                        llListenRemove(listenHandle);
                        listenHandle = 0;
                    }
                    else if(!listenHandle)
                    {
                        listenHandle = llListen(1, "", "", "");
                        llMessageLinked(LINK_ALL_OTHERS, num, "", id);
                    }
                }
            }
        }
    }
    touch_start(integer detected)
    {
        if(use_voice)
            llWhisper(0, "/me "+llDetectedName(0)+", say '/1 hide' to hide me, or '/1 show' to make me show. Or just right-click and sit on me to use me.");
        else
        {
            if(visible)
                hide();
            else if(llKey2Name(trigger) == "")
                show();
            llMessageLinked(LINK_ALL_OTHERS, 99, llList2String(["hide","show"], visible), "");
        }
    }
    changed(integer change)
    {
        if(change & CHANGED_LINK)
        {
            avatar = llAvatarOnSitTarget();
            if(llKey2Name(avatar))
            {
                if(trigger != avatar) 
                    llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION);
                hide();
            }
            else if(trigger)
            {
                if(trigger == llGetPermissionsKey())//right user?
                    if(llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)//got permissions?
                        if(llKey2Name(trigger)) //user in the sim? modern permision system makes this last check unnecessary.
                            llStopAnimation(animation);
                if(masterswitch)
                    show();
                trigger = "";
            }
            else if(use_voice)
            {
                change = llGetLinkNumber();
                if(change != me)
                {
                    if(me < change)
                    {
                        lowest += change - me;
                        if(listenHandle)
                            llMessageLinked(LINK_ALL_OTHERS, 99, "", "");
                    }
                    else 
                    {
                        if(!listenHandle)
                            listenHandle = llListen(1, "", "", "");
                        if(change)//intended to reduce packet storm on large linksets.
                            llMessageLinked(LINK_ALL_CHILDREN, 99, "", "");
                    }
                    me = change;
                }
            }
        }
        if(change & CHANGED_INVENTORY)
        {
            llSetText("Reloading configuration...",<1.0,1.0,1.0>,1.0);
            init();
        }
    }
    run_time_permissions(integer perm)
    {
        avatar = llAvatarOnSitTarget();
        if(perm & PERMISSION_TRIGGER_ANIMATION && llKey2Name(avatar) != "" && avatar == llGetPermissionsKey())
        {
            trigger = avatar;
            llStopAnimation("sit");
            llStartAnimation(animation);
            if(visible == TRUE)
                base_alpha = llGetAlpha(ALL_SIDES);
            hide();
        }
    }
 
    listen(integer channel, string name, key id, string message)
    {
        if(llStringLength(message) == 4)
        {
            message = llToLower(message);
            if(message == "show")
            {
                masterswitch = TRUE;
                if(llKey2Name(trigger) == "")
                    show();
            }
            else if(message == "hide")
            {
                masterswitch = FALSE;
                hide();
            }
            else
                return;
            llMessageLinked(LINK_ALL_OTHERS, 99, message, "");
        }
    }
    dataserver(key queryid, string data)
    {
        if(queryid == dataserver_key)
        {
            if(data != EOF)
            {
                integer command = llListFindList([";","title", "offset","rotation","voice","sit_button"], [llToLower(llList2String(llParseString2List(data, [" "], [":",";"]),0))]);
                if(command > 0)
                {
                    data = llDeleteSubString(data, 0, llSubStringIndex(data,":"));
                    if(command == 1)//title
                    {
                        if(llGetSubString(data, 0, 0) != " ")
                            TITLE = data;
                        else
                            TITLE = llDeleteSubString(data, 0, 0);
                        llSetSitText(TITLE);
                        if(visible && masterswitch)
                            show();
                    }
                    else if(command == 2)//offset
                    {
                        offset = (vector)data;
                        if(offset); else
                        {
                            if((llSubStringIndex(data, "<") & 0x7FFFFFFF) < llSubStringIndex(data, ">"))//could be a valid vector
                                offset = <0.0, 0.0, 0.01>;
                            else
                            {//definately isn't a valid vector
                                llSay(0,"Error: The numbers in the offset value lack the '<' and '>' signs. (Should be something like <3,1,6> )");
                                offset = <0.0, 0.0, 0.5>;
                            }
                        }
                        rot = llEuler2Rot(ROTATION * DEG_TO_RAD);
                        llSitTarget(offset, rot);
                    }
                    else if(command == 3)//rotation
                    {
                        ROTATION = (vector)data;
                        rot = (rotation)data;
                        if(<rot.x,rot.y,rot.z> != ROTATION)//allows us to use raw rotations & vectors at the same time.
                            rot = llEuler2Rot(ROTATION * DEG_TO_RAD);
                        llSitTarget(offset, rot);
                    }
                    else if(command == 4)//voice
                    {
                        if(llGetSubString(data, 0, 0) == " ")
                            data = llDeleteSubString(data, 0, 0);
                        use_voice = (llListFindList(["yes", "true", "on", "lag"], [llToLower(data)]) >= 0);
                        if(use_voice)
                        {
                            if(!listenHandle)
                                listenHandle = llListen(1, "", "", "");
                        }
                        else
                        {
                            llListenRemove(listenHandle);
                            listenHandle = 0;
                        }
                    }
                    else if(command == 5)//sit_button
                    {
                        if(llGetSubString(data, 0, 0) != " ")
                            llSetSitText(data);
                        else
                            llSetSitText(llDeleteSubString(data, 0, 0));
                    }
                }
                ++gLine;
                dataserver_key = llGetNotecardLine(gNotecard, gLine);
            }
            else
            {
                if(visible)
                    show();
                else
                    hide();
            }
        }
    }
}
Je ne sais pas quelle partie modifier afin de laisser mon objet visible même pendant l'execution de la pose assise ?

Merci encore

Denis
reponse
il y a une commande voca l
tape dans le chat
/1show
ou
/1hide
cela fait disparaitre ton objet mais enaucun cas il sera visible quand tu est assi dessus
c'est un script de pose ball
que tu place sur un objet (chaise ou cube pour les nul )
en effet cela te coutera un objet en plus
bref utilise le bon script pour faire la bonne chose
ce sera plus mieux

ce script est bien pourtant !!!
il fonctionne bien
ca depend de ce que tu attend de lui
certain script sont utiliser pour des chose bien particuliere
il se peut dont que le resultat ne coresponde pas du tout a votre attente
le modifier
bien sure possible
mais attention ne pas le massacrer faite en un copie avant toute modif c'est plus sure
et ensuite il faut aprendre et comprendre leur fonctionnement
c'est long et pas donner a tout le monde
faut etre patient
apprendre petit a petit
et savoir ou chercher les information
personnellement je bidouille
il y a plein de chose a apprendre
beaucoup de chose paraisse tres simple au depart mais a l'application ca se complique vite
lol
bon courrage debutants il en faut

tout s'apprend tout n'est question que de temps et de comprehention
le script , scripteur , devellopeur est un metier ,et comme tout les metier il n'y a pas qu'une ecole
le mieux c'est de comprendre l'anglais
et ensuite de se plonger dans ce monde a part au plus profond et apprendre sur le tas marche aussi
bref chacun son truck son metier
dit toi qu'un bon script tu n'aura pas le code source
le devellloppeur les vendent et en font un bon bisness sur sl
les freebies sont bien pour apprendre mais reste des exemples
dont il faut se servire pour apprendre et comprendre comment tout cela se gere
bref bon courage
tu verra c'est long
apres tu sera reconnaissant envers les gens qui consacre du temps a t'aider et te faire avancer
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Répondre

Connectés sur ce fil

 
1 connecté (0 membre et 1 invité) Afficher la liste détaillée des connectés