Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Rez on Timer....

Shipper Sodwind
Registered User
Join date: 25 Nov 2006
Posts: 132
07-19-2007 12:23
Possibly the wrong direction but.....

I am trying to rez an object, and have it rez flat on a rock, that can be taken by an AV. Rez the same object on a timer, one hour or so, which stays until taken. And so on...

This is what I have;

vector velocity;
integer shot = FALSE;
integer fade = FALSE;
float alpha = 1.0;

default
{
state_entry()
{
llSetStatus(STATUS_DIE_AT_EDGE, TRUE);
}

on_rez(integer start_param)
{
llSetStatus(STATUS_DIE_AT_EDGE, TRUE);
llSetBuoyancy(1.0);
velocity = llGetVel();
float vmag;
vmag = llVecMag(velocity);
if (vmag > 0.1) shot = TRUE;
llSetTimerEvent(0.0); (((I thought this is where the rez time was set?)))
}

touch_start(integer num)
{
if (llDetectedType(0) & AGENT)
{
integer i;
for ( i=0; i<num; i++ ) {

llRezObject( "My Object", llGetPos()+<0,0,0.5>, <0,0,0>, <0,0,0,1>, i );

integer i;
}}
}
}

timer()
{
if (!fade)
{
if (shot)
{
llDie();
}
}
else
{
llSetAlpha(alpha, -1);
alpha = alpha * 0.95;
if (alpha < 0.1)
{
llDie();
}
}
}
}

Sort of works, on touch, but I cannot work out the timer and the object is vertical.

Hmmm, OK I'm new. Any help apreciated.
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
07-19-2007 12:56
Well, the llSetTimerEvent(0.0); you have marked with (( )) in the on_rez event would merely serve to turn off the timer. it's actually a good practice if you have a rezzing object to have it turn off like this so you have more control on it.

I think there needs to be some more done in your code (I suck at reading them without the BBC formatting lol), but to answer the basic side of your question, you just need to add another llSetTimerEvent(0.0); and change the 0.0 to how often you want it to run whatever it is you have in the timer event