Detecting NoScript Land.
|
|
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
|
06-21-2008 19:43
I'm working on a jetpack. It's a pretty simply item really, but I'd like to make the special FX work in no-script zones. Why? well the reason may not be as obvious as you think.
When you're flying around, a jetpack has flames and lights and sounds and all that, and when you land.. all of that is supposed to turn off. But if you land in a no-script area (or worse, teleport into one)... your flames and smoke and all that are going to be going and going until you either unwear the thing, or fly up 45 m and fall down.
Now, I know that you can use TakeControls to sneak in "under the radar".. and that's really not terribly inappropriate in this case. But a lot of my effects use subscripts in certain prims in the linkset.. because using SetLinkPrimitiveParams can be.. well.. sluggish.
So I've written my script to use llMessageLinked... but of course, the subscripts in the linkset can't run unless they ALSO llTakeControls. So the idea came to me, that if I could just somehow detect in the core script, if scripts were disabled.. then I could use SetLinkPrimitiveParams... and if scripts were fine, I could use llLinkMessage.
BUT.. llScriptDanger is the only thing I can find for "getting an idea" if scripts are disabled. Is there some magic that can be done, to determine JUST if SCRIPTS are disabled? I'm getting a LOT of false positives with llScriptDanger.
_____________________
 ● Inworld Store: http://slurl.eclectic-randomness.com ● Website: http://www.eclectic-randomness.com ● Twitter: @WinterVentura
|
|
Tyken Hightower
Automagical
Join date: 15 Feb 2006
Posts: 472
|
06-21-2008 20:09
llGetParcelFlags, perhaps?
|
|
Anti Antonelli
Deranged Toymaker
Join date: 25 Apr 2006
Posts: 1,091
|
06-21-2008 22:06
I agree, and some sources suggest that llScriptDanger is semi-deprecated in favor of llGetParcelFlags anyway.
Thinking out of the box a bit, another way might be to implement some sort of "dead man's switch" where a timed script sends keepalive messages indicating all is well with script functionality; when these messages fail one assumes that scripting is disabled and falls back on SetLinkPrimitiveParams.
Probably a silly idea unless llGetParcelFlags turns out to be expensive in some way (I have no idea if there's a delay built into it, for example), but there it is.
_____________________
Designer of sensual, tasteful couple's animations - for residents who take their leisure time seriously.  http://slurl.com/secondlife/Brownlee/203/110/109/ 
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
06-21-2008 23:50
Have you tried something like "llTakeControls(0, FALSE, TRUE);' in the helper scripts to see if that gives you the loophole without interfering with other control scripts?
|
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
06-22-2008 00:23
From: Hewee Zetkin Have you tried something like "llTakeControls(0, FALSE, TRUE);' in the helper scripts to see if that gives you the loophole without interfering with other control scripts? That does survive no script land, but each child prim set up that way puts up a permissions dialog.
|
|
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
|
06-22-2008 00:44
From: Viktoria Dovgal but each child prim set up that way puts up a permissions dialog. 'zactly! It looks like llGetParcelFlags is the key, along with a test for the difference between current height and llGround. *more than 45m above the ground, and I can use llMessageLinked again. The biggest complaint I have at this point, is the lack of a llSetLinkPrimitiveParticles. Oh well. LSL is about compromise.
_____________________
 ● Inworld Store: http://slurl.eclectic-randomness.com ● Website: http://www.eclectic-randomness.com ● Twitter: @WinterVentura
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
06-22-2008 01:47
From: Viktoria Dovgal That does survive no script land, but each child prim set up that way puts up a permissions dialog. In an attachment? Really? Because they are in child prims or something?
|
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
06-22-2008 02:00
From: Hewee Zetkin In an attachment? Really? Because they are in child prims or something? Yup, only the root prim gets the no dialog magic, all the others have to ask.
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
06-22-2008 03:38
Not sure how it helps with the particles, though. Is there some magic for turning off particles in child prims from a script in the root?
_____________________
Archived for Your Protection
|
|
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
|
06-22-2008 08:28
I was thinking along the same lines as Anti... a timer with some pings, no pings over the timer event range and there's you're no script land. http://www.secondscripter.com/
_____________________
My tutes http://www.youtube.com/johanlaurasia
|