MikroPoli Posted August 28, 2021 Share Posted August 28, 2021 I have a script which uses the object description llGetObjectDesc( ) as a parameter in the script. I would like to detect if the user edits the object and changes the description. I can't find an event that would do that. Any ideas. Thanks. Link to comment Share on other sites More sharing options...
Wulfie Reanimator Posted August 28, 2021 Share Posted August 28, 2021 All object-change related events are listed here, which is to say, no event triggers when the description is changed. You'd have to use a timer or some other mechanism (touch, for example) for the script to check the description. Link to comment Share on other sites More sharing options...
Fritigern Gothly Posted August 28, 2021 Share Posted August 28, 2021 This should work string gDesc; // We keep the global variable for use in the entire script default { state_entry() { gDesc = llGetObjectDesc(); // Store the current value of the object's description into this global. llSetTimerEvent(30); // Every 30 seconds, change as needed } timer() { if(llGetObjectDesc() != gDesc) { llOwnerSay("Description changed!"); gDesc = llGetObjectDesc(); // Update the value of the globalk variable so can compare again later; } } } Link to comment Share on other sites More sharing options...
Nova Convair Posted August 29, 2021 Share Posted August 29, 2021 Hmmm .. every 30 seconds means about 20000 events per week. If I have an object that is touched or used maybe 20 times per week I use the triggering event instead of a timer. Depends all on the circumstances. Link to comment Share on other sites More sharing options...
bobsknief Orsini Posted August 29, 2021 Share Posted August 29, 2021 Other option is to skip the timer and get the data from the description when you need it (maybe add it to a function). All depends on what your script does do. 1 Link to comment Share on other sites More sharing options...
Fritigern Gothly Posted August 29, 2021 Share Posted August 29, 2021 52 minutes ago, Nova Convair said: Hmmm .. every 30 seconds means about 20000 events per week. If I have an object that is touched or used maybe 20 times per week I use the triggering event instead of a timer. Depends all on the circumstances. That is not what the OP is asking for. They said "I would like to detect if the user edits the object and changes the description.", they say nothing about touching the object. Now, if you look up the changed() event, you will notice that there is no CHANGED_DESCRIPTION trigger so this is the closest equivalent and with a very conservative timer too. Link to comment Share on other sites More sharing options...
Quistess Alpha Posted August 29, 2021 Share Posted August 29, 2021 2 minutes ago, Fritigern Gothly said: That is not what the OP is asking for. They said "I would like to detect if the user edits the object and changes the description.", they say nothing about touching the object. Now, if you look up the changed() event, you will notice that there is no CHANGED_DESCRIPTION trigger so this is the closest equivalent and with a very conservative timer too. I think the point though, is that for every "Can I do X?" there's an implied "Should I do X?" and "What are the costs/benefits of doing X?". Pretty much anything you can imagine is /possible/ in LSL, but some things are unfortunately more computationally expensive than they really ought to be. and even if a 10~30 second timer isn't really that bad on its own, continuous inefficiencies in things that are permanently rezzed in-world should really be avoided if reasonably possible. 2 Link to comment Share on other sites More sharing options...
Nova Convair Posted August 29, 2021 Share Posted August 29, 2021 4 hours ago, Fritigern Gothly said: That is not what the OP is asking for. They said "I would like to detect if the user edits the object and changes the description.", they say nothing about touching the object. Now, if you look up the changed() event, you will notice that there is no CHANGED_DESCRIPTION trigger so this is the closest equivalent and with a very conservative timer too. I don't answer what the OP asks for I answer what I think makes sense and I really don't care if you like that 😎 1 Link to comment Share on other sites More sharing options...
Mollymews Posted August 30, 2021 Share Posted August 30, 2021 15 hours ago, Fritigern Gothly said: if you look up the changed() event, you will notice that there is no CHANGED_DESCRIPTION trigger i would like if Linden added a CHANGED_OBJECT, which basically fires every time a change is made to the object. It may have to be throttled tho, which I think would be acceptable if we had it then things like detecting changes would be a whole lot simpler. Example: if (changed & CHANGE_OBJECT) { string desc = llGetObjectDesc(); if (desc == gDesc) { ... do something ... } else { ... do something else ... } } 1 Link to comment Share on other sites More sharing options...
Lucia Nightfire Posted August 30, 2021 Share Posted August 30, 2021 5 hours ago, Mollymews said: i would like if Linden added a CHANGED_OBJECT, which basically fires every time a change is made to the object. It may have to be throttled tho, which I think would be acceptable I would rather have a function that can give the user the option of turning on/off what triggers the changed() event instead of turning on triggering with parameters that didn't used to trigger it before, which today could lead to a crap ton more region script eps, possibly event queues getting maxed out and content breaking. Something like: llSetChangedEventTriggeringParams(link_number, [CHANGED_NAME, FALSE, CHANGED_DESC, FALSE, CHANGED_COLOR, FALSE, CHANGED_TEXTURE, FALSE, CHANGED_INVENTORY]); I've longed for a way to not trigger changed() events from color or texture changes without first doing script state juggling. 1 Link to comment Share on other sites More sharing options...
Mollymews Posted August 30, 2021 Share Posted August 30, 2021 33 minutes ago, Lucia Nightfire said: Something like: llSetChangedEventTriggeringParams(link_number, [CHANGED_NAME, FALSE, CHANGED_DESC, FALSE, CHANGED_COLOR, FALSE, CHANGED_TEXTURE, FALSE, CHANGED_INVENTORY]); i like this quite a lot Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now