How to make a still image of particles in LSL?

LSL (Linden scripting language) allows you to use various particle effects using the llParticleSystem function. What are the correct parameters for this function so that the image moving on a moving particle hangs over prim?

(This question was asked in the Script Academy discussion group today. I tried the question and my answer here to help get more LSL users on Stack Overflow.)

+3
source share
1 answer

The following script will create a still hanging image from particles using the first texture found in the contents of the primitive.

ParticleImage(string tex, vector scale)
{
   list params;
   //set texture and size
   params += [PSYS_SRC_TEXTURE, tex];
   params += [PSYS_PART_START_SCALE, scale];
   //make particles follow source
   params += [PSYS_PART_FLAGS, PSYS_PART_FOLLOW_SRC_MASK];
   //use drop pattern, which has no velocity
   params += [PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_DROP];
   llParticleSystem(params);
}

default
{
   state_entry()
   {
       //make the prim invisible
       llSetAlpha(0.0, ALL_SIDES);
       if (llGetInventoryNumber(INVENTORY_TEXTURE))
       {
           string tex = llGetInventoryName(INVENTORY_TEXTURE, 0);
           ParticleImage(tex, <1.0, 1.0, 0.0>);
       }
   }
}
+4
source

Source: https://habr.com/ru/post/1710871/


All Articles