From: Dianne Mechanique
Unfortunately I have to as I have over a hundred windows to change at the same time.
I dont really know where to start though.
Would one use scripts located in each individual prim/window that are activated by the voice command?
Or would it be a single script in some kind of "controler" prim that cycles through each window by ID number telling the windows to change?
Well, you really don't want over 100 open listeners. That would lag your sim something fierce.
You'll still need a script in each window prim, but you won't be using llListen for each one. Instead, you'll rely on link messages, which are more like events and don't incur the same kind of overhead while inactive.
1) Choose a controller prim. Usually the root prim of the build is the best choice, but it's not required to be the root. You can go three ways for activating the blinds: touch activated, private listener, open listener.
touch activated: I like this kind of interface for building automation. Create a controller prim that responds to touch events. You touch it, all the blinds on the building open or close. You can even have several of these scattered around the house. If you want the controller to toggle all blinds, you just do that on touch. If you want more control, you can use dialogs to present choices such as selecting which floor's blinds to open.
private listener: Just one prim listens on a non-zero channel, such as 66. To activate, you say "/66 blinds open". Listening on a non-zero or private channel is nice in that your commands don't spam other people, but moreso because it causes less lag.
open listener: Just one prim listens on channel 0. To activate, say "blinds open" or whatever. This is pretty convenient, but can be a bit laggy when there are lots of avs or other scripts listening on channel 0.
For either private or open listener, you may need several around the build depending on how large it is. If it's less than 40m across, you can get away with just one in the center. If your build is larger than that, you'll be linking in multiple sections anyway, so you'll need multiple listeners or controller prims anyway.
Whichever you choose, how it works is the controller prim receives the command, then uses a link message to thell the window blinds to open/close.
2) Put a blinds script in each window prim. This script has a link_message event handler that opens or closes the blind.
If you are using two textures for the different open/close appearances, you will use llSetTexture("blinds open", BlindSide), where BlindSide is the face of the blind. The other way to do it is to have both appearances on the same texture, and just offest the texture so that one or the other half is displayed as appropriate: llOffsetTexture(0.0, OpenOffset, BlindSide). Using the offset approach is nice as you don't force a new texture download, so it's pretty fast.
3) The controller prim uses llMessageLinked to open/close blinds. The window prims will get the link message and react. You don't need to cycle through all the window prims - just use the LINK_SET constant to broadcast to all prims in the link. Link messages that aren't handled explicitly by another prim's script have no effect and are ignored.
4) If you want to, you can have a touch event in each window prim too, so you can control each window individually as well as en masse. Or you could have every window prim act as a controller for all window blinds - each touch would use llMessageLinked(LINK_SET, ...) to broadcast the open/close toggle to all window blind prims.