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.