Second Life aujourd’hui en un seul endroit Cadeaux et freebies mis à jour chaque heure 7 langues Gratuit pour inscrire votre boutique
Incident grille
  • Prévu: Scheduled Billing Maintenance, lun. 16 nov. 09:30–10:30 SLT
  • État de la grille: Unscheduled Group Chat Maintenance (investigating)
  • En ce moment: Office du samedi Unitarian Universalist à UUtopia
  • En ce moment: The Dharma of Community : société bouddhiste et householder
  • En ce moment: SLCS Harvest Fest : jeux, musique et amusement
  • 14:00 SLT: NAD GOUGH en live au Moondance à Cascadia, 14 h SLT
  • Actus: REZZ MALL : les marques Second Life dans un centre commercial web
  • Viewer: Second Life Viewer 26.5 modernise le chat
  • Prévu: Scheduled Billing Maintenance, lun. 16 nov. 09:30–10:30 SLT
  • État de la grille: Unscheduled Group Chat Maintenance (investigating)
  • En ce moment: Office du samedi Unitarian Universalist à UUtopia
  • En ce moment: The Dharma of Community : société bouddhiste et householder
  • En ce moment: SLCS Harvest Fest : jeux, musique et amusement
  • 14:00 SLT: NAD GOUGH en live au Moondance à Cascadia, 14 h SLT
  • Actus: REZZ MALL : les marques Second Life dans un centre commercial web
  • Viewer: Second Life Viewer 26.5 modernise le chat
Script LSL

LSL particle script: soft sparkles around an object

Free LSL particle script for Second Life: soft gold and pink sparkles for gifts, signs and magic items, with colour, size and amount settings and touch on/off.

58 lignes ·

A few sparkles make a gift box, a sign or a magic wand stand out. This particle script sends out soft, glowing sparkles that fade as they drift. All the important values are at the top, so you can make your own effect without learning the whole particle system.

lsl-particle-script.lsl · 58 lignes Vérifier ce script
// 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 d’utilisation, de modification et d’intégration dans vos créations, même celles que vous vendez.

How to set it up

  1. Put the script in the object and save. Sparkles appear right away.
  2. Touch the object to turn them off and on.
  3. Change the colours, sizes and amounts and save again to see the result.

Settings

  • COLOR_START and COLOR_END: each sparkle fades from the first colour to the second.
  • SIZE_START and SIZE_END: the size of a sparkle when it appears and when it disappears, in metres.
  • PARTICLE_LIFE: how many seconds each sparkle lives.
  • BURST_RATE and BURST_COUNT: how often sparkles appear and how many at a time.
  • PARTICLE_TEXTURE: empty for the standard round particle, or the UUID of your own particle texture.

Tips

  • Less is more: a few slow sparkles look classier than a cloud of fast ones, and they are easier on the viewer.
  • Particles are a setting of the prim. If you delete the script, they keep going. To stop them for good, touch to turn them off first, then delete the script.

Frequently asked questions

Why can't I see any particles?

Your viewer may have particles turned down. Check the maximum particle count in the graphics settings.

How do I make snow or rain instead?

Use a white or blue colour, a longer PARTICLE_LIFE and a stronger downward pull: change PSYS_SRC_ACCEL to something like <0.0, 0.0, -0.5> and place the emitter high up.

Do particles cause lag?

Particles are drawn by each viewer, so they do not slow the region, but very many particles can slow down visitors' viewers. Keep BURST_COUNT small.

Vérifier votre propre script: Vérificateur de syntaxe LSL →

Autres scriptsTous les scripts
Script LSL · 55 lignes

Script de porte LSL : toucher pour ouvrir, se referme seule

Script de porte LSL gratuit pour Second Life. Touchez pour ouvrir et fermer, la porte pivote sur ses gonds et se referme toute seule après quelques secondes. Sons facultatifs.

Script LSL · 69 lignes

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 lignes

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.