Jump to content

Detect object editing


MikroPoli
 Share

You are about to reply to a thread that has been inactive for 1019 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

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

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

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

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.

  • Like 2
Link to comment
Share on other sites

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 😎

  • Haha 1
Link to comment
Share on other sites

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 ...
   }
}

 

  • Like 1
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1019 days.

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
 Share

×
×
  • Create New...