Sitting on Temp Rez Object

General discussions related to content creation
Post Reply
User avatar
Shandon Loring
Posts: 730
Joined: Sat Oct 26, 2013 3:25 am
Has thanked: 501 times
Been thanked: 791 times
Contact:

Sitting on Temp Rez Object

Post by Shandon Loring » Tue Apr 07, 2015 4:09 am

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?
Graham Mills
Posts: 974
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 575 times
Been thanked: 731 times

Re: Sitting on Temp Rez Object

Post by Graham Mills » Tue Apr 07, 2015 5:17 am

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.
These users thanked the author Graham Mills for the post:
Shandon Loring
Graham Mills
Posts: 974
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 575 times
Been thanked: 731 times

Re: Sitting on Temp Rez Object

Post by Graham Mills » Tue Apr 07, 2015 6:24 am

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();
        }
    }
}
These users thanked the author Graham Mills for the post:
Shandon Loring
User avatar
Keith Selmes
Posts: 175
Joined: Fri Jan 04, 2013 1:13 pm
Location: Devon, UK
Has thanked: 174 times
Been thanked: 153 times
Contact:

Re: Sitting on Temp Rez Object

Post by Keith Selmes » Tue Apr 07, 2015 9:43 am

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();
    }
   
}
These users thanked the author Keith Selmes for the post (total 3):
Graham MillsSelby EvansShandon Loring
User avatar
Shandon Loring
Posts: 730
Joined: Sat Oct 26, 2013 3:25 am
Has thanked: 501 times
Been thanked: 791 times
Contact:

Re: Sitting on Temp Rez Object

Post by Shandon Loring » Wed Apr 08, 2015 2:01 am

Perfect! Thanks guys!! Exactly what was needed!
User avatar
Koshari Mahana
Posts: 91
Joined: Fri Feb 06, 2015 8:14 am
Has thanked: 36 times
Been thanked: 116 times
Contact:

Re: Sitting on Temp Rez Object

Post by Koshari Mahana » Wed Aug 01, 2018 9:00 pm

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. :)
These users thanked the author Koshari Mahana for the post (total 2):
Ilan TochnerShandon Loring
User avatar
Shandon Loring
Posts: 730
Joined: Sat Oct 26, 2013 3:25 am
Has thanked: 501 times
Been thanked: 791 times
Contact:

Re: Sitting on Temp Rez Object

Post by Shandon Loring » Thu Aug 02, 2018 2:49 am

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...
These users thanked the author Shandon Loring for the post (total 5):
Macphisto AngelusKoshari MahanaIlan TochnerAlexina ProctorMichael Timeless
User avatar
Koshari Mahana
Posts: 91
Joined: Fri Feb 06, 2015 8:14 am
Has thanked: 36 times
Been thanked: 116 times
Contact:

Re: Sitting on Temp Rez Object

Post by Koshari Mahana » Thu Aug 02, 2018 4:44 am

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!
These users thanked the author Koshari Mahana for the post:
Michael Timeless
Post Reply