Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Scripted objects don't run state_entry() code, unless you recompile them.

Agatha Palmerstone
Space Girl
Join date: 23 Jan 2005
Posts: 185
03-29-2005 09:19
i.e. if you make a scripted object, take it into inventory, and then rez it again, it will not run the code in state_entry() unless you recompile the script.

Or at least, as of last night, that was the case.
cua Curie
secondlifes.com/*****
Join date: 14 Nov 2003
Posts: 196
03-29-2005 09:45
Thats how its intended to work. State entry only fires when the state is first entered. In a single state script thats when its first dropped in an object / first complied in an object. Picking up an object doesn't change its state.

Use the on_rez event if you need to something to fire when the object is re-rezed.
Andrew Linden
Linden staff
Join date: 18 Nov 2002
Posts: 692
03-29-2005 09:47
This is the correct behavior. The state_entry() callback is only called when the state is actually entered. If you derez to inventory then re-rez the script will resume where it left off; the script is already in the state where it was when it was de-rezzed.

The on_rez() callback can be used to perform certain operations whenever the scripted object is rezzed from inventory.
Reitsuki Kojima
Witchhunter
Join date: 27 Jan 2004
Posts: 5,328
03-29-2005 09:48
Yes, Cua is exactly right.

(edit) Errr. Andrew is right too! Of course, that goes without saying...

The other way would be horrible, would basicly ruin the vast majority of scripts out there.
_____________________
I am myself indifferent honest; but yet I could accuse me of such things that it were better my mother had not borne me: I am very proud, revengeful, ambitious, with more offenses at my beck than I have thoughts to put them in, imagination to give them shape, or time to act them in. What should such fellows as I do crawling between earth and heaven? We are arrant knaves, all; believe none of us.
Andrew Linden
Linden staff
Join date: 18 Nov 2002
Posts: 692
03-29-2005 09:59
cua gets 23 bonus FIC points and descends to 11th level Scriptificator for beating me to the punch and being correct at the same time.
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
03-29-2005 10:10
From: Andrew Linden
cua gets 23 bonus FIC points and descends to 11th level Scriptificator for beating me to the punch and being correct at the same time.

Oh man... My sides hurt now... :D
_____________________