Jump to content

Path Cut using a script


Pedlar Decosta
 Share

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

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

Recommended Posts

How does one go about adjusting the parameter 'path cut' beginning and end of a prim using a script ? I can see 'slice' on the llSetPrimitiveParams() list but not path cut. I am wanting to drop the script into a box prim and cut the path to 0.3750 & 0.8750 (or similar) to make a single prim swinging door. 

Link to comment
Share on other sites

In case anyone wants a script to make a single prim swing door (probably nobody because it is easy to do it manually). Drop it in a prim and afterward it deletes itself.

 vector cut = <0.3750,0.8750,0.0000>;
 float hollow = 0.0000;
 vector twist = <0,0,0>;
 vector top_size = <1.0000,1.0000,0.0000>;
 vector top_shear = <0,0,0>;
 
default
{
    state_entry()
    {
        llSay(0, "Making a single prim swing door shape!");
        vector pos = llGetLocalPos();
        llSetPrimitiveParams([9,PRIM_TYPE_BOX, PRIM_HOLE_DEFAULT, cut, hollow, twist, top_size, top_shear ]);
        llSetScale(<0.10000, 3.00000, 3.00000>); 
        llSetPos(<pos.x, pos.y, pos.z+1.5>);
        llSleep(2.0);
        llSay(0,"Finished ! Door is ready for swing script ! Deleting this script now.");
        llRemoveInventory(llGetScriptName());
    }
}

Link to comment
Share on other sites

  • 2 weeks later...

I was thinking about adding the above code into a swing door script. However you wouldn't want to do it automatically every time the script is reset. So a dialogue panel would give the user the choice whether to cut the prims path or not. But it would be best if it only showed the dialog the first time the script was put into a prim. So that is my question; what is the best way to get a script to present a dialogue panel the first time only the script is put into the prim ? 

I thought of using either the description box or the name box to see if it was a newly created prim, and if so to run the routine/code, but that wouldn't always be the case. Some builders might be using prims that have already been named. By parsing the name or description boxes I could add a label to get around that -

            list list1 = llParseString2List(llGetObjectDesc(), ["."],[]);
            string 1stHalf = llList2String(list1,0); 
            string 2ndHalf = llList2String(list1,1);

          if(2ndHalf =="label")

          {  // don't show dialog }

However the builder may not want to have their names or descriptions changed. So are there any other methods to tell if it is the first time a script has been inserted into a prim ?

Edited by Pedlar Decosta
Link to comment
Share on other sites

How about first using llGetLinkPrimitiveParams, to determine whether or not the prim is already pathcut?   If it's not, offer to pathcut it.   If it is, do nothing.

Or, if it's a stand-alone script, then call llRemoveInventory(llGetScriptName()) once the script has done its stuff (or the owner says "No" to the dialog asking if the owner wants the prim pathcut?

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2202 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...