Second Life hoy en un solo lugar Regalos y freebies actualizados cada hora 7 idiomas Gratis publicar tu tienda
12:49 SLT Publica tu evento+ Publicar
Problema en el grid
  • Programado: Scheduled Billing Maintenance, lun, 16 nov 09:30–10:30 SLT
  • Estado del grid: Unscheduled Group Chat Maintenance (investigating)
  • Ahora: Servicio sabático Unitarian Universalist en UUtopia
  • Ahora: The Dharma of Community: Sociedad budista y el householder
  • Ahora: Harvest Fest de SLCS: juegos, música y diversión
  • 14:00 SLT: NAD GOUGH en vivo en Moondance en Cascadia, 14:00 SLT
  • Noticias: REZZ MALL: marcas de Second Life en un centro comercial web
  • Viewer: Second Life Viewer 26.5 moderniza el chat
  • Programado: Scheduled Billing Maintenance, lun, 16 nov 09:30–10:30 SLT
  • Estado del grid: Unscheduled Group Chat Maintenance (investigating)
  • Ahora: Servicio sabático Unitarian Universalist en UUtopia
  • Ahora: The Dharma of Community: Sociedad budista y el householder
  • Ahora: Harvest Fest de SLCS: juegos, música y diversión
  • 14:00 SLT: NAD GOUGH en vivo en Moondance en Cascadia, 14:00 SLT
  • Noticias: REZZ MALL: marcas de Second Life en un centro comercial web
  • Viewer: Second Life Viewer 26.5 moderniza el chat
Script LSL

Script LSL de interruptor de luz: toca para encender y apagar una lámpara

Script LSL gratis para lámparas, velas y bombillas de Second Life: toca para encender y apagar luz real, resplandor y full bright, con color y radio ajustables.

41 líneas ·

Convierte cualquier lámpara, bombilla, vela o letrero de neón en una luz que funciona. Tócala y este script de interruptor de luz enciende luz real de Second Life, un resplandor suave y full bright en la cara que elijas. Vuelve a tocar para apagarlo todo.

lsl-light-switch-script.lsl · 41 líneas Comprobar este script
// Light Switch - free LSL script from WhatSL (https://whatsl.com/scripts/lsl-light-switch-script)
// Free to use, change and put in your own creations, also ones you sell.
//
// Put this script in a lamp, bulb or candle. Touch to turn the light on and off.
// The prim gives real light, and can glow and be full bright while it is on.

vector  LIGHT_COLOR     = <1.0, 0.9, 0.7>;  // warm white
float   LIGHT_INTENSITY = 1.0;   // 0.0 to 1.0
float   LIGHT_RADIUS    = 10.0;  // metres, up to 20.0
float   LIGHT_FALLOFF   = 0.75;  // 0.0 to 2.0
float   GLOW_AMOUNT     = 0.1;   // 0.0 = no glow
integer USE_FULLBRIGHT  = TRUE;
integer LIGHT_FACE      = ALL_SIDES;  // the face that glows, or ALL_SIDES
integer START_ON        = FALSE;

integer gOn = FALSE;

setLight(integer on)
{
    float glow = 0.0;
    if (on) glow = GLOW_AMOUNT;
    llSetLinkPrimitiveParamsFast(LINK_THIS, [
        PRIM_POINT_LIGHT, on, LIGHT_COLOR, LIGHT_INTENSITY, LIGHT_RADIUS, LIGHT_FALLOFF,
        PRIM_FULLBRIGHT, LIGHT_FACE, on && USE_FULLBRIGHT,
        PRIM_GLOW, LIGHT_FACE, glow
    ]);
    gOn = on;
}

default
{
    state_entry()
    {
        setLight(START_ON);
    }

    touch_start(integer total)
    {
        setLight(!gOn);
    }
}

Libre para usar, cambiar e incluir en tus creaciones, también en las que vendes.

Cómo configurarlo

  1. Pon el script en la pantalla o en la bombilla de la lámpara (prim) y guarda.
  2. Toca la lámpara para encenderla y apagarla.
  3. Cambia el color, la intensidad y el radio para que encajen con la habitación.

Ajustes

  • LIGHT_COLOR: el color de la luz. <1.0, 0.9, 0.7> es blanco cálido, <0.7, 0.8, 1.0> es blanco frío.
  • LIGHT_INTENSITY, LIGHT_RADIUS, LIGHT_FALLOFF: qué tan fuerte es la luz, hasta dónde llega y qué tan rápido se desvanece.
  • GLOW_AMOUNT: un resplandor suave en la cara iluminada; 0.0 apaga el resplandor.
  • USE_FULLBRIGHT: hace que la cara iluminada se vea brillante incluso de noche.
  • LIGHT_FACE: la cara que brilla (por ejemplo, solo la bombilla), o ALL_SIDES.
  • START_ON: si la luz está encendida cuando el script empieza.

Consejos

  • Los visitantes solo ven la luz en sí si tienen activadas las luces locales en la configuración gráfica de su visor. El resplandor y el full bright sí se ven igual.
  • Muchas luces juntas pueden ralentizar el visor. Usa unas pocas luces potentes en lugar de muchas pequeñas.

Preguntas frecuentes

¿Por qué no veo la luz en las paredes?

La configuración gráfica de tu visor puede limitar las luces locales. Sube la calidad gráfica o permite las luces locales, y comprueba que LIGHT_RADIUS llegue hasta las paredes.

¿Puede un solo interruptor controlar varias lámparas?

Este script controla solo su propio prim. Para controlar varias lámparas, el interruptor puede enviar un mensaje a las lámparas con llMessageLinked (si están enlazadas) o llRegionSay (si no lo están), y cada lámpara lo escucha.

¿Puede encenderse sola de noche?

Sí. Comprueba la posición del sol con llGetSunDirection en un temporizador y cambia la luz cuando el sol se ponga.

Comprueba tu propio script: Comprobador de sintaxis LSL →

Más scriptsTodos los scripts
Script LSL · 55 líneas

Script de puerta en LSL: se abre al tocar y se cierra sola

Script de puerta gratuito en LSL para Second Life. Tócala para abrirla y cerrarla; la puerta gira sobre sus bisagras y se cierra sola tras unos segundos. Sonidos opcionales.

Script LSL · 69 líneas

LSL sit and pose script for chairs and pose balls

Free LSL sit script for Second Life chairs, benches and pose balls: sit and play your own animation, set the sit position, hide the ball while in use.

Script LSL · 96 líneas

LSL tip jar script with thank-you message and total

Free LSL tip jar script for Second Life clubs, DJs, hosts and stores: quick pay buttons, a thank-you message, the total and last tipper in floating text.