|
Jasmin Loire
Want to do my grading?
Join date: 4 Nov 2007
Posts: 68
|
02-02-2008 12:55
I'm a teacher in SL who needs to limit her class sizes. One idea was to build a giant, phantom, invisible box around my class area and set it to non-phantom and non-invisible when the class was full. That makes the outside of the box offer up a "Class is full." texture and no new students can come in to the class room.
However, with the millions of things that I have to do simultaneously at the beginning of class (drop supplies on students who cannot find the supply box, explain that if you don't know how to build, taking an advanced class may be a poor fit, etc.) I have too much on my screen to make the build/edit window feasible.
I'm looking for something that will do these things via chat command.
I've searched and most of what I can find are scripts to turn things transparent or phantom (I want to go in the other direction) or window scripts that do not address phantom at all.
Any help in pointing me in the right direction?
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
02-02-2008 14:19
build as normal, drop this in. every time you say 'quiet' (no spaces no other words, no channels, just the word), it'll change from solid/opaque to phantom/transparent, or back the next time you say it. integer gBooPass;
default{ state_entry(){ llListen( 0, "", llGetOwner(), "quiet" ){ }
listen( integer vIntNull, string vStrNull, key vKeyNull, string vNull ){ gBooPass = !gBooPass; llSetLinkPrimitiveParams( LINK_SET, [PRIM_PHANTOM, gBooPass, PRIM_COLOR, ALL_SIDES, <1.0, 1.0, 1.0>, !gBooPass] ); }
changed( integer vBitChanged ){ if (CHANGED_OWNER & vBitChanged){ state sListenReset; } }
state sListenReset{ state_entry(){ state default; } }
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
|
02-02-2008 14:50
Heh... I've started so you're going to get two for the price of one.  Similar idea but set to channel 1, so in this case typing: /1class will toggle the object from phantom/transparent to solid/opaque. By default when the script is dropped into a link-set the object will immediately become phantom/transparent. Be aware that the color is also set to white (as is the case with Void's script). default { state_entry() { llListen(1, "", llGetOwner(), ""); llSetLinkPrimitiveParams(LINK_SET, [PRIM_COLOR, ALL_SIDES, <1, 1, 1>, 0.0, PRIM_PHANTOM, TRUE]); }
listen(integer channel, string name, key id, string message) { if(llToLower(message) == "class") { if (llList2Integer(llGetPrimitiveParams([PRIM_PHANTOM]), 0)) llSetLinkPrimitiveParams(LINK_SET, [PRIM_COLOR, ALL_SIDES, <1, 1, 1>, 1.0, PRIM_PHANTOM, FALSE]); else llSetLinkPrimitiveParams(LINK_SET, [PRIM_COLOR, ALL_SIDES, <1, 1, 1>, 0.0, PRIM_PHANTOM, TRUE]); } } }
Other than the channel being used my solution mainly differs in that it uses the object's current phantom setting to control the toggle.
|
|
Jasmin Loire
Want to do my grading?
Join date: 4 Nov 2007
Posts: 68
|
02-02-2008 15:58
Thank you both so very much. I've actually learned a lot from looking at your scripts and noticing how they differ from the window scripts I'd been looking at before.
You've made my day.
Happy (US) Groundhog Day!
|