Jump to content

Timestamp reader


ChinRey
 Share

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

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

Recommended Posts

I thought this little script may be useful for others too. Drop it into an item and it will tell you the Object Creation Time before it softly and silently vanishes away. Please share it freely with anybody who may need it.

 

default{
    state_entry(){
        llOwnerSay((string) llGetObjectDetails(llGetKey(),[36]));
        llRemoveInventory(llGetScriptName());
    }
}

If you wonder what the point is, the Object Creation Time is, it's a small (max. 27 byte) string that has turned out to be a very useful identifier, identical for all modified and unmodified copies of the same object but different from all other objects with a different origin. For prims and sculpts it is set when the original is created from the build menu, for meshes it's the moment the mesh is uploaded.

Its most obvious use is when you want a script to work for one item and all copies of that specific item only.

To use the Object Creation Time as an identifier in a script, add something like:

touch_start(integer total_number){
	if((string) llGetObjectDetails(llGetKey(),[36])=="(insert Object Creation Time here)"){
		llWhateverYouWantTheScriptToDoWhenTheObjectIsTouched();
	}
}

 

Edited by ChinRey
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Creation time is also good for identifying mesh links in a mod linkset if the end user(s) modifies names, descriptions, settext or adds/removes links or disturbs the original link order.

A texture applier or link message script can still be made to work flawlessly in such a hectic/modular environment.

  • Thanks 1
Link to comment
Share on other sites

Please use object flag OBJECT_CREATION_TIME instead of numeric value. Values could change in the future,  the object flag would be the same defined in a header file - making a script work without problems for SL version 4.0 year 2028 :D Further, the defined object flags are clearer and more easy to read/understand

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2364 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...