Jump to content

Preventing a second rez until the first object is gone.


Xesix
 Share

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

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

Recommended Posts

I have a bowl from which an object is rezzed (from it's inventory) on touch that ends up resting in the bowl.  After the object does it's thing the user touches that object and it self-deletes.  I do not want the bowl to rez another object while the first object is present.  However, the script in the bowl cannot predict when the object will delete (timers will not work since deletion relies on user interaction). 

How can the bowl sense the presence of the object and, while it is present, not rez another object even if touched? 

Currently the bowl senses the presence or absence of the object but I cannot figure out how to use that information to suspend the ability to rez.  A while loop stops reading the sensor.  

I cannot post the script since I'm at work... ssshhhh!

Thank you in advance.

Link to comment
Share on other sites

There are two standard solutions to the problem.  One involves having the rezzed object ping your rezzer periodically to sy "I'm still here!".  As long as the rezzer keeps hearing that ping, it prevents further rezzing. When the ping has failed to arrive after x seconds, the restriction is relaxed.  The other method is to have the rezzer  grab the UUID of a newly-rezzed object with an object_rez event and then run a repeating sensor.  When a no_sensor event is triggered, let the rezzer feel free to rez a new object.

Link to comment
Share on other sites

If you only want it to be rezzed on touch, a sensor or timer isn't required actually.

Since you know tthe UUID of he rezzed prim llGetObjectDetails will return an empty list if UUID is not present.

key gkLastRez;default{    touch_start(integer t)     {       if (llGetObjectDetails(gkLastRez, [OBJECT_POS]) == []) {            llRezAtRoot(llGetInventoryName(INVENTORY_OBJECT, 0), llGetPos()+<1.0,0.0,0.0>, ZERO_VECTOR, ZERO_ROTATION, 0);        }    }        object_rez(key id)     {        gkLastRez = id;    }}

 The same check can be done within a timer of course., if auto rezzing is wanted.

  • Like 1
Link to comment
Share on other sites

An alternative method would be for the object, before it dies, to tell the rezzer it's done its thing and is about to self-delete.

You could generate a random channel for the the rezzer to listen on, and the object to use, each time you are about to rez an object,, and pass that channel to the rezzed object as the final argument in llRezAtRoot().

I'm not saying this way's better than the others suggested.   I'm just mentioning it as a possiblility.

Link to comment
Share on other sites

arton!  Your script is genius!  It worked perfectly!  Thank you very very much....

All of you are so helpful.   I really appreciate it.

ども ありがとう

みさき きた

Thank you!

 

Link to comment
Share on other sites

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