Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

why i cant change my particle texture

JianXiang Wikifoo
Registered User
Join date: 12 Mar 2009
Posts: 1
06-05-2009 08:14
these days i'm busy with my particle emitter.i bought some beautiful particle texture from the particle lab.i bet many friends must have been there.so its no doubt that the equality of the particle is ok .so where is the problem located at?i want to design a script just like that "emit A particle 5secs,then emit B particle 5 secs ,at last emit C particle 5secs.but i find that i just cant change the texture of each of the particle by change their UUID.i'm sure i have enough perms to use the particles,and also i can copy their UUID easily.i also clearly know that like the hover text ,particles, color .texture.all that thing will keep their current state even the prim script be deleted,how stange they are!!!!!not sure if there are conjunction with my trouble.really wish some one can help me and show me you precious ideas.look forward to your reply.:)
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
06-05-2009 09:45
To change a texture on a prim with 'llSetPrimitiveParams' you need full permissions for the prim, not only for the texture. It might be the same for the 'llParticleSystem'
_____________________
From Studio Dora
Ephraim Kappler
Reprobate
Join date: 9 Jul 2007
Posts: 1,946
06-05-2009 09:56
The particle emission has actually been set as a part of the prim so that deleting the script is not enough. I believe you also need to 'scrub' or delete the original particle settings when you want to replace them with new settings.

The script below is supplied by Jopsy Pendragon at the Particle Laboratory and you perhaps overlooked it: drop it into the prim when you want to delete the old particle settings (it is is also good for 'scrubbing' a number of other settings.) The script will declare the prim clean and delete itself when it has served its purpose.

CODE

// The Scrubber v1.3 - Jopsy Pendragon, 8/22/2007
// Just drop this script on a prim that's giving you grief.
// It will reset/unset most persistant prim settings that
// can only be set by scripts and then remove itself.
// This script is in the public domain and may be used freely.
// Please leave this comment block intact if you share this script!

default
{
state_entry()
{
llSetSitText( "" );
llSetTouchText( "" );
llParticleSystem( [ ] );
llSetText( "", ZERO_VECTOR, 1.0 );
llTargetOmega( ZERO_VECTOR, 0, 0 );
llSetCameraAtOffset( ZERO_VECTOR );
llSetCameraEyeOffset( ZERO_VECTOR );
llSitTarget( ZERO_VECTOR, ZERO_ROTATION );
llSetTextureAnim( FALSE , ALL_SIDES, 1, 1, 0, 0, 0.0 );
llStopSound();
llOwnerSay("This Prim is Clean... ");
llRemoveInventory( llGetScriptName() ); // vanish without a trace...
}
}
Nika Talaj
now you see her ...
Join date: 2 Jan 2007
Posts: 5,449
06-05-2009 10:40
Hello JianXiang, welcome to the forums!

Ephraim is basically right. You can do what you want within a single script. Every 5 seconds, you disable your particle system explicitly, reset the "texture" parameter for it to a different UUID, then restart it.

Looks something like:

timer()
{
llParticleSystem( [ ] ); // turn off particles
list particle_list = [ ALL OF THE PARTICLE PARAMETERS INCLUDING
PSY_SRC_TEXTURE, <new uuid>,
];
llParticleSystem(particle_list); //turn on particles
}
.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
06-05-2009 10:50
If I understand the question correctly, the OP doesn't really need to clear the prim of particles. He just needs to substitute one particle texture for another. I think he can do it with a script that looks like this ....

CODE

MakeParticles(key UUID)
{
// Put all the normal stuff for a llParticleSystem call here, but be sure that there is
// a line that says PSYS_SRC_TEXTURE, UUID,
}

integer nextPart;

default
{
state_entry()
{
llSetTimerEvent(5.0);
nextPart = 0;
}
timer()
{
key PKey;
nextPart = ((nextPart + 1)%3)+1;
if (nextPart == 1) PKey = "the key of your first texture goes here";
else if (nextPart == 2) PKey = "the key of your second texture goes here";
else if (nextPart == 3) PKey = "the key of your third texture goes here";
MakeParticles(PKey);
}
}


This is completely untested, but it feels right. :)
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Paladin Pinion
The other one of 10
Join date: 3 Aug 2007
Posts: 191
06-05-2009 18:05
Whenever a new set of parameters is sent with llParticleSystem it replaces the old one, so there's no need to turn off the first one.

I wrote a multi-flower ring that uses something very similar to Rollig's method and it works great. Besides changing the UUID for the particles and a few other parameters, I also change the timer speed so that the flower rotations vary by different amounts. This gives me sparse vegtation around the outside of the ring and denser flowers in the center.
_____________________
Mote Particle Script Generator - easier and faster than any HUD
Also: Paladin's Sunbeam. Up at dawn, gone by dusk, day and night sounds, fully configurable
See more at: www.paladinpinion.com