Too Many Objects and wont Die
|
|
Amiz Munro
Registered User
Join date: 8 Jul 2008
Posts: 54
|
09-22-2008 18:41
I have an object that rezzes on a collision but it rezzes more than one object I want to to rez only one and it wont die after 5 or so seconds. What am I doing wrong and sorry if my scripting is bad vector velocity; integer shot = FALSE; integer fade = FALSE; float alpha = 1.0; default { state_entry() { llSetStatus(STATUS_DIE_AT_EDGE, TRUE); } on_rez(integer start_param) { llSetStatus(STATUS_DIE_AT_EDGE, TRUE); llSetBuoyancy(1.0); //llCollisionSound("8490f44d-b028-6ba9-beca-94c3614c7578", 1.0); // Disable collision sounds velocity = llGetVel(); float vmag; vmag = llVecMag(velocity); if (vmag > 0.1) shot = TRUE; llSetTimerEvent(5.0); } collision_start(integer num) { if (llDetectedType(0) & AGENT) { // llTriggerSound("frozen", 1.0); // llRezObject(">:) invisible", llDetectedPos(0), ZERO_VECTOR, llGetRot(), 0); { integer i; for ( i=0; i<num; i++ ) { llRezObject( "Object", llGetPos()+<-3,0,2>, <0,0,0>, <0,0,0,1>, i ); integer i; }} } } timer() { if (!fade) { if (shot) { llDie(); } } else { llSetAlpha(alpha, -1); alpha = alpha * 0.95; if (alpha < 0.1) { llDie(); } } } }
Thanks!
|
|
Ron Khondji
Entirely unlike.
Join date: 6 Jan 2007
Posts: 224
|
09-22-2008 21:56
To rez only one object you have to take the llRezObject out of the for loop, and to make it die you have to either set shot to true or change 'if (shot)' to 'if (!shot)'.
I think that should do it.
|
|
Amiz Munro
Registered User
Join date: 8 Jul 2008
Posts: 54
|
09-23-2008 05:36
Ok I'm trying a new route but the time from the wiki is not working for me default { touch_start(integer dix)
{ integer i; vector pos = llGetPos() + <-1,0,0>;
for (i = 0; i < 1; i++) { llRezObject("Object", pos, ZERO_VECTOR, ZERO_ROTATION, 1); } { llSetTimerEvent(60); // five minutes: 5*60--no need to make LSL do this simple calculation }
llResetScript(); } }
I wanted this object to rezz and die naturally and with the rezzer dropping another in 60 seconds
|
|
Cheree Bury
ChereeMotion Owner
Join date: 6 Jun 2007
Posts: 666
|
09-23-2008 05:53
This is very confusing.
Would you post both scripts? The one that does the rezzing and the one inside the Object that you are rezzing?
_____________________
Visit ChereeMotion - Life's Best Pinup Poses http://slurl.com/secondlife/Wild%20Rice/38/230/51
|
|
Amiz Munro
Registered User
Join date: 8 Jul 2008
Posts: 54
|
09-23-2008 06:03
From: Cheree Bury This is very confusing.
Would you post both scripts? The one that does the rezzing and the one inside the Object that you are rezzing? I'm very sorry, the second script is another attempt to get the results wanted. I made a box with that script in it and put sphere inside as well with just a temporary life on it. Basically all it needed to do is rezz a sphere then that sphere to die then in 60 seconds rezz the sphere again.
|
|
Cheree Bury
ChereeMotion Owner
Join date: 6 Jun 2007
Posts: 666
|
09-23-2008 06:19
From: Amiz Munro I'm very sorry, the second script is another attempt to get the results wanted. I made a box with that script in it and put sphere inside as well with just a temporary life on it. Basically all it needed to do is rezz a sphere then that sphere to die then in 60 seconds rezz the sphere again. I can't get in-worlkd right now. But you need two scripts - one in the box that rezzes the sphere, and one in the sphere. The script in the box will rez the sphere from its inventory. You will set a timer in it to rez a new sphere every 60 seconds. The one in the sphere will have its own timer event that will call llDie to kill itself.
_____________________
Visit ChereeMotion - Life's Best Pinup Poses http://slurl.com/secondlife/Wild%20Rice/38/230/51
|
|
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
|
09-23-2008 06:35
only one script needed really. this one should work, just drop it into the sphere, take a copy, and drop it into it's contents. take it into inventory, and then rez it again it will rez a new sphere every 45 seconds (before being temp kills it) and give a copy of the sphere to the newly rezzed one. From: someone default { on_rez(integer start_param) { llSetTimerEvent(45); }
timer() { llRezAtRoot(llGetInventoryName(INVENTORY_OBJECT,0),llGetPos(),ZERO_VECTOR,llGetRot(),0); }
object_rez(key id) { llGiveInventory(id,llGetInventoryName(INVENTORY_OBJECT,0); } }
edit: you may need to put a temp on rez call in there to make sure it turns temp, i had some trouble with some stairs that were in a temp rezzer that wouldn't die until i selected them, and it still counted towards my prim limit
|
|
Cynthia Centaur
Registered User
Join date: 31 Oct 2006
Posts: 22
|
09-23-2008 06:42
One of the things to consider here is, that collision_start is not called per object but per prim of the colliding object.
So a for loop over all colliders might not do what you want.
best regards Cynthia
|
|
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
|
09-23-2008 06:48
From: Cynthia Centaur One of the things to consider here is, that collision_start is not called per object but per prim of the colliding object.
So a for loop over all colliders might not do what you want.
best regards Cynthia oh yikes, good to know.
|
|
Imnotgoing Sideways
Can't outlaw cute! =^-^=
Join date: 17 Nov 2007
Posts: 4,694
|
09-23-2008 07:21
Cheree, did you ever see my chain-reaction simulator? I think the rezzers I have in that do exectly what the OP is looking for. What I did was have an integer variable set to 1 when the script is started. On collision, if the value is still 1, it rezzes the sphere like a projectile and sets the value to 0. Collect about 100 of those rezzers in an enclosed box and it behaves like ping-pong balls on mousetraps. (^_^)y
|
|
Cheree Bury
ChereeMotion Owner
Join date: 6 Jun 2007
Posts: 666
|
09-23-2008 07:56
From: Imnotgoing Sideways Cheree, did you ever see my chain-reaction simulator? I think the rezzers I have in that do exectly what the OP is looking for. What I did was have an integer variable set to 1 when the script is started. On collision, if the value is still 1, it rezzes the sphere like a projectile and sets the value to 0. Collect about 100 of those rezzers in an enclosed box and it behaves like ping-pong balls on mousetraps. (^_^)y I think I saw something at a Blitz Build one night, but I don't know if it was this. I think I am just totally confused about this thread and thus am trying to sit on my hands. 
_____________________
Visit ChereeMotion - Life's Best Pinup Poses http://slurl.com/secondlife/Wild%20Rice/38/230/51
|
|
Imnotgoing Sideways
Can't outlaw cute! =^-^=
Join date: 17 Nov 2007
Posts: 4,694
|
09-23-2008 08:12
From: Cheree Bury I think I saw something at a Blitz Build one night, but I don't know if it was this. I think I am just totally confused about this thread and thus am trying to sit on my hands.  Ah... My Blitz Ball Factory (that the darned asset server ate (T_T) ) was just a looping rezzer... Sounds like I gotta sort through my toys when I login today. It's one of my more fun ones. (^_^)y
|
|
Amiz Munro
Registered User
Join date: 8 Jul 2008
Posts: 54
|
09-24-2008 08:54
Thanks all for your help, I worked on it a while with the suggestions given and have it working! I didnt realize that there were so many varibles to scripting, its so confusing but the help here is wonderful 
|