Help with a simple privacy script?
|
|
Okiphia Rayna
DemonEye Benefactor
Join date: 22 Sep 2007
Posts: 2,103
|
12-08-2007 15:08
Heyas.. I'm working on a 'privacy screen' setting script for a build I'm doing, so far it's very simple but I'm having one problem. For some reason it won't talk to me like I want it to. ill attach one section of it, it's basically this repeated a bunch of times with differet values. What confounds me is it is almos the same exact script as the colour changing I'm using for the same build (Different parts though), only its changed from llSetLinkColor to llSetLinkAlpha, but the color changing one works just fine! Any help would be greatly appreciated! default { state_entry() { llSay(0, "Privacy Screens at 100%"  ; } touch_start(integer number) { llSetLinkAlpha(LINK_SET, .9, ALL_SIDES); state next1; } }
_____________________
Owner of DemonEye Designs Custom Building and Landscaping Owner and Blogger, Okiphia's Life http://okiphiablog.blogspot.com/ 
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
12-08-2007 15:13
Well, if that is the whole script it won't work at all. It refers to a state, "next1", which does not exist.
What is it meant to do?
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal
http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
|
|
Okiphia Rayna
DemonEye Benefactor
Join date: 22 Sep 2007
Posts: 2,103
|
12-08-2007 15:19
From: Ordinal Malaprop Well, if that is the whole script it won't work at all. It refers to a state, "next1", which does not exist.
What is it meant to do? lol that is one section of the script, it goes through 5 states before returning to default. Every section is exactly the same except for the valuies in them though. It is supposed to change a linked set of screens between various 'privacy settings' (Transparencies) and state the % of each when changed. I'm not hearing it state it though.
_____________________
Owner of DemonEye Designs Custom Building and Landscaping Owner and Blogger, Okiphia's Life http://okiphiablog.blogspot.com/ 
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
12-08-2007 15:33
Well, I wouldn't use states, that's a waste of time really. I would do something like the following:
list ALPHA_SETTINGS = [1.0, 0.9, 0.6, 0.4, 0.0]; integer gSetting = 0;
change_alpha() { float alpha = llList2Float(ALPHA_SETTINGS, gSetting); llOwnerSay("Privacy now " + (string)llRound(alpha * 100.0) + "%"); llSetLinkAlpha(LINK_SET, alpha); if (++gSetting >= llGetListLength(ALPHA_SETTINGS)) gSetting = 0; }
default { state_entry() { change_alpha(); }
touch_start(integer n) { if (llDetectedKey(0) == llGetOwner()) change_alpha(); } }
though it is hard to say without the exact settings.
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal
http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
12-08-2007 15:43
For an application like this you don't really need states. Try something like this: float alpha = 0.0;
default { touch_start(integer total_number) { llSetLinkAlpha(LINK_SET, alpha, ALL_SIDES); llSay(0, "Privacy Screens at " + (string)((integer)(alpha * 100)) + "%"); if (alpha == 1.0) { alpha = 0.0; } else alpha += 0.25; } }
EDIT: Cool! Ordinal whipped up one for you before I could get my reply out! But since I am here and am bored tonight. THis one steps down from 1.0 to 0.1 in 5 steps: float alpha = 1.0;
default { touch_start(integer total_number) { llSetLinkAlpha(LINK_SET, alpha, ALL_SIDES); llSay(0, "Privacy Screens at " + (string)((integer)(alpha * 100)) + "%"); if (alpha < 0.2) { alpha = 1.0; } else alpha -= 0.225; } }
_____________________
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
|
|
Okiphia Rayna
DemonEye Benefactor
Join date: 22 Sep 2007
Posts: 2,103
|
12-08-2007 16:06
If I knew more about scripting I would've done that in the first place =P
Trying to do specific things *and* learn scripting so did what I could ^_^
thankies
_____________________
Owner of DemonEye Designs Custom Building and Landscaping Owner and Blogger, Okiphia's Life http://okiphiablog.blogspot.com/ 
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
12-08-2007 16:16
From: Okiphia Rayna If I knew more about scripting Just think, NOW you do know more about scripting 
_____________________
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
|