Change Height Prim
|
|
Tex Nasworthy
Udder Disgrace
Join date: 2 Sep 2006
Posts: 1,330
|
05-09-2007 14:14
I've just started learning LSL scripting, or I should say about to start.
At the moment I have a need for a script that will change the height of a prim when the prim is touched, and move the prim by 1/2 the height change, so it appears that the prim is growing in only one direction.
It appears that this should be fairly simple. Can anyone point me to an example or a script that does something similar, or to a script for sale that will do this.
Thanks in advance, Tex
|
|
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
05-09-2007 15:53
If your prim will not need to grow larger than 5m, then there is a very simple solution. Cut the prim in half using the cut begin/end params in the prim editor. Rotate the prim so that the cut-away edge is facing down. Then, use llSetScale() to change the size of the prim. It will grow up without need for being repositioned (it actually grows up and down, but you've cut away the down part and therefore don't see it.
|
|
Jacques Groshomme
Registered User
Join date: 16 Mar 2005
Posts: 355
|
05-09-2007 15:56
You're looking for llSetPrimitiveParams(), triggered by the touch_start event.
|
|
Tex Nasworthy
Udder Disgrace
Join date: 2 Sep 2006
Posts: 1,330
|
Still learning......
05-10-2007 12:22
Like I mentioned I'm just starting to learn LSL.
I think I've got a handle on using "touch_start". (I think. LOL)
"llSetPrimitiveParams()" still has me a bit confused.
If anyone has an example of using "llSetPrimitiveParams()" with "touch start", that they would not mind sharing, it would greatly appreciated.
Thanks again, Tex
|
|
Destiny Niles
Registered User
Join date: 23 Aug 2006
Posts: 949
|
05-10-2007 12:32
The sample height detector script would be a good place to start. You can find one in the a freebie box of scripts at 5,000 freebie warehouse.
|
|
Tex Nasworthy
Udder Disgrace
Join date: 2 Sep 2006
Posts: 1,330
|
Thanks Destiny,
05-10-2007 12:35
I think I already have the Height Detector. I'll take a look at that.
|
|
Tex Nasworthy
Udder Disgrace
Join date: 2 Sep 2006
Posts: 1,330
|
Script in Linked Prim
05-10-2007 15:17
I have a script that changes the height of my prim when it is touched. If I link 3 prims together, how do I make all 3 prims change when they are touched. I've linked my 3 prims, they each contain the script. However when I touch a prim in the linked set only the touched prim changes. To change the others I have to touch them as well.
What am I missing?
If you haven't guessed I'm a scripting newbie.
Thanks in advance for any help, Tex
|
|
Speon Beerbaum
Registered User
Join date: 29 Mar 2007
Posts: 11
|
05-11-2007 05:46
From: Tex Nasworthy I have a script that changes the height of my prim when it is touched. If I link 3 prims together, how do I make all 3 prims change when they are touched. I've linked my 3 prims, they each contain the script. However when I touch a prim in the linked set only the touched prim changes. To change the others I have to touch them as well.
What am I missing?
If you haven't guessed I'm a scripting newbie.
Thanks in advance for any help, Tex i'd suggest you put the script only into the root prim. that's sufficient.  If there's a script in the root prim with a touch_start event, it also triggers if you click on a child prim. so there's no need to put a script in every child prim. then you need: a) to change the root prim llSetPrimitiveParams([PARAMS]); b) to change the child prims llSetLinkPrimitiveParams(LINK_ALL_OTHERS, [PARAMS]); Drawback is, that there will be a delay of 0.2 seconds between a) and b). You can get rid of that if you use this to change the whole link set with one call: llSetLinkPrimitiveParams(LINK_SET, [PARAMS]); Details about those functions can be found here: http://www.lslwiki.net/lslwiki/wakka.php?wakka=llSetPrimitiveParamshttp://www.lslwiki.net/lslwiki/wakka.php?wakka=llSetLinkPrimitiveParamsmaybe that helps you out...
|
|
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
|
05-11-2007 09:57
From: Speon Beerbaum i'd suggest you put the script only into the root prim. that's sufficient.  If there's a script in the root prim with a touch_start event, it also triggers if you click on a child prim. so there's no need to put a script in every child prim. then you need: a) to change the root prim llSetPrimitiveParams([PARAMS]); b) to change the child prims llSetLinkPrimitiveParams(LINK_ALL_OTHERS, [PARAMS]); Drawback is, that there will be a delay of 0.2 seconds between a) and b). You can get rid of that if you use this to change the whole link set with one call: llSetLinkPrimitiveParams(LINK_SET, [PARAMS]); Details about those functions can be found here: http://www.lslwiki.net/lslwiki/wakka.php?wakka=llSetPrimitiveParamshttp://www.lslwiki.net/lslwiki/wakka.php?wakka=llSetLinkPrimitiveParamsmaybe that helps you out... one of the problems with dumping the same data to all the prims in the link-set is that if the prims need to be changed to different relative heights it won't produce the desired result. Instead you'll have to do several calls to llSetLinkPrimitiveParams() I'm not sure if there's a hack for the llSetLinkPrimitiveParams similar to warppos that would let you do it all in one go with different settings for different prims, but my guess is not as the prim recieving the changes isn't in the parameter list.
_____________________
My SLExchange shopTypos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not. The function is working perfectly fine. It's just not working the way you wanted it to work.
|