Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Help Need a poofers script

Jodiette Flower
Registered User
Join date: 19 Oct 2003
Posts: 11
07-01-2006 05:41
I want to make poofers. I need a script with permissions to do so. I am willing to pay!!
Androclese Torgeson
I've got nothin'
Join date: 11 May 2004
Posts: 144
07-01-2006 09:24
OK, maybe I don't get out enough... what is a poofer? ...other than the obvious obscene reference.
_____________________
Androclese Torgeson

Real Life, also known as "that big room with the ceiling that is sometimes blue and sometimes black with little lights"

Rusholme Malone
Banned
Join date: 30 Jun 2006
Posts: 196
07-01-2006 09:27
I was just thinking exactly the same as you, Androclese.

Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
07-01-2006 10:00
From: Androclese Torgeson
OK, maybe I don't get out enough... what is a poofer? ...other than the obvious obscene reference.

Think poofer is that huge outburst of particles, often textured with some image... typically triggered when one teleports in, or out. Can be quite annoying and lag things out ^^;

Jodie, try this thread: /54/2f/61959/1.html
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
07-01-2006 10:52
Actually, I've updated that script with a few new features, including using the new CHANGED_TELEPORT event. Here's the new stuff.

"Poofer" script:
CODE

// Particle Poofer
// 7/6/05
// update 7/1/06

// Enjoy
// --Keknehv Psaltery

//Just change this variable to change the (default) texture.
//It needs either the name of a texture in the inventory, or a key ( asset UUID )
string pooftexture = "hug poofer";

float pooftime = 2; //How long it poofs
float poofrate = 0.4; //How long between each emission ( during poofing )
integer poofnum = 10; //How many particles per emission
float poofscale = 2; //The scale of the particles
float poofspeed = 5.5; //Speed of emitted particles
integer commandchannel = 1; //What channel to listen for commands on

list poofCommands; //The commands
list poofTextures; //The associated textures

key requestId;
integer lineNum;
string cardToRead = "poofconfig";


poof() //This is the function that actually starts the particle system.
{
llParticleSystem([ //KPSv1.0
PSYS_PART_FLAGS , 0 //Comment out any of the following masks to deactivate them
//| PSYS_PART_BOUNCE_MASK //Bounce on object's z-axis
//| PSYS_PART_WIND_MASK //Particles are moved by wind
| PSYS_PART_INTERP_COLOR_MASK //Colors fade from start to end
| PSYS_PART_INTERP_SCALE_MASK //Scale fades from beginning to end
| PSYS_PART_FOLLOW_SRC_MASK //Particles follow the emitter
//| PSYS_PART_FOLLOW_VELOCITY_MASK //Particles are created at the velocity of the emitter
| PSYS_PART_TARGET_POS_MASK //Particles follow the target
| PSYS_PART_EMISSIVE_MASK //Particles are self-lit (glow)
//| PSYS_PART_TARGET_LINEAR_MASK //Undocumented--Sends particles in straight line?
,

PSYS_SRC_TARGET_KEY , llGetKey(), //Key of the target for the particles to head towards
//This one is particularly finicky, so be careful.
//Choose one of these as a pattern:
//PSYS_SRC_PATTERN_DROP Particles start at emitter with no velocity
//PSYS_SRC_PATTERN_EXPLODE Particles explode from the emitter
//PSYS_SRC_PATTERN_ANGLE Particles are emitted in a 2-D angle
//PSYS_SRC_PATTERN_ANGLE_CONE Particles are emitted in a 3-D cone
//PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY Particles are emitted everywhere except for a 3-D cone

PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_EXPLODE

,PSYS_SRC_TEXTURE, pooftexture //UUID of the desired particle texture
,PSYS_PART_MAX_AGE, 5.0 //Lifetime, in seconds, that a particle lasts
,PSYS_SRC_MAX_AGE, pooftime //How long, in seconds, that the system lasts
,PSYS_SRC_BURST_RATE, poofrate //How long, in seconds, between each emission
,PSYS_SRC_BURST_PART_COUNT, 10 //Number of particles per emission
,PSYS_SRC_BURST_RADIUS, 5.0 //Radius of emission
,PSYS_SRC_BURST_SPEED_MIN, poofspeed //Minimum speed of an emitted particle
,PSYS_SRC_BURST_SPEED_MAX, poofspeed + .5 //Maximum speed of an emitted particle
,PSYS_SRC_ACCEL, <0.0,0.0,0.0> //Acceleration of particles each second
,PSYS_PART_START_COLOR, <1.0,1.0,1.0> //Starting RGB color
,PSYS_PART_END_COLOR, <1.0,1.0,1.0> //Ending RGB color, if INTERP_COLOR_MASK is on
,PSYS_PART_START_ALPHA, 0.9 //Starting transparency, 1 is opaque, 0 is transparent.
,PSYS_PART_END_ALPHA, 0.5 //Ending transparency
,PSYS_PART_START_SCALE, poofscale*<1,1,1> //Starting particle size
,PSYS_PART_END_SCALE, poofscale*<1,1,1>-<.3,.3,.3> //Ending particle size, if INTERP_SCALE_MASK is on
,PSYS_SRC_ANGLE_BEGIN, PI //Inner angle for ANGLE patterns
,PSYS_SRC_ANGLE_END, PI //Outer angle for ANGLE patterns
,PSYS_SRC_OMEGA, <0.0,0.0,0.0> //Rotation of ANGLE patterns, similar to llTargetOmega()
]);
}

string trim( string f2s ) //This will trim a typecast float
{
integer length = llStringLength( f2s ) - 1;
while( llGetSubString( f2s, length, length ) == "0" )
{
--length;
f2s = llGetSubString( f2s, 0, length );
}
if ( llGetSubString( f2s, length, length ) == "." )
{
--length;
f2s = llGetSubString( f2s, 0, length );
}
return f2s;
}

doCommand( string msg ) //This will parse out a command for the poofer
{
msg = llToLower( msg ); //Make it accept commands in any case
list parsedcommand = llParseString2List( msg, [" "], [] );
string part1 = llList2String( parsedcommand, 0 );
string part2 = llList2String( parsedcommand, 1 );
if ( part1 == "poof" )
{
if ( llGetListLength( parsedcommand ) > 1 ) //They gave us a texture parameter
{
pooftexture = llDumpList2String( llList2List( parsedcommand, 1, llGetListLength( parsedcommand ) ), " " );
poof();
} else
{
poof();
}
} else if ( ( part1 == "pooftexture" ) || ( part1 == "pt" ) )
//This is so long because it needs to ignore the spaces
pooftexture = llDumpList2String( llList2List( parsedcommand, 1, llGetListLength( parsedcommand ) ), " " );
else if ( part1 == "pooftime" )
pooftime = (float)llList2String( parsedcommand, 1 );
else if ( part1 == "poofrate" )
poofrate = (float)llList2String( parsedcommand, 1 );
else if ( part1 == "poofnum" )
poofnum = (integer)llList2String( parsedcommand, 1 );
else if ( part1 == "poofscale" )
poofscale = (float)llList2String( parsedcommand, 1 );
else if ( part1 == "poofspeed" )
poofspeed = (float)llList2String( parsedcommand, 1 );
else if ( part1 == "poofreset" )
llResetScript();

else if ( part1 == "poofdump" )
{
llOwnerSay( "pooftexture : " + pooftexture );
llOwnerSay( "pooftime : " + trim( (string)pooftime ) );
llOwnerSay( "poofrate: " + trim( (string)poofrate ) );
llOwnerSay( "poofnum: " + (string)poofnum );
llOwnerSay( "poofscale: " + trim( (string)poofscale ) );
llOwnerSay( "poofspeed: " + trim( (string)poofspeed ) );
} else if ( part1 == "poofadd" )
{
//Check to make sure we don't already have this in the command list
if (llListFindList( [ "poof","pooftexture","pooftime","poofrate","poofnum","poofscale","poofspeed","poofreset","poofdump","poofadd"]+
poofCommands, [ part2 ] ) != -1 )
{
llOwnerSay( "The command \""+ part2 + "\" already exists!" );
} else
{
llOwnerSay("Command \"" + part2 + "\" added");
poofCommands += [ part2 ];
poofTextures += [ llDumpList2String( llList2List( parsedcommand, 2, llGetListLength( parsedcommand ) ), " " ) ];
}
} else if ( part1 == "poofremove" )
{
integer commandLoc = llListFindList( poofCommands, [part2] );
if ( commandLoc != -1 )
{
llDeleteSubList( poofCommands, commandLoc, commandLoc );
llDeleteSubList( poofTextures, commandLoc, commandLoc );
} else
{
llOwnerSay( "No command to delete!" );
}
} else if ( part1 == "help" )
{
llGiveInventory( llGetOwner(), "Instructions" );
} else
{
integer commandLoc = llListFindList( poofCommands, [ part1 ] );
if ( commandLoc != -1 )
{
string temp = pooftexture;
pooftexture = llList2String( poofTextures, commandLoc );
poof();
pooftexture = temp;
}
}
}

default
{
on_rez( integer sparam )
{
poof();
llResetScript();
}

state_entry()
{
llParticleSystem([]);
llSetTimerEvent( 20 );
lineNum = 0;
requestId = llGetNotecardLine( cardToRead, lineNum++ );
llListen( commandchannel, "", llGetOwner(), "" );
}

listen( integer chan, string name, key id, string msg )
{
doCommand( msg );
}

timer()
{
llOwnerSay( cardToRead + " reading timed out" );
requestId = "";
}

dataserver( key id, string data )
{
if ( requestId == id )
{
if ( data != EOF )
{
doCommand( data );
llSetTimerEvent( 20 );
requestId = llGetNotecardLine( cardToRead, lineNum++ );
} else
llSetTimerEvent( 0 );
}
}

changed( integer change )
{
if ( change & CHANGED_TELEPORT )
poof();
else
llParticleSystem( [] ); //Stop the particles going off with every modification
}
}


"poofconfig" notecard:
CODE

poofadd firepoof fire
firepoof


"Instructions" notecard:
CODE

Poofer instructions:

All commands are, by default, on channel 1. To say something on channel one, put "/1" before your message.

"poof" or simply "p" will cause the it to poof. Optionally, a texture can be added, effectively combining the pooftexture [name] into the poof command.
"pooftexture [name]" will cause the texture to change to [name]. (i.e. "pooftexture fire")
"pooftime [time]" will change how long it poofs for.
"poofrate [rate]" will change how often it emits during a poof.
"poofnum [num]" will set how many particles emitted during each emission.
"poofscale [size]" will set the scale of the particle. ( Size is a float, not a vector )
"poofspeed [speed]" will set the speed of emitted particles.
"poofdump" will tell you all of the settings ( pooftime, poofspeed, etc. ).
"poofreset" will cause the script to reset and load default values.
"poofadd [name] [texture]" will cause the command [name] to poof [texture].
"poofremove [name]" will remove a command added with the poofadd command.

The notecard "poofconfig" contains commands to be executed when it is first run. Syntax is identical to the things described above. Please note, however, that you should not put "/1" before each of the config commands.


Have fun-- Jodiette Flower, I've sent you a copy in-world.

IM me if you want to discuss permissions for selling poofers- I would recommend selling poof textures, and offering the base poofer for free.
Macphisto Angelus
JAFO
Join date: 21 Oct 2004
Posts: 5,831
07-27-2006 22:03
I am not a scriptor, though I am taking the great classes at Teazers right now to begin trying to learn.

The question I have is what if I wanted to add more images to the poofer? Say I wanted a poofer that emitted 3 or 4 textures. Is that possible? If so how would one go about it?

Thanks in advance to anyone who may answer this. :)
_____________________
From: Natalie P from SLU
Second Life: Where being the super important, extra special person you've always been sure you are (at least when you're drunk) can be a reality!


From: Ann Launay
I put on my robe and wizard ha...
Oh. Nevermind then.
Dustin Widget
Script Monkey for hire
Join date: 15 Feb 2006
Posts: 101
07-27-2006 22:36
the only problem with that is it will only fire after a TP, not before.... which is what the sim-sim TP update broke
Macphisto Angelus
JAFO
Join date: 21 Oct 2004
Posts: 5,831
07-27-2006 23:05
I noticed that.
Mainly I am just hoping to make one that has multiple textures. Like in the script above, can it be modified to allow more textures then one?

Thanks!
_____________________
From: Natalie P from SLU
Second Life: Where being the super important, extra special person you've always been sure you are (at least when you're drunk) can be a reality!


From: Ann Launay
I put on my robe and wizard ha...
Oh. Nevermind then.
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
07-28-2006 13:17
I haven't messed with this, but I think that you would have two options. Either create several poofers each simultaneously emitting different textures. Otherwise, make repeated calls to the poof() function, changing the texture variable each time. You would then cycle through the textures.

As far as I know, there is no way to load several textures concurrently and have them all sort of explode at the same time from the same prim with the same script.

Hope this helps.
Baron H.
Macphisto Angelus
JAFO
Join date: 21 Oct 2004
Posts: 5,831
07-28-2006 14:15
Thanks Baron!
I was afraid that linking a few together was gonna be the end result. :)
I sure appreciate you responding to this.
_____________________
From: Natalie P from SLU
Second Life: Where being the super important, extra special person you've always been sure you are (at least when you're drunk) can be a reality!


From: Ann Launay
I put on my robe and wizard ha...
Oh. Nevermind then.