Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Replicating script question

Dumisani Ah
Pass me the hammer
Join date: 2 Dec 2006
Posts: 95
06-07-2008 15:32
Hi everyone, yeah, me again, with my old self replicating script. I have successfully built a script that lets an object replicate itself and then die. However my child object keeps rezzing just a pixel or so higher than the original object so that when I check back 12 hours or so later, the latest child object ends up way above the original position. I am not sure how this happens since I check and record the position of the original object at the point of rezzing the child object, and the child object repeats the exact same method again when it rezzes a child object, but somehow somewhere a little error creeps in that dominoes into this larger error over time. Any ideas on how I can fix a child object to the exact position of the original object when rezzed?
_____________________
Screwdrivers are so 90's...
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
06-07-2008 16:23
llRezAtRoot() may be better for you than llRezObject(), but maybe you already use that?
The two take the same set of parameters. The former rez the root position, the latter the geometric center (or is it center of gravity?), at the coordinates given.
_____________________
From Studio Dora
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
06-07-2008 16:46
From: Dumisani Ah
Hi everyone, yeah, me again, with my old self replicating script. I have successfully built a script that lets an object replicate itself and then die. However my child object keeps rezzing just a pixel or so higher than the original object so that when I check back 12 hours or so later, the latest child object ends up way above the original position. I am not sure how this happens since I check and record the position of the original object at the point of rezzing the child object, and the child object repeats the exact same method again when it rezzes a child object, but somehow somewhere a little error creeps in that dominoes into this larger error over time. Any ideas on how I can fix a child object to the exact position of the original object when rezzed?

Sounds like floating point error. If it is, then it is a combination of the geometry of the rezzed object and the position it is rezzing to. Take you script and put it in a box measuring 0.5,0.5,0.5 and edit the position to all even numbers and then try it.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Dumisani Ah
Pass me the hammer
Join date: 2 Dec 2006
Posts: 95
06-08-2008 01:16
Thanks Dora and Jesse,

Dora, I may go back to llRezAtRoot since I replaced it with llRezObject mainly bcause I was unsure from the Wiki explanation why exactly the one would be better than the other.

Jesse, I actually think this may be the biggest problem - the geometry is not complex, but it is a sculpted object with two sculpties linked to make a fruit and stem. Basically the scripts are for free fruit trees in the Bishara Resorts sims as my own first contribution to Second Life like so many of you have done in the past. I have combined several scripts in the wiki, made some changes and adjustments and basically on rezzing the tree, it rezzes the fruit that then 'grow' change color and finally drops off the tree rotten once it has rezzed a new child object in its place.

:o The fruit now end up wayyyyy above the tree by the time I log back the next day. So I am going to test the whole thing again, using Dora's suggested change also, in the square prims instead, and then again using the original script to see which solution fixes the cause. Once done I will gladly post the whole contraption here :D My tree leaves suck anyways, and someone else out there would do so much better with this than I :p.
_____________________
Screwdrivers are so 90's...