|
Scalar Tardis
SL Scientist/Engineer
Join date: 5 Nov 2005
Posts: 249
|
12-19-2006 20:41
I'm trying to make an indicator arrow that is rezzed to briefly show directional llPushObject forces, then de-rezzes almost immediately after it appears, since a new arrow will be rezzed somewhere else very quickly. The problem here is that, I cannot actually get this into the object and take it into my inventory, because the script kills the object before I can pick it up.  Any suggestions on how to do this? default { state_entry() { llSetTimerEvent(.25); }
on_rez(integer i) { llSetTimerEvent(.25); } timer() { llDie(); } }
|
|
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
|
12-19-2006 21:12
From: Scalar Tardis I'm trying to make an indicator arrow that is rezzed to briefly show directional llPushObject forces, then de-rezzes almost immediately after it appears, since a new arrow will be rezzed somewhere else very quickly. The problem here is that, I cannot actually get this into the object and take it into my inventory, because the script kills the object before I can pick it up.  Any suggestions on how to do this? easiest way is to find that no-script sandbox and create your object there. since the script can't run (even though it's flagged as running) it won't delete and you'll have plenty of time to pick it up an alternative (and less elegant) way would be to have a 2nd script to turn on your deletion script, and then auto-delete the "on switch" script. [edit] actually, if you just had default { on_rez(integer num) { llSleep(.25); llDie(); } }
it should die after .25 seconds only when it's rezzed. you can edit and flag the script as running and it will stay there forever and a day until you decide to rez it out of an inventory.
_____________________
My SLExchange shopTypos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not. The function is working perfectly fine. It's just not working the way you wanted it to work.
|
|
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
|
12-19-2006 21:36
You can also use the parameter passed from the rezzer script to tell it how long to live in hundredths of a second, and then when you rez from inventory it won't ever poof, and you won't have to modify it if you wish to later change the time it lives. default { on_rez(integer num) { if (0 == num) return;
float life = (float)num / 100.0; llSleep(life); llDie(); } }
then use 25 in the parameter argument for the rez function.
|
|
Peekay Semyorka
Registered User
Join date: 18 Nov 2006
Posts: 337
|
12-19-2006 21:40
... and don't forget to mark the object temp-on-rez before placing it in the containing object's inventory.
-peekay
|
|
Vares Solvang
It's all Relative
Join date: 26 Jan 2005
Posts: 2,235
|
12-19-2006 23:08
You can also keep the object in edit mode when you put the script into it. The script won't start working till you leave edit mode, so just don't. Pick the object up while it is still in edit mode, but after you have dropped the script into the contents.
|