Sitting on Temp Rez Object

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

Sitting on Temp Rez Object

Post 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?
Graham Mills
Posts: 1314
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 1134 times
Been thanked: 1141 times

Re: Sitting on Temp Rez Object

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

Re: Sitting on Temp Rez Object

Post 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();
        }
    }
}
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 »

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: 1341
Joined: Sat Oct 26, 2013 3:25 am
Has thanked: 961 times
Been thanked: 1581 times
Contact:

Re: Sitting on Temp Rez Object

Post by Shandon Loring »

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

Re: Sitting on Temp Rez Object

Post 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. :)
These users thanked the author Koshari Mahana for the post (total 2):
Ilan TochnerShandon Loring
Image
VISIT FOUR WINDS ON THE MARKET
VISIT FOUR WINDS INWORLD: hop://grid.kitely.com:8002/Coopersville/909/907/21
User avatar
Shandon Loring
Posts: 1341
Joined: Sat Oct 26, 2013 3:25 am
Has thanked: 961 times
Been thanked: 1581 times
Contact:

Re: Sitting on Temp Rez Object

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

Re: Sitting on Temp Rez Object

Post 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!
These users thanked the author Koshari Mahana for the post:
Michael Timeless
Image
VISIT FOUR WINDS ON THE MARKET
VISIT FOUR WINDS INWORLD: hop://grid.kitely.com:8002/Coopersville/909/907/21
Post Reply