Scripts that Shape Prims?
|
|
Amaranthim Talon
Voyager, Seeker, Curious
Join date: 14 Nov 2006
Posts: 12,032
|
06-02-2009 08:04
First off- I do not know very much about scripting so please take pity and write s l o w l y so I can try and understand  ... The other day while building with a friend she rezzed a shape that was intricately shaped- she mentioned that it was shaped thru scripts and adjustments to the shape were effected thru adjusting the script. We kept talking and I forgot to ask more specifics... so- Can someone point me in the right direction as to what scritps are involved and where i might find perhaps a basic one written already that i can change, trial and error, to see what turns up? Thank you in advance, folks.
_____________________
"Yield to temptation. It may not pass your way again. " Robert A. Heinlein  http://talonfaire.blogspot.com/ Visit Talon Faire Main: http://slurl.com/secondlife/Misto%20Presto/216/21/155- Main Store XStreets: http://tinyurl.com/6r7ayn
|
|
Kayaker Magic
low carbonated footprint
Join date: 11 Sep 2008
Posts: 109
|
06-02-2009 08:23
The short answer is llSetPrimativeParams(). With that function you can have a script change just about anything about a prim you can change from the build menu. PRIM_TYPE lets you change all the parameters like hollowness, cut, shear etc. You can even change the scultp texture to a different shape dynamically from a script.
|
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
06-02-2009 08:30
One place to start reading is  . It looks a bit technical if you're not used to scripting, but I think you'll be able to see the possibilities.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
|
Amaranthim Talon
Voyager, Seeker, Curious
Join date: 14 Nov 2006
Posts: 12,032
|
06-02-2009 08:59
Thanks all--- heading on over!
_____________________
"Yield to temptation. It may not pass your way again. " Robert A. Heinlein  http://talonfaire.blogspot.com/ Visit Talon Faire Main: http://slurl.com/secondlife/Misto%20Presto/216/21/155- Main Store XStreets: http://tinyurl.com/6r7ayn
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
06-02-2009 16:16
and you'll probably want to know this one word "prim torture".
it's the term for what those script are generally made for, to achieve shapes that require multiple steps through various shapes to get a shape that may be (or sometimes isn't) available by converting between shapes to access properties that aren't normally allowed for that shape in the edit window.
a simplistic example is prim paper, which is sphere: dimple.49/.51 -> box, and then lower the z dimension to minimum allowing a surface that is effectively .0002m thick (.01m * 2%)
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Amaranthim Talon
Voyager, Seeker, Curious
Join date: 14 Nov 2006
Posts: 12,032
|
06-03-2009 10:29
From: Void Singer and you'll probably want to know this one word "prim torture".
it's the term for what those script are generally made for, to achieve shapes that require multiple steps through various shapes to get a shape that may be (or sometimes isn't) available by converting between shapes to access properties that aren't normally allowed for that shape in the edit window.
a simplistic example is prim paper, which is sphere: dimple.49/.51 -> box, and then lower the z dimension to minimum allowing a surface that is effectively .0002m thick (.01m * 2%) I had thought prim torture refered to say tiny prims and the torture we go thru to get them tht way  Buildiers being the real tortured ones... I had never needed prim paper but this is lovely- thank you for sharing that - I did go to the wiki and read a bit of what i found there... after the smoke recedeed I realized just what a mountain stood before me. I have been known to take existing scripts and do some kindergarten changes on them- thru trial and error finally achieving what i envisioned- this though seesm i will have to do from scratch unless there is an example somewhere i havent found yet-
_____________________
"Yield to temptation. It may not pass your way again. " Robert A. Heinlein  http://talonfaire.blogspot.com/ Visit Talon Faire Main: http://slurl.com/secondlife/Misto%20Presto/216/21/155- Main Store XStreets: http://tinyurl.com/6r7ayn
|
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
06-03-2009 10:51
It's not truly all that hard. If you can make a shape in the edit window, then you can script the same steps with llSetPrimitiveParams. What you need to look at are the PRIM_TYPE and PRIM_SIZE variables, each of which has a direct counterpart in a menu selection in the Edit window. Then you pop them one at a time -- or if you are daring, as composite statements -- into a short script like this ... default { touch_start(integer num) { llSetPrimitiveParams([PRIM_TYPE,PRIM_TYPE_BOX, PRIM_HOLE_CIRCLE, <0.0, 1.0, 0.0>, 0.5, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>]); llSetPrimitiveParams([PRIM_SIZE,<2.0,3.5,1.0>]); // And so forth until you run out of things to specify ... llRemoveInventory(llGetScriptName()); // Deletes this script when done } }
and you drop the script into a prim and click on it. It's worth playing with so you get the hang of it. 
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
|
Amaranthim Talon
Voyager, Seeker, Curious
Join date: 14 Nov 2006
Posts: 12,032
|
06-03-2009 13:05
Thank you!!! That's what I was hoping for- something with the bones in it so I can play with it till i go stark raving mad  - I was just wondering about stuff to do to fill the hours in between one thing and another when building doesnt quite come tom - this will great  Thanks again! ETA - Oooh! It made a hole  Yay!! (I know, I am easily amused  )
_____________________
"Yield to temptation. It may not pass your way again. " Robert A. Heinlein  http://talonfaire.blogspot.com/ Visit Talon Faire Main: http://slurl.com/secondlife/Misto%20Presto/216/21/155- Main Store XStreets: http://tinyurl.com/6r7ayn
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
06-03-2009 18:08
lol, yeah the prim torture script on the wiki... is generalized out to every possible case... whereas you're probably only needing one or two?
go with Rolig's suggestion, I just wanted you to be aware of the extended resources, which enable several advanced uses.
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Amaranthim Talon
Voyager, Seeker, Curious
Join date: 14 Nov 2006
Posts: 12,032
|
06-04-2009 11:28
I ws sooo daring last night! I even added a FLEXI parameter/argument (not sure correct term) and it worked!!! Didn'tmake anything practical mind you- but it was cool.
This then got me to thinking... Any one here using the Crystal Gadgets Prim Finder? Any way to store "new shapes" in it? I did IM the creator - waiting on response.
_____________________
"Yield to temptation. It may not pass your way again. " Robert A. Heinlein  http://talonfaire.blogspot.com/ Visit Talon Faire Main: http://slurl.com/secondlife/Misto%20Presto/216/21/155- Main Store XStreets: http://tinyurl.com/6r7ayn
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
06-04-2009 16:24
From: Amaranthim Talon I ws sooo daring last night! I even added a FLEXI parameter/argument (not sure correct term) and it worked!!! Didn'tmake anything practical mind you- but it was cool.
This then got me to thinking... Any one here using the Crystal Gadgets Prim Finder? Any way to store "new shapes" in it? I did IM the creator - waiting on response. one of CrytalShard's" toys? you should hear back shortly, CS is pretty good about that (unless it's interpreted as a custom request and then you may never hear anything.. ever... again...
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Amaranthim Talon
Voyager, Seeker, Curious
Join date: 14 Nov 2006
Posts: 12,032
|
06-04-2009 17:03
From: Void Singer one of CrytalShard's" toys? you should hear back shortly, CS is pretty good about that (unless it's interpreted as a custom request and then you may never hear anything.. ever... again... Crystal Gadget- I think the guy's name was Anthony something- not in-wrold right ow to check.
_____________________
"Yield to temptation. It may not pass your way again. " Robert A. Heinlein  http://talonfaire.blogspot.com/ Visit Talon Faire Main: http://slurl.com/secondlife/Misto%20Presto/216/21/155- Main Store XStreets: http://tinyurl.com/6r7ayn
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
06-04-2009 17:35
ah... CS uses Crystal to prefix some stuff, and gadget seemed likely....
this is the problem with names that are common nouns =)
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Amaranthim Talon
Voyager, Seeker, Curious
Join date: 14 Nov 2006
Posts: 12,032
|
06-05-2009 11:38
Well I heard back- sadly there is no way to do what i had hoped to do and he asked meto send shapes if i wanted him to include in the next update. He also said adding the ability to store one's own would require a major re-write so.. 
_____________________
"Yield to temptation. It may not pass your way again. " Robert A. Heinlein  http://talonfaire.blogspot.com/ Visit Talon Faire Main: http://slurl.com/secondlife/Misto%20Presto/216/21/155- Main Store XStreets: http://tinyurl.com/6r7ayn
|
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
06-05-2009 12:03
That's a disappointment, but a fairly minor one. Now that you know how to script the shapes you like, you can keep your own library of scripts for specific ones and pull them up out of inventory as you need them. It's not a convenient as having everything packaged neatly in Prim Finder, but it works. 
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|