Script de partículas LSL: destellos suaves alrededor de un objeto
Script LSL gratis para Second Life: destellos dorados y rosas para regalos, carteles y objetos mágicos, con ajustes de color, tamaño, cantidad y encendido al tocar.
Unos pocos destellos hacen que una caja de regalo, un cartel o una varita mágica destaquen. Este script de partículas emite destellos suaves y brillantes que se desvanecen mientras flotan. Todos los valores importantes están al principio, así puedes crear tu propio efecto sin aprender todo el sistema de partículas.
// Sparkle Particles - free LSL script from WhatSL (https://whatsl.com/scripts/lsl-particle-script)
// Free to use, change and put in your own creations, also ones you sell.
//
// Soft sparkles around the object: good for gifts, magic items, signs and decorations.
// Touch to turn them on and off. Change the colours and sizes below to make your own effect.
vector COLOR_START = <1.0, 0.9, 0.5>; // gold
vector COLOR_END = <1.0, 0.6, 0.9>; // pink
float SIZE_START = 0.10; // metres
float SIZE_END = 0.04;
float PARTICLE_LIFE = 2.0; // seconds each sparkle lives
float BURST_RATE = 0.1; // seconds between bursts
integer BURST_COUNT = 3; // sparkles per burst
string PARTICLE_TEXTURE = ""; // "" = the standard round particle; or a texture UUID
integer START_ON = TRUE;
integer gOn = FALSE;
sparkle(integer on)
{
gOn = on;
if (!on)
{
llParticleSystem([]);
return;
}
list rules = [
PSYS_PART_FLAGS, PSYS_PART_EMISSIVE_MASK | PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_INTERP_SCALE_MASK,
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_EXPLODE,
PSYS_PART_START_COLOR, COLOR_START,
PSYS_PART_END_COLOR, COLOR_END,
PSYS_PART_START_ALPHA, 1.0,
PSYS_PART_END_ALPHA, 0.0,
PSYS_PART_START_SCALE, <SIZE_START, SIZE_START, 0.0>,
PSYS_PART_END_SCALE, <SIZE_END, SIZE_END, 0.0>,
PSYS_PART_MAX_AGE, PARTICLE_LIFE,
PSYS_SRC_BURST_RATE, BURST_RATE,
PSYS_SRC_BURST_PART_COUNT, BURST_COUNT,
PSYS_SRC_BURST_SPEED_MIN, 0.05,
PSYS_SRC_BURST_SPEED_MAX, 0.3,
PSYS_SRC_ACCEL, <0.0, 0.0, -0.05>
];
if (PARTICLE_TEXTURE != "") rules += [PSYS_SRC_TEXTURE, PARTICLE_TEXTURE];
llParticleSystem(rules);
}
default
{
state_entry()
{
sparkle(START_ON);
}
touch_start(integer total)
{
sparkle(!gOn);
}
}
Libre para usar, cambiar e incluir en tus creaciones, también en las que vendes.
Cómo configurarlo
- Pon el script en el objeto y guarda. Los destellos aparecen enseguida.
- Toca el objeto para apagarlos y encenderlos.
- Cambia los colores, los tamaños y las cantidades, y guarda de nuevo para ver el resultado.
Ajustes
- COLOR_START y COLOR_END: cada destello pasa del primer color al segundo.
- SIZE_START y SIZE_END: el tamaño de un destello al aparecer y al desaparecer, en metros.
- PARTICLE_LIFE: cuántos segundos vive cada destello.
- BURST_RATE y BURST_COUNT: cada cuánto aparecen los destellos y cuántos salen a la vez.
- PARTICLE_TEXTURE: vacío para la partícula redonda estándar, o el UUID de tu propia textura de partícula.
Consejos
- Menos es más: unos pocos destellos lentos se ven más elegantes que una nube de rápidos, y son más ligeros para el visor.
- Las partículas son un ajuste del prim. Si borras el script, siguen funcionando. Para detenerlas del todo, tócalo para apagarlas primero y luego borra el script.
Preguntas frecuentes
¿Por qué no veo ninguna partícula?
Tu visor puede tener las partículas reducidas. Revisa el número máximo de partículas en los ajustes gráficos.
¿Cómo hago nieve o lluvia en su lugar?
Usa un color blanco o azul, un PARTICLE_LIFE más largo y una fuerza hacia abajo más intensa: cambia PSYS_SRC_ACCEL a algo como <0.0, 0.0, -0.5> y coloca el emisor en lo alto.
¿Las partículas causan lag?
Las partículas las dibuja cada visor, así que no ralentizan la región, pero demasiadas pueden ralentizar los visores de los visitantes. Mantén BURST_COUNT pequeño.