Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

repositioning script

Bright May
Registered User
Join date: 9 Oct 2006
Posts: 13
10-18-2006 02:43
I am a newbie so bare with me if I am being dumb.

I have this script in a single prim object, to reposition it every second.

vector startPos;

default
{
state_entry()
{
llSetTimerEvent(1);
startPos = llGetPos();
}

timer()
{
llSetPrimitiveParams([PRIM_POSITION, startPos]);
}

}

it works except if i create a new instance of the object it repositions
to the location of the 1st instance.

If I edit and turn the script off, then taketo inv , make a new instance from this
and turn its script back on - its fine.

Is this normal, it's not what i expected.
Doesn't state_entry run when a new instance is made?
Dillon Morenz
Registered User
Join date: 21 May 2006
Posts: 85
10-18-2006 02:45
From: Bright May

Is this normal, it's not what i expected.
Doesn't state_entry run when a new instance is made?


This event is not triggered every time the object is rezzed, due to the preservation of states between instances (rezes). Use on_rez for a reliable first event.

http://lslwiki.com/lslwiki/wakka.php?wakka=state_entry
http://lslwiki.com/lslwiki/wakka.php?wakka=on_rez
_____________________
Bright May
Registered User
Join date: 9 Oct 2006
Posts: 13
10-18-2006 23:50
Thanks Dillon

Thats solved it.