Jump to content

Colin Eternal

Resident
  • Posts

    6
  • Joined

  • Last visited

Posts posted by Colin Eternal

  1. you can edit the time in the part near the top: 

    float time = 15.0; //change this for how long to ignore touches

     it's in seconds so if you want 10 mins change it to:

    float time = 600.0; //change this for how long to ignore touches

     A version with loading and ready messages:

    // Rez an object on touch, with relative position, rotation, and velocity all described in the rezzing prim's coordinate system.string object = "Rock"; // Name of object in inventoryvector relativePosOffset = <0.0, 0.0, 2.0>; // "Forward" and a little "above" this primvector relativeVel = <0.0, 0.0, 0.0>; // Traveling in this prim's "forward" direction at 1m/srotation relativeRot = <0.707107, 0.0, 0.0, 0.707107>; // Rotated 90 degrees on the x-axis compared to this priminteger startParam = 50;float MaxDist = 3.0;string dist;integer active = TRUE;float time = 600.0; //change this for how long to ignore touches default{    state_entry()    {        dist = llGetSubString((string)MaxDist,0,(llSubStringIndex((string)MaxDist,".")+2));       // llOwnerSay(dist);    }        touch_start(integer a)         {             if (active) {                  key k = llDetectedKey(0);                 vector pos = llGetPos();                 if(llVecDist(pos,llDetectedPos(0))>MaxDist){                    llRegionSayTo(k,0,"Sorry, "+llGetDisplayName(k)+" but you must be no more than "+dist+" metres away for this to work");                    return;                 }                 else{                    llRegionSayTo(k,0,"You are within the maximum range");                    //do stuff                 }                 {                    active = FALSE;                    llSetTimerEvent(time);                    vector myPos = llGetPos();                    rotation myRot = llGetRot();                    vector rezPos = myPos+relativePosOffset*myRot;                    vector rezVel = relativeVel*myRot;                    rotation rezRot = relativeRot*myRot;                    llRezObject(object, rezPos, rezVel, rezRot, startParam);                    llWhisper(0, "Loading");                }            }        }timer(){    llSetTimerEvent(0);    active = TRUE;    llWhisper(0, "Ready");}}

     What do you mean by timer? Like a countdown in chat or something?

  2. Sorry, you're right, this should avoid that problem

     

    // Rez an object on touch, with relative position, rotation, and velocity all described in the rezzing prim's coordinate system.string object = "Rock"; // Name of object in inventoryvector relativePosOffset = <0.0, 0.0, 2.0>; // "Forward" and a little "above" this primvector relativeVel = <0.0, 0.0, 0.0>; // Traveling in this prim's "forward" direction at 1m/srotation relativeRot = <0.707107, 0.0, 0.0, 0.707107>; // Rotated 90 degrees on the x-axis compared to this priminteger startParam = 50;float MaxDist = 3.0;string dist;integer active = TRUE;float time = 15.0; //change this for how long to ignore touches default{    state_entry()    {        dist = llGetSubString((string)MaxDist,0,(llSubStringIndex((string)MaxDist,".")+2));       // llOwnerSay(dist);    }        touch_start(integer a)         {             if (active) {                  key k = llDetectedKey(0);                 vector pos = llGetPos();                 if(llVecDist(pos,llDetectedPos(0))>MaxDist){                    llRegionSayTo(k,0,"Sorry, "+llGetDisplayName(k)+" but you must be no more than "+dist+" metres away for this to work");                    return;                 }                 else{                    llRegionSayTo(k,0,"You are within the maximum range");                    //do stuff                 }                 {                    active = FALSE;                    llSetTimerEvent(time);                    vector myPos = llGetPos();                    rotation myRot = llGetRot()                    vector rezPos = myPos+relativePosOffset*myRot;                    vector rezVel = relativeVel*myRot                    rotation rezRot = relativeRot*myRot                    llRezObject(object, rezPos, rezVel, rezRot, startParam);                }            }        }timer(){    llSetTimerEvent(0);    active = TRUE;}}

     

  3. You can either do it the way Rolig described or like this where there is a timer to ignore the touches:

    // Rez an object on touch, with relative position, rotation, and velocity all described in the rezzing prim's coordinate system.string object = "Rock"; // Name of object in inventoryvector relativePosOffset = <0.0, 0.0, 2.0>; // "Forward" and a little "above" this primvector relativeVel = <0.0, 0.0, 0.0>; // Traveling in this prim's "forward" direction at 1m/srotation relativeRot = <0.707107, 0.0, 0.0, 0.707107>; // Rotated 90 degrees on the x-axis compared to this priminteger startParam = 50;float MaxDist = 3.0;string dist;integer active = TRUE;float time = 15.0; //change this for how long to ignore touches default{    state_entry()    {        dist = llGetSubString((string)MaxDist,0,(llSubStringIndex((string)MaxDist,".")+2));       // llOwnerSay(dist);    }        touch_start(integer a)         {             if (active) {                 active = FALSE;                 llSetTimerEvent(time);                 key k = llDetectedKey(0);                 vector pos = llGetPos();                 if(llVecDist(pos,llDetectedPos(0))>MaxDist){                    llRegionSayTo(k,0,"Sorry, "+llGetDisplayName(k)+" but you must be no more than "+dist+" metres away for this to work");                    return;                 }                 else{                    llRegionSayTo(k,0,"You are within the maximum range");                    //do stuff                 }                 {                    vector myPos = llGetPos();                    rotation myRot = llGetRot()                    vector rezPos = myPos+relativePosOffset*myRot;                    vector rezVel = relativeVel*myRot                    rotation rezRot = relativeRot*myRot                    llRezObject(object, rezPos, rezVel, rezRot, startParam);                }            }        }timer(){    llSetTimerEvent(0);    active = TRUE;}}

     

  4. I can create scripts for any purposes, optimised for minimum lag. Prices depend on the complexity of the script, send me a notecard or IM in-world and we can discuss exactly what you want. Any bugs found afterwards will be fixed free of charge. Please note that I am only a scripter, not a builder/sculptor/animator.

×
×
  • Create New...