Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: Auto-Die if left on public land

Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
06-23-2003 22:50
Heres a little thing I rigged up while thinking about Ope's predicament (in General Discussion forms).

CODE

integer gCount;
integer gDieAt = 999; //tunable
float gInterval = 10; //seconds (also tunable)

default
{
state_entry()
{
llSetTimerEvent(gInterval);
}
timer()
{
if(llGetLandOwnerAt(llGetPos()) == NULL_KEY)
{
if(gCount >= gDieAt) llDie();
gCount ++;
}
else
{
gCount = 0;
}
}
}



This code will check every ten seconds what the land owner is at the current object's position. If the land is public (land owner = NULL_KEY), it adds one to count. If it isnt, it resets the count (just incase the object is a vehicle that just moved over some public land that one instance.)

created by christopher omega

EDIT: Xerahn VonLenard, ty so much... Adding >= to the if(gCount >= gDieAt) is definately more stable then if(gCount == gDieAt)... just in case the sim hiccups. Ty so much for the input.
_____________________
October 3rd is the Day Against DRM (Digital Restrictions Management), learn more at http://www.defectivebydesign.org/what_is_drm
Xerahn VonLenard
Registered User
Join date: 26 May 2003
Posts: 7
Original Thread
07-01-2003 11:17
/15/bc/3328/1.html
ne


You're most welcome, Christopher :D