Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
archiv:opensim:downloads:scripts:dimmen [2024/01/24 16:39] – Externe Bearbeitung 127.0.0.1 | archiv:opensim:downloads:scripts:dimmen [Unbekanntes Datum] (aktuell) – Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ===== Dimmen ===== | ||
+ | |||
+ | Mit dem diesem Script kann ein Objekt generiert werden dass bei Berührung ein Menü öffnet und mit dem dann die Transparanz anderer Objekte kontrolliert werden kann. | ||
+ | |||
+ | ==== Kontrollobjekt ==== | ||
+ | |||
+ | Dieses Script muss in das Objekt, das quasi als Fernbedienung dienen soll. Die Namen werden dabei im Array WALL_OPTIONS festgelegt. | ||
+ | |||
+ | < | ||
+ | // This program is free software; you can redistribute it and/or | ||
+ | // modify it under the terms of the GNU General Public License | ||
+ | // as published by the Free Software Foundation; either version 2 | ||
+ | // of the License, or (at your option) any later version. | ||
+ | // | ||
+ | // This program is distributed in the hope that it will be useful, | ||
+ | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
+ | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
+ | // GNU General Public License for more details. | ||
+ | // | ||
+ | // (C) 2007 Abba Thiebaud> | ||
+ | // Please remember, I do not offer support for this script; your use of | ||
+ | // this script is your acknowledgement and agreement to the above | ||
+ | // terms. | ||
+ | // | ||
+ | // DO NOT REMOVE THE ABOVE HEADER FOR ANY REASON WHATSOEVER. | ||
+ | |||
+ | // Window Controller Script (put into controller prim) | ||
+ | list TINT_OPTIONS = [" | ||
+ | list WALL_OPTIONS = [" | ||
+ | integer UPPER_FRONT = -28394; | ||
+ | integer LOWER_FRONT = -28395; | ||
+ | integer UPPER_BACK | ||
+ | integer LOWER_BACK | ||
+ | integer UPPER_SIDE | ||
+ | integer LOWER_SIDE | ||
+ | integer CEILING | ||
+ | integer CHANNEL | ||
+ | integer wallChannel; | ||
+ | integer allWalls; | ||
+ | |||
+ | PaintAllWalls(string tintLevel) | ||
+ | { | ||
+ | integer i; | ||
+ | integer j; | ||
+ | | ||
+ | j = -28394; | ||
+ | |||
+ | for (i = 0; i < 7; i++) | ||
+ | { | ||
+ | llSay(j, tintLevel); | ||
+ | j--; | ||
+ | } // end for | ||
+ | } // end PaintAllWalls | ||
+ | |||
+ | default { | ||
+ | state_entry() | ||
+ | { | ||
+ | llListen(CHANNEL, | ||
+ | } // end state_entry() | ||
+ | |||
+ | touch_start(integer total_number) | ||
+ | { | ||
+ | llDialog(llDetectedKey(0), | ||
+ | allWalls = 0; | ||
+ | } // end touch_start() | ||
+ | |||
+ | listen(integer channel, string name, key id, string message) | ||
+ | { | ||
+ | if (llListFindList(TINT_OPTIONS + WALL_OPTIONS, | ||
+ | { | ||
+ | if (message == "Upper Front" | ||
+ | { | ||
+ | llDialog(id, | ||
+ | wallChannel = UPPER_FRONT; | ||
+ | } | ||
+ | else if (message == "Upper Back") | ||
+ | { | ||
+ | llDialog(id, | ||
+ | wallChannel = UPPER_BACK; | ||
+ | } | ||
+ | else if (message == "Upper Sides" | ||
+ | { | ||
+ | llDialog(id, | ||
+ | wallChannel = UPPER_SIDE; | ||
+ | } | ||
+ | else if (message == "Lower Front" | ||
+ | { | ||
+ | llDialog(id, | ||
+ | wallChannel = LOWER_FRONT; | ||
+ | } | ||
+ | else if (message == "Lower Back") | ||
+ | { | ||
+ | llDialog(id, | ||
+ | wallChannel = LOWER_BACK; | ||
+ | } | ||
+ | else if (message == "Lower Sides" | ||
+ | { | ||
+ | llDialog(id, | ||
+ | wallChannel = LOWER_SIDE; | ||
+ | } | ||
+ | else if (message == " | ||
+ | { | ||
+ | llDialog(id, | ||
+ | wallChannel = CEILING; | ||
+ | } | ||
+ | else if(message == " | ||
+ | { | ||
+ | llDialog(id, | ||
+ | allWalls = 1; | ||
+ | } | ||
+ | |||
+ | if (message == " | ||
+ | { | ||
+ | if(allWalls == 1) | ||
+ | { | ||
+ | PaintAllWalls(" | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | llSay(wallChannel, | ||
+ | } | ||
+ | } | ||
+ | else if (message == " | ||
+ | { | ||
+ | if(allWalls == 1) | ||
+ | { | ||
+ | PaintAllWalls(" | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | llSay(wallChannel, | ||
+ | } | ||
+ | } | ||
+ | else if (message == " | ||
+ | { | ||
+ | if(allWalls == 1) | ||
+ | { | ||
+ | PaintAllWalls(" | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | llSay(wallChannel, | ||
+ | } | ||
+ | } | ||
+ | else if (message == " | ||
+ | { | ||
+ | if(allWalls == 1) | ||
+ | { | ||
+ | PaintAllWalls(" | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | llSay(wallChannel, | ||
+ | } | ||
+ | } | ||
+ | else if (message == " | ||
+ | { | ||
+ | if(allWalls == 1) | ||
+ | { | ||
+ | PaintAllWalls(" | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | llSay(wallChannel, | ||
+ | } | ||
+ | } | ||
+ | else if (message == " | ||
+ | { | ||
+ | if(allWalls == 1) | ||
+ | { | ||
+ | PaintAllWalls(" | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | llSay(wallChannel, | ||
+ | } | ||
+ | } | ||
+ | } // end if (valid message) | ||
+ | } // end listen | ||
+ | } // end default | ||
+ | </ | ||
+ | |||
+ | ==== Dimm-Objekt ==== | ||
+ | |||
+ | Dieses Script muss in alle wählbaren Objekte. Dabei muss ein Channel durch Entfernen des Platzhalters aktiviert werden, wodurch das Objekt durch das Kontrollscript ansprechbar wird. | ||
+ | |||
+ | < | ||
+ | //Here the target aka Windows, put this script into them. | ||
+ | //integer chan = -28394; // uncomment for UPPER_FRONT | ||
+ | //integer chan = -28395; // uncomment for LOWER_FRONT | ||
+ | //integer chan = -28396; // uncomment for UPPER_BACK | ||
+ | //integer chan = -28397; // uncomment for LOWER_BACK | ||
+ | //integer chan = -28398; // uncomment for UPPER_SIDE | ||
+ | //integer chan = -28399; // uncomment for LOWER_SIDE | ||
+ | //integer chan = -28400; // uncomment for CEILING | ||
+ | |||
+ | default | ||
+ | { | ||
+ | state_entry() | ||
+ | { | ||
+ | llListen(chan, | ||
+ | } | ||
+ | |||
+ | listen( integer channel, string name, key id, string message ) | ||
+ | { | ||
+ | if ( message == " | ||
+ | { | ||
+ | llSetAlpha(1.0, | ||
+ | } | ||
+ | else if ( message == " | ||
+ | { | ||
+ | llSetAlpha(0.8, | ||
+ | } | ||
+ | else if ( message == " | ||
+ | { | ||
+ | llSetAlpha(0.6, | ||
+ | } | ||
+ | else if ( message == " | ||
+ | { | ||
+ | llSetAlpha(0.4, | ||
+ | } | ||
+ | else if ( message == " | ||
+ | { | ||
+ | llSetAlpha(0.2, | ||
+ | } | ||
+ | else if ( message == " | ||
+ | { | ||
+ | llSetAlpha(0.0, | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||