Jump to content

Derezzing an object..


Jenny Collazo
 Share

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

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

Recommended Posts

So here's what I have so far..

default
{
    touch_start(integer total_number)
    {
        llRezObject("Pool Water", llGetPos() + < 4.14, 6.5, 1.06 >, ZERO_VECTOR, ZERO_ROTATION, 42);
    }

}

What I'd like to do is add in the object derezzes when an avatar clicks again.. rezz, derezz, rezz, derezz kinda thing...

any help would be greatly appreciated...thanks :)

Link to comment
Share on other sites

a script inside an object can t delete an another object .

But a script inside an object can delete explicetly the object who contains it : the function is llDie .

llDie http://wiki.secondlife.com/wiki/Lldie

 

There is an exception : if you have manager rights , you may  return an object . But it will fill quickly your inventory

( the objects are saved as copy in your inventory  )

llReturnObjectsByID http://wiki.secondlife.com/wiki/LlReturnObjectsByID

 

Note you may too create your rezzed object as TEMP object before to put it in the content of the rezzer object : but it will be deleted after some time ( generally one minute after you have set it at the temp ; rezzing or derezzing the temp object dosn t change the lifetime of the temp object  . it won t restart the lifeteime at 1 minute if you rez - unrez - rez  )

But it s not explicetly

 

If you have not the manager rights or if you don t want use it , you will need that the rezzer  sends an event who will be recived by the rezzed object . The event in the rezzed object will call lldie to delete itself.

Generally , the kind of events are messages , but it can be something else

 

Link to comment
Share on other sites

I'm not sure I understand what you're trying to do. If you derez a thing, there's nothing to click to bring it back.

Ohjiro's solution makes more sense. The thing is always there, but it switches from opaque to transparent and back again. Even with this solution, people have to know where the invisible thing is to click on it.

 

Link to comment
Share on other sites

It seems likely there's a "switch" somewhere that is supposed to fill an empty pool, and empty it if it's already full.

This is way more difficult if the pool water is no-mod. Then one couldn't put a script inside, nor make it temp-on-rez, nor manipulate its transparency; I think the only option in that case would be the Inventory-cluttering approach Miranda mentioned of forcibly returning the object. Let's hope that's not the situation.

If instead the water object is modifiable, then the various suggested options will work, but I'll just mention: If there aren't already other scripts in the water, and if the water will stay rezzed for more than a few minutes before being de-rezzed, then it may be worth using llRemoteLoadScriptPin to push an object-killing script into the water when it's supposed to die. It's no big deal, but that approach reduces by one the sim's running script count for however long the water stays rezzed. It's a moderately heavy-weight operation to load the script into the object -- but then, the sim does some work to rez an already-scripted object, too.

Link to comment
Share on other sites

Ok, maybe I am missing something here, but this can be easily done as follows:

 

1. Add an integer in you rezzer script that remembers if pool whater is rezzed (integer = 1) or not (integer = 0).

2. When rezzer gets touched do: if (poolWater == 0) then rez object; if (poolWater == 1) then speak on channel n;

3. Put a script in the object "Pool Water" that listens at channel n;

4. When "Pool Water" receives the message from the rezzer, derrez (llDie);

 

EDIT: @ Jenny: this might look complicated to a beginner, but it is a great way to learn working with global variables and how to communicate between two scripts in two different objects. If you need more help to get this done, let us know.

Link to comment
Share on other sites

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