Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Automatic Script Updating challenges

Zeno Concord
To infinity, and beyond!
Join date: 28 Mar 2005
Posts: 51
07-10-2005 15:19
Is there a way to update a script (or anything else) in the inventory of an object that is not rezzed? I am running the update script from a rezzed object, of course. I am particularly interested in updating scripts in unrezzed objects because I am building a vender that is intended to hold up to a hundred objects, and I don't want to manually update the scripts in the objects by rezzing them one at a time, and then dragging them back into the vendor.

I learned from these forums and direct experience that llRemoteLoadScriptPin does not work on an unrezzed object. That *almost* makes sense because one of the options is to activate the script, and what does it mean to activate a script in an object that is not rezzed when it is not actually running? However, I think it *should* mean the obvious thing. The script remembers whether it is active or not even while it is derezzed, and therefore it should be settable regardless whether it is rezzed.

Well, since llRemoteLoadScriptPin wasn't going to help me, I then tried llGiveInventory . I ran it from a script contained within the same object, giving it the key of the target object I that want to update (which I got using llGetInventoryKey) and the name of the script that I want to update in the target. But that also seems to not do any update. Did I do something wrong, or does it also refuse to update in unrezzed objects?

After doing the update (with llGiveInventory, if that succeeded), then I planned to activate (i.e. make it Running) the updated script (which was unactivated before, because I only want to activate it within the target object) using llResetScript or llResetOtherScript, but it is not clear whether resetting also causes the script to be active if it started out inactive.

The problem with doing an update of the script within the rezzed object is that, using llRemoteLoadScriptPin, it takes 3 seconds per update, and I am rezzing 10 objects at once. A 30 second delay before the vendor is useable each time the set of objects is changed would be unbearable (there are 10 buttons each containing 10 objects)

One possible workaround is to run the update from a different script each time, because the delay is associated with the script. I could propagate the update from one object to the next, each one only doing one call of llRemoteLoadScriptPin. If the delay happens after the call, then the target object could start up another llRemoteLoadScriptPin immediately, but if the delay happens before the call completes, then that won't help.

If I can only update scripts when they are rezzed, then I will have to either keep updating them every time they are rezzed, or somehow get the updated objects back in the vendor - is there any automatic way to do that, or does it require a manual drag and drop?

One more thing I learned along the way on this adventure. In order to put in a script in an object and have it be deactivated (i.e. not running) you have to be tricky. Any script that you add by dragging and dropping the script from inventory (is there another way?) is automatically running, and it runs the default state state_entry function. If I only want to have the script be in the inventory so that I can send it to other objects where they may be activated, then I need it to be deactivated in the first object. The trick is to create a new script, make it deactivated, and then replace the contents by using copy-paste. However, to change a script to be deactivated, it seems to take two cycles. That is, if you deactivate, and then close the script editor, and open again, it will still be activated. Deactivating the second time seems to work. Same with activating - it takes two cycles.

Thanks for any advice on this problem. This vendor will be free by the way.
Burke Prefect
Cafe Owner, Superhero
Join date: 29 Oct 2004
Posts: 2,785
07-10-2005 21:23
Just get one of those 'server' vendors and update once? *shrugs*
I'd personally like the option to make some scripts work like textures. You just pop in a script UUID into the contents of a prim and you can update that script once and it'll work across the entire grid.

Idunno.`
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
07-11-2005 03:32
From: Burke Prefect

...
I'd personally like the option to make some scripts work like textures. You just pop in a script UUID into the contents of a prim and you can update that script once and it'll work across the entire grid.
...


It's seems crazy that we need so many copies of scripts in copies of objects. For the creator/author to keep the only copy of the source makes perfect sense. To have all compilations keyed to that source is a great idea.

...

until the source gets deleted ! ??

...

I wonder if this idea could actually be made to work because it has so many advantages for keeping in-world scripted objects updated.
_____________________
Geometry is music frozen...
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
07-11-2005 03:35
From: someone
I wonder if this idea could actually be made to work because it has so many advantages for keeping in-world scripted objects updated.


Perhaps there is a way...

An AV leaving SL could pass on the code to another AV.

Any scripts not passed on become open source and go into some public repository.
_____________________
Geometry is music frozen...
Zeno Concord
To infinity, and beyond!
Join date: 28 Mar 2005
Posts: 51
07-11-2005 20:09
Thanks for the replies so far. I will repeat just the questions, hoping for some explicit answers :)
  1. Is there any way to update a script (or anything else) in the inventory of an object that is not rezzed?


  2. Will llResetScript or llResetOtherScript cause the script to be active (i.e. Running) if it started out inactive? Or is there another way to accomplish that?


  3. Is the delay associated with certain commands (e.g. llRemoteLoadScriptPin) invoked before the command finishes or after?


  4. Is there any automatic way for an object to get a copy of a rezzed object, or does it require a manual drag and drop by a player?

Zeno Concord
To infinity, and beyond!
Join date: 28 Mar 2005
Posts: 51
07-17-2005 14:30
Well, I was forced to find the answers on my own, I guess. Hope this helps someone else.

From: Zeno Concord
Is there any way to update a script (or anything else) in the inventory of an object that is not rezzed?

Apparently there is no way to update a script in an object that is not rezzed. I don't know about anything else, but I suspect not. This lack up ability to update unrezzed objects, along with the clumsiness of manually editing the contents of objects, motivates one to look for better alternatives.

From: someone
Will llResetScript or llResetOtherScript cause the script to be active (i.e. Running) if it started out inactive? Or is there another way to accomplish that?

I still don't know the answer to this since I didnt need it yet. I suspect the answer is no. The only way I know to activate (or deactivate) a script is to use llRemoteLoadScriptPin.

From: someone
Is the delay associated with certain commands (e.g. llRemoteLoadScriptPin) invoked before the command finishes or after?

The delay happens after the command, fortunately, as I learned by experiment, and then confirmed by the wiki page on delay. Therefore, I can use multiple scripts (in separate prims, in my case) to update many objects in a short time.

From: someone
Is there any automatic way for an object to get a copy of a rezzed object, or does it require a manual drag and drop by a player?

There is no script command to copy another object into the script object's inventory. But an object can give a copy of something in its inventory to another object.
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
07-18-2005 18:07
From: Burke Prefect
I'd personally like the option to make some scripts work like textures. You just pop in a script UUID into the contents of a prim and you can update that script once and it'll work across the entire grid.
I like this idea as well. Problem would be the same as with notecards currently, the UUID would regenerate each time you save the script. Likewise, with textures... if you tweak a texture in PS, you can't re-import to the same UUID of the old texture - even if you were the creator.

I wouldn't mind paying extra for the ability to own a few UUID's to use as I wish. For instance, maybe I pay L$25/week for 10 UUIDs. I can assign the UUIDs to notecards or textures at will.