Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Rez objects but not on top of each other script

Kathmandu Gilman
Fearful Symmetry Baby!
Join date: 21 May 2004
Posts: 1,418
01-04-2006 09:20
I need a script that doesn't allow more than one object to be rezzed within the 10m limit at a time or doesn't pile new objects on top of the first one. I try to rez a jetski with the script I have and it works just fine but if I hit the rez twice accidentally 1. I can't tell because it is in the exact same place 2. If I try to ride this I will crash the sim its in. Can anyone help or point me in the right direction to where I can get something like this?
_____________________
It may be true that the squeaky wheel gets the grease but it is also true that the squeaky wheel gets replaced at the first critical maintenance opportunity.
Bounder Jimenez
programmer/designer
Join date: 12 Oct 2005
Posts: 45
01-04-2006 10:12
CODE

default
{
touch_start(integer n)
{
// delete or comment the next line out if you want anyone to click it.
// with it here, only the owner can click it
if(llDetectedKey(0)==llGetOwner())
// search for "object" (replace with name) in the 10 meters around us
// it must have a script in it
llSensor("object",NULL_KEY,ACTIVE|PASSIVE|SCRIPTED,10.0,PI);
}
no_sensor()
{
// llRezAtRoot better for linked items
llRezAtRoot("object",llGetPos(),ZERO_VECTOR,ZERO_ROTATION,1);
}
sensor(integer n)
{
llOwnerSay("already here");
}
object_rez(key id)
{
llOwnerSay("its been done");
}
}


or something close :)

I added a line that can be commented out that allows only the ower to click on what this script is in. Don't forget to change "object" to the name of the item that you have put into the contents of this SAME prim. This can work in a standalone prim or in a linked prim. Yes, I had a "start_entry" there that should have been a "state_entry" but its not even necessary for this script to work. That comes from not testing code and just typing it in and a failing mind.
Kathmandu Gilman
Fearful Symmetry Baby!
Join date: 21 May 2004
Posts: 1,418
01-04-2006 13:21
Cool.. where would I stick in the touch event. I tried but it doesn't do anything. I'm not very good at scripting I'm afraid. I need it to rez on touch. I put it in and it still piles them on top of each other. Without the touch event it rezzes one when you set out the rezzer and thats it.
_____________________
It may be true that the squeaky wheel gets the grease but it is also true that the squeaky wheel gets replaced at the first critical maintenance opportunity.
Bounder Jimenez
programmer/designer
Join date: 12 Oct 2005
Posts: 45
01-05-2006 05:18
updated the example script for you :)
Kathmandu Gilman
Fearful Symmetry Baby!
Join date: 21 May 2004
Posts: 1,418
01-05-2006 06:36
Well dang it.. I appreciate it but its not registering as a touch event. No hand icon as you mouse over it nor is there a "touch option" in the pie menu. Also start entry doesn't seem to work but state entry does. I assume that is a typo right?

Edit: I finally got it working and to be honest I don't know what the difference is. I may very well have been the sim I am in. I dunno... thanks a lot, your help is greatly appreciated.
_____________________
It may be true that the squeaky wheel gets the grease but it is also true that the squeaky wheel gets replaced at the first critical maintenance opportunity.
Deneria Sholokhov
Leaf on the Wind
Join date: 25 Oct 2005
Posts: 12
01-05-2006 13:08
You can also put a timer event into the actual jetski, so that if it is not "sat on" in 20-30 seconds, it deletes itself. This is what I do with my stuff like that.