Page 1 of 1

Sitting on Temp Rez Object

Posted: Tue Apr 07, 2015 4:09 am
by Shandon Loring
Perhaps someone can direct me the right way to do this in Opensim?
In SL, an object that is temp-rez will remain as long as an AVie is sitting on it, and promptly disappears once the AVie stands up.
I've noted in Kitely that the object disappears after 60 seconds even if someone is sitting on it.

I'm wanting to create a little temp-rez boat I can leave out, so that when someone wanders off with it and leaves it somewhere on the sim it will self-delete when then they stand up.

Suggestions?

Re: Sitting on Temp Rez Object

Posted: Tue Apr 07, 2015 5:17 am
by Graham Mills
Probably add a script similar to the third one on http://wiki.secondlife.com/wiki/Changed and delete the prim using llDie -- not at PC so not able to test.

Re: Sitting on Temp Rez Object

Posted: Tue Apr 07, 2015 6:24 am
by Graham Mills
This modification seems to work.

Code: Select all

default
{
    changed(integer change)
    {
        if(change & CHANGED_LINK)
        {
            if(llGetObjectPrimCount(llGetKey()) < (llGetNumberOfPrims()))
            {
               //being sat on;
            }
            else llDie();
        }
    }
}

Re: Sitting on Temp Rez Object

Posted: Tue Apr 07, 2015 9:43 am
by Keith Selmes
I use a timer for vehicles.
Without knowing about Temp Rez, I had chosen 60 seconds anyway as it seems about right.
Gives you time to have a look before getting aboard, and time to get clear or get back on when leaving, before it disappears and dumps you in the sea or whatever.
You can change the delay of course.
Adding this to Graham's code, it looks something like this ,which I just tested:

Code: Select all

default

{
    state_entry()
        {
            llSetTimerEvent (60); // it'll die if not used
        }
        
    changed(integer change)
        {
            if(change & CHANGED_LINK)
                {
                    if(llGetObjectPrimCount(llGetKey()) < (llGetNumberOfPrims()))
                        {
                            //being sat on;
                            llSetTimerEvent(0);    //so cancel timer    
                        }
                    else llSetTimerEvent(60);       // standing up
                }
        }
        
    timer()
    {
        llDie();
    }
   
}

Re: Sitting on Temp Rez Object

Posted: Wed Apr 08, 2015 2:01 am
by Shandon Loring
Perfect! Thanks guys!! Exactly what was needed!

Re: Sitting on Temp Rez Object

Posted: Wed Aug 01, 2018 9:00 pm
by Koshari Mahana
I know this thread is 5 years old but I'm hoping that someone can help me. I tried both of these scripts and neither worked for me but I'm using bulletsim so that may be the reason.

Keith, I don't know if you'll see this (if not I'll send you a pm) but I know that you were able to get it to work because your planes rez and disappear quite nicely on my region. I hope you can help me with whatever tweek you found.

I'm trying to have boats to temp rez. I'm sure it works just the same but for some reasons these scripts don't work. The first one can be saved but doesn't make the boat vanish and the 2nd one is giving an error message at "state entry".

Thanks to anyone who can help me out with this. :)

Re: Sitting on Temp Rez Object

Posted: Thu Aug 02, 2018 2:49 am
by Shandon Loring
Hi Koshari,
We are using similar tech on our temp rez boats on Celticworld... please feel free to check them out and if you think it may work for you I'll be happy to get you an FP copy...
The boats are scattered in the sea about the property.. below Stonehenge and in front of Newgrange for sure will have a couple...

Re: Sitting on Temp Rez Object

Posted: Thu Aug 02, 2018 4:44 am
by Koshari Mahana
Shandon, Thank you so much! It works perfectly and it was so easy, all I had to do is drop your "autodelete" script into the boat, I didn't have to mess with adding the code directly into the boat script. So, now you know that the autodelete script you sent me works in both bulletsim and in ODE. :) I'll leave it up to you if you want to post it here or not.

Thanks again for all of the time you took to get me the script!