Jump to content

Rezzing objects for a dedicated time


Tyrak Gyranaut
 Share

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

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

Recommended Posts

Hello, 

planning to do something like a Restaurant. Imagine this: I'll do different poses around a table and want visitors to be able to select different dishes by clicking on an object (this can be a fork or a empty bowl or whatever. I could make those objects temp, but that means its vanishing after 60 sec, as far as I know. 

Is there a script that rezzes objects viaa blue  menu for a longer time, like 10 ´min or (even better: when the person, that requested the Item is leaving the sim)? 

Any ideas ??  and ... I'm not a scripter ! 

Thank you in advance 

Edited by Tyrak Gyranaut
Link to comment
Share on other sites

30 minutes ago, Rolig Loon said:

Just put a script into each rezzed object that kills it a specified time after it is rezzed.

default
{   on_rez(integer i)
    {   llSetTimerEvent(600.0); // die after 600 seconds == 10 minutes
    }
    timer()
    {   llDie();
    }
}

 

2 hours ago, Tyrak Gyranaut said:

when the person, that requested the Item is leaving the sim

To do that, the rezzing script would need to tell the rezzed object who requested it, which would require changes to the rezzing script. Alternatively, die if nobody is nearby:

float distance = 9.0; // how far away before de-rez. (in linden-meters)
default
{   on_rez(integer i)
    {   llSensorRepeat("","",AGENT,distance,PI,20.0); // check every 20 seconds.
    }
    no_sensor()
    {   llDie();
    }
}

 

Link to comment
Share on other sites

  • 2 weeks later...
On 2/8/2024 at 4:04 PM, Quistess Alpha said:
default
{   on_rez(integer i)
    {   llSetTimerEvent(600.0); // die after 600 seconds == 10 minutes
    }
    timer()
    {   llDie();
    }
}

 

To do that, the rezzing script would need to tell the rezzed object who requested it, which would require changes to the rezzing script. Alternatively, die if nobody is nearby:

float distance = 9.0; // how far away before de-rez. (in linden-meters)
default
{   on_rez(integer i)
    {   llSensorRepeat("","",AGENT,distance,PI,20.0); // check every 20 seconds.
    }
    no_sensor()
    {   llDie();
    }
}

 


Building on this, you can also have the rezzer determine the derez time, so that you can, say, have a full plate of salmon last longer than a cup of espresso.

 

default
{
  on_rez(integer piParam)
  {
    llSetTimerEvent((float)piParam); // die after amount of seconds passed by the rezzer
  }
  
  timer()
  {
    llDie();
  }
}

 

You would then need to pass the time in seconds into the llRezObject() function in the rezzer. You can make a function as below to simplify it a little. piRezTime is then the time in seconds that gets passed to the rezzed object in piParam  parameter the on_rez(integer piParam) event.

 

RezObject(string psDish, vector pvPos, rotation prRot, integer piRezTime)
{
  llRezObject(psDish, pvPos, ZERO_VECTOR, prRot, piRezTime);
}

Edit: small documentation fix

Edited by Bugs Larnia
  • Like 1
Link to comment
Share on other sites

I'd start with  https://avsitter.github.io/avsitter2_prop.html

AVsitter props can be used without the multi-sitting/animation system, but if the objective is to have them disappear when the sitter stands up, it's probably easiest to just use the seating stuff too.

Setting it up based on examples isn't exactly scripting but it's a bit of a discipline unto itself.

(The source for the AVsitter scripts themselves is all free on github or grab a copy from somebody who has one already.)

Link to comment
Share on other sites

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