Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Reigning in my Runaway Prims

Davan Camus
Registered User
Join date: 13 Sep 2005
Posts: 67
11-01-2005 13:04
(doesn't that sound like the name of a rare 1950's B-Side?)

So, I love glittery things. Who doesn't?

I wrote a cute little moving-prim that leaves behind a trail of particles, in some nice geometric pattern. To start it off, I have:

on_rez() { gPatternCenter = llGetPos(); gPatternStep = 0; ...

It seemed to work fine at the sandbox, so I took it home to set up on my land. I rezzed one, and it disappeared! I rezzed another one or two, and couldn't find them. That was a week ago.

Just yesterday, strolling around, I found them, on someone else's land, particulating away! (Sorry about that Jade & Robin.) I don't know if I've left others littered around...

Turns out they got to finish their currently-executing events before the on_rez() events, and went zipping off to their old gPatternCenter locations.

Does anyone know how to solve this problem? I was hoping to be able to just rez these from any state, and have them reset correctly. Is there something like llGetRezPos()?

(Maybe a reset-on-rez flag would be nice, or the option to rez something in a disabled state, so you can defuse a ticking timescript.)
_____________________
Visit Cubes at Alice 100,18.
--------------------------------------------------
Davan Camus, born: 2005 September 8
Out-world location: Santa Cruz, CA
UI Proposal: http://davancamus.hexaflexagon.com/blog/?p=39
Numa Herbst
SHI-SHAAA!!
Join date: 13 Jun 2005
Posts: 99
11-01-2005 13:37
You may want to do a:

CODE
 on_rez(integer rez) 
{
llResetScript();
}


And then set gPatternCenter on the state_entry() event. Scripts remember their states and all kinds of craziness, so you may want to flush out the junk.

Hope this helps.