Jump to content

deanimo

Resident
  • Content Count

    8
  • Joined

  • Last visited

Posts posted by deanimo

  1. I want to make a script that detects when my object is dropped on the ground, and not attached, for example an script that says "i m on the ground" when it is dropped on a sandbox, and not attached, i couldnt find an event that discriminates when is rezzed on ground or attached,  i tryed in on_rez ovbiously but i get the same result when the object is attached...

    thanks all for your help.

  2. i m not sure if that is the problem, if it is work with another animation, it should work stopping and playing the same animation, and if the stop takes a time... the anymation should stop at least i think.. maybe it doesnt start again but should stop.. and i already tryed with large sleeps and doesnt work either.. really i dont know what else to do..

     

    thanks for your time.

  3. hello, sorry for bother you all but i want to know why my script isnt working. i tryed to restart an animation using llStopAnimation(animation1) llStartAnimation(animation1) and doesnt work, but if i use llStopAnimation(animation1) llStartAnimation(animation2) works fine.. why when i want to restart the SAME animation simply continues playing the animation an never stop it and never start it again? i leave you the code here so you can try.. you only have to place this script and 2 animations to try it

     

    /////////// USER SETTINGS ////////////////////

    string floattext = "Sit Here";
    string sittext = "Pose!";
    vector textcolor = <1,1,1>;

    vector sittarget = <0,0,1>;
    vector sitangle = <0.0,0.0,0.0>;

    integer listen_handle;
    //////////// BEGIN SCRIPT ////////////////////

    rotation sitrotation;

    default
    {
        on_rez( integer sparam )
        {
            llResetScript();
        }
       
        state_entry()
        {
            listen_handle = llListen(1, "", llGetOwner(), "");
            sitrotation = llEuler2Rot(sitangle * DEG_TO_RAD); // convert the degrees to radians, then convert that vector into a rotation
            llSitTarget(sittarget, sitrotation);
            llSetText(floattext, textcolor, 0.8);
            llSetSitText(sittext);
        }

        changed(integer change)
        {
            if(change & CHANGED_LINK) // If someone has sat on, or "linked," to this prim...
            {
                key avataronsittarget = llAvatarOnSitTarget();
                if( avataronsittarget != NULL_KEY )    //Someone is sitting on the object
                {
                    llSetText("", textcolor, 0.8);
                    llSetLinkAlpha(LINK_SET,0,ALL_SIDES); // Turn Invisible
                    // Before animating, first check if we have permission to do so:
                    if ((llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) && llGetPermissionsKey() == avataronsittarget) {
                        // If we do, we can animate:
                        llStopAnimation("sit");
                        llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION,0));
                    } else {
                        // If we dont, ask for them:
                        llRequestPermissions(avataronsittarget, PERMISSION_TRIGGER_ANIMATION);
                        // We'll animate in the run_time_permissions event, which is triggered
                        // When the user accepts or declines the permissions request.
                    }
                }
                else  //stood up
                {
                    llSetText(floattext, textcolor, 0.8);
                    llSetLinkAlpha(LINK_SET,1,ALL_SIDES); // Make Visible
                }
            }
        }

        run_time_permissions(integer perm)
        {
            if(perm)
            {
                llStopAnimation("sit");
                llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION,0));
            }
        }
       
        listen( integer channel, string name, key id, string message )
        {
            if (message == "restart")
            {
                llStopAnimation(llGetInventoryName(INVENTORY_ANIMATION,0));
                llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION,0)); // if you use an 1 instead of a 0 WORKS, why!?!?! and how can i resolve my problem?
            }
               
        }
    }

     

     

    thanks you all.

×
×
  • Create New...