Can a script modify a notecard?
|
|
Montavious Peccable
Registered User
Join date: 27 Mar 2007
Posts: 1
|
04-10-2007 20:57
I know a script can read a notecard, but can it write or modify one?
|
|
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
|
04-10-2007 21:07
no, notecards are read only
|
|
Matthew Dowd
Registered User
Join date: 30 Jan 2007
Posts: 1,046
|
04-11-2007 01:27
Depending on your application a follow up question might be how can a script store permanent information which can survive resets etc. given you can't write this to a notecard.
For small pieces of information you can store it on the prim itself, in its name or description. For safety it is probably best to create a link in a hidden prim (or use an existing non-root prim) to store this, and communicate via link messages.
For larger information, you need to store it offworld and use the http functions.
|
|
Nexus Laguna
Registered User
Join date: 20 Dec 2006
Posts: 40
|
04-11-2007 03:30
From: Matthew Dowd Depending on your application a follow up question might be how can a script store permanent information which can survive resets etc. given you can't write this to a notecard.
For small pieces of information you can store it on the prim itself, in its name or description. For safety it is probably best to create a link in a hidden prim (or use an existing non-root prim) to store this, and communicate via link messages.
For larger information, you need to store it offworld and use the http functions. Well, scripts tend to survive resets as their variable values and states are recorded on the server and saved with any backups made. When a server is reset those backup values are restored. I know this happens as I have a script permanently running and has survived multiple resets with no offworld or prim description communication. EDIT: Decided to add that I am not saying you shouldn't try to store off world or in descriptions. These are good fall backs, but you should really ask yourself if it is worth the expense of creating these permanent storage features if the resets don't seem to affect it negatively too often.
|
|
Hanumi Takakura
Registered User
Join date: 24 May 2006
Posts: 57
|
04-11-2007 03:31
Hello. Sorry to hijack this thread. I'm having a similar issue. In my case, I need the object and script to be no mod. I tried putting a mod note on the object but well, you can't open anything inside a non mod object. My closest solution would be to make another, mod object and place the note there with the settings people can modify. Since my object already has a listen version of the settings, all the new object would do is say the settings over the channel for the no mod item to get. Any other ideas?
|
|
Nexus Laguna
Registered User
Join date: 20 Dec 2006
Posts: 40
|
04-11-2007 03:38
From: Hanumi Takakura Hello. Sorry to hijack this thread. I'm having a similar issue. In my case, I need the object and script to be no mod. I tried putting a mod note on the object but well, you can't open anything inside a non mod object. My closest solution would be to make another, mod object and place the note there with the settings people can modify. Since my object already has a listen version of the settings, all the new object would do is say the settings over the channel for the no mod item to get. Any other ideas? Do you really need the object to be no mod? If it is an object that is simply a vessel for the script, i.e. the object prim itslef doesnt really do anything, who cares if people can change it as long as your script is protected. I had a similar situation with one of my products I made and tried to make it all non-mod. I decided I wasn't really bothered with it being mod or not, as long as my script was protected and I now have customers sending me feedback that they like it being mod 
|
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
04-11-2007 09:06
From: Nexus Laguna Well, scripts tend to survive resets as their variable values and states are recorded on the server and saved with any backups made. When a server is reset those backup values are restored. I know this happens as I have a script permanently running and has survived multiple resets with no offworld or prim description communication. I think he might have meant *script* resets, in which case global variables are not persistent across. As for the rest, I've had prim servers disappear without a trace so, if the information is important, back it up somewhere else, either in another prim (or three) in other sims, or off-world via llHTTPRequest or llEmail.
|
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
04-11-2007 09:10
From: Hanumi Takakura Hello. Sorry to hijack this thread. I'm having a similar issue. In my case, I need the object and script to be no mod. I tried putting a mod note on the object but well, you can't open anything inside a non mod object. My closest solution would be to make another, mod object and place the note there with the settings people can modify. Since my object already has a listen version of the settings, all the new object would do is say the settings over the channel for the no mod item to get. Any other ideas? For your specific application, no, you can't make it to where the object is no-mod, and the contents (the notecard inside) are still modifiable. You have to either use the external notecard/config reader, or use another method which does not involve modifying the object (including its name/description, except by the script inside) or its contents. It *might* be possible to use llAllowInventoryDrop(TRUE) and the changed() event, but I don't think that will work, and may be subject to other people dropping config notecards on the object as well.
|
|
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
|
04-11-2007 09:59
From: Talarus Luan It *might* be possible to use llAllowInventoryDrop(TRUE) and the changed() event, but I don't think that will work, and may be subject to other people dropping config notecards on the object as well. I just tested this out, and llAllowInventoryDrop does work with no-mod objects. As for limiting who can drop, llAllowInventoryDrop could be enabled only when directed by the owner, only for a short period ( < 1min. ) or until an object is dropped into it (whichever comes first), and only notecards created by its owner would be processed.
|