[tahoe-dev] Hack Fest report from Hack Fest 3, December 14, 2007

Nathan nejucomo at gmail.com
Wed Dec 19 10:36:42 PST 2007


A quick correction, should anyone else have the masochistic streak
Second Life programming requires:

On Dec 19, 2007 8:59 AM, Zooko O'Whielacronx At Work
<zooko at allmydata.com> wrote:
> Folks:

...

>
> Another funny (but sad) story was how when he had written the first
> version of Conway's Second Life, he had the cells with the program in
> his inventory, and he placed them out into the virtual World to test
> it out, and the script automatically started up and ran, and the
> cells all died off and deleted themselves, taking the only copy of
> his implementation with them.
>

As far as I know, the only way to create a script in SL is to open an
object which is "rezzed" (ie: Not in your inventory, but manifested in
the virtual world), and click on a button called "New Script", which
adds a template to that object's inventory.  This new script exists
only within the rezzed object (so it is not in your personal
inventory).  If that script (which is already running, by default)
calls llDie(), or you delete the object, then you no longer have
access to that script.

When you "take" a rezzed object, a copy of all of its state is saved
to your inventory, then the in-world manifestation is removed.  When
you rez an object from your inventory, a new manifestation is created
from a copy of that state.  I believe you can only alter an objects
contents if it is rezzed.  (An alternative is to have a script in your
inventory which you can give to a rezzed object.)

This leads to funny situations:  If you are editing a script of a
rezzed object which causes it to die, you lose all changes to that
script.  In the case of life, I had written an entire first draft of
the Cell script, and when I saved it, it automatically started running
the new change.  That Cell had 0 neighbors, so it died when the next
generation hit.

If you had an object in your inventory which had a script that called
llDie() in response to rezzing, I don't think you could ever edit the
object!  (You could remove it from your inventory, but that's it.)

Maybe I'm missing an important interface feature wrt the inventory...

My solution:  When you rez an object, it receives a 32bit parameter.
If rezzed from your inventory, this is always zero.  If rezzed from a
script, the script may specify any value.  So, my Cell does not do
anything if this parameter is 0.

Another solution:  Make sure the script is not running.  After every
edit, take a copy.  To test, toggle the running switch.  Never edit a
script once that copy has been set to running.


Regards,
N


More information about the tahoe-dev mailing list