Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Return Script

SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
07-27-2009 10:12
I'm looking to build a script that will return my RC car to its starting position after it has been driven. If some one wants to drive the thing around and they just leave it sitting in some random place I would like the script to kill it after a minuet or so and re-rez it in its rightful place. I'm not sure were to start cause I don't know the scripting lingo. Could someone help point me in the right direction please? Thanks!
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
07-27-2009 10:16
If it's something that people sit in, the easiest thing to do would be to set to to be a temp object. That way, it will get deleted as soon as they stand up. Or if they wander into no script land and leave it there, you don't have to worry about the script stopping.

At the base, have a button (or something) that people can push to rez a new one.
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
07-27-2009 10:19
Well you don't sit in it its an RC car.
Destiny Niles
Registered User
Join date: 23 Aug 2006
Posts: 949
07-27-2009 10:22
You can put in a kill timer. And use a rezzer to make a new one on-demand. Or even have the rezzer send out a region wide kill command when a new car is rezzed.
SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
07-27-2009 10:33
what if I use a kill timer that don't engage until the vehicle is left alone for 1 minuet. Then I use a rezzer to look for it at regular intervals and it it don't find it it rezzes a new one? Would this be possible?
Destiny Niles
Registered User
Join date: 23 Aug 2006
Posts: 949
07-27-2009 10:41
Yes, using llGetObjectDetails. The rezzer will get the object key when it's rezzed in the object_rez event.
SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
07-27-2009 10:47
OK I don't really understand what you meant by that. Also I would like to know how I could trigger the kill script. I don't know how to tell the kill script to start because I don't know how to let it know that the RC car has been left alone for one minuet.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
07-27-2009 10:55
Why not just script the changed event so that it starts a 20 second timer (llSetTimerEvent(20.0) ) when the driver stands up? Then script your timer event to send a message back to the parent rezzer telling it to rez a new car, and then say llDie(). That way, the rezzer doesn't have to do anything but listen for a goodbye message from your car just before it expires. If your car will always be in the same sim as your rezzer, send the message by shouting on a negative channel. If it's somewhere else, try an e-Mail maybe.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
07-27-2009 11:05
OK but again this is a Radio Controlled car. You do not sit in it you drive it by touching it and letting it take over you movement controls. The only way I know of to stop driving it is to touch it again and don't let the controls take over.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
07-27-2009 12:49
OK, then, just set the timer to some comfortably long period like a half hour, and then send the goodbye message and commit suicide. If you want to get fancy, you could throw up a dialog message first to warn the driver that the car is about to die. Give the driver an option to extend the play period for another half hour or click a "Done" button to kill the car immediately.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
jeaniesing Trilling
Loves to animate & script
Join date: 21 Oct 2006
Posts: 61
07-27-2009 13:01
how is the car controlled? Using the up/down/right/left keys? set the time as soon as someone starts controling the car llSetTimerEvent(120); and then reset it everytime someone uses a key in the control event with the same command... if they don;t press any key for 2 minutes.. the timer event can send a message to the car that triggers the llDie command in the car
_____________________
Pinastri/113/171/30
Destiny Niles
Registered User
Join date: 23 Aug 2006
Posts: 949
07-27-2009 14:12
If you want an example of a craft rezzer and delete system, the Lindens have one @ http://slurl.com/secondlife/Morris/254/201/33. It's called Bumper Boat Blast, the creator is Lee Linden, there is a box there will the objects and scripts in them full permissions.
Dekka Raymaker
thinking very hard
Join date: 4 Feb 2007
Posts: 3,898
07-28-2009 01:55
From: Destiny Niles
If you want an example of a craft rezzer and delete system, the Lindens have one @ http://slurl.com/secondlife/Morris/254/201/33. It's called Bumper Boat Blast, the creator is Lee Linden, there is a box there will the objects and scripts in them full permissions.

I went looked everywhere in the area, the box seems to have gone, I would like this if anyone has one they can send to me in world, thanks. :)
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
07-28-2009 02:38
I think the surest thing is a timer in the car itself, set to some die-off interval every time it receives a command to move around. If it escapes the range of the controller, it would still llDie() instead of cluttering a distant sim somewhere. If desired, it might try to send a dying gasp to the controller, giving its location, etc., and maybe waiting some additional interval to hear back from the controller; that all might use some out-of-band llEmail() communications.

[ETA: Of course, if the poor thing ventures into somebody's no-script parcel, all bets are off. Personally, I think they deserve the clutter they create with that parcel setting, but in theory the car could try to detect that setting of parcels in its path ahead, halt, and fuss about it to the controller.]
SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
07-28-2009 05:35
couldn't I just tell it to go to a certain position and orientation after some one leaves it alone for a minuet? Why would I have to go through all the trouble of killing it and re-rezzing it?
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
07-28-2009 06:03
Yes, but that's not what your original post said you wanted to do. You told us you wanted to kill it and re-rez after a "minuet." Nobody actually got around to attacking the dance part of the question, but we've been exploring ways to do what you asked .... kill and resurrect. :)
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
07-28-2009 06:06
Sorry about that. I'm not a scripter so I should have made it clear that I don't know what the best way of doing things are. All I want this thing to do is return were it belongs when people are done playing with it.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
07-28-2009 10:09
the option for return to position instead of die would be to include a warppos like function that's trggerred in place of the die...

although the die may actually suit you better if the RC vehicle gets stuck becase of variaous things like no script land
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Paladin Pinion
The other one of 10
Join date: 3 Aug 2007
Posts: 191
07-29-2009 12:37
From: Void Singer
although the die may actually suit you better if the RC vehicle gets stuck becase of variaous things like no script land


/me emerges from lurker mode... If the car is in no-script land, will the timer and die command still work?
_____________________
Mote Particle Script Generator - easier and faster than any HUD
Also: Paladin's Sunbeam. Up at dawn, gone by dusk, day and night sounds, fully configurable
See more at: www.paladinpinion.com
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
07-29-2009 12:52
From: Paladin Pinion
/me emerges from lurker mode... If the car is in no-script land, will the timer and die command still work?

Nope, but changing it temp on rez once someone is sitting works.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
07-29-2009 13:11
Yeah, but the OP keeps reminding us this is a radio controlled car, not a sit-in vehicle. That actually makes the answer simpler. The driver can't leave the car on a no script sim because it won't go there in the first place. A timer event with a llDie in it should work fine.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
07-29-2009 13:14
From: Rolig Loon
Yeah, but the OP keeps reminding us this is a radio controlled car, not a sit-in vehicle. That actually makes the answer simpler. The driver can't leave the car on a no script sim because it won't go there in the first place. A timer event with a llDie in it should work fine.

oooops!
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Destiny Niles
Registered User
Join date: 23 Aug 2006
Posts: 949
07-29-2009 13:15
You could drive a car into a no script zone, when you get there it's too late to back up. Then it would stop, but you can put checks in place and have a buffer around it to check of no script zones before it enters it.