Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: InstaBlaze Firelogs!!!

Poppet McGimsie
Proprietrix, WUNDERBAR
Join date: 28 Jul 2006
Posts: 197
09-09-2006 13:12
This is just a fun thing that combines Angelo Salome's particle script with Torley Linden's "Fran Rocks" random rock maker.

Use:

1) Put the script in a cube prim that you've decorated with wood textures (bark and firewood innards);
2) every time you rez the cube, or click on a rezzed one, you get a new shape of blazing firewood.
3) the flame scales with the size of the wood.

The particle system IS Angelo Salome's, so all the comments therein apply here, and the same goes for the random rock(log) maker script.

CODE

// InstaBlaze Firelogs!!!!
//just rez it to make a blazing, randomly shaped firelog. Click the log to change the shape to something you like.
//

//compiled by Poppet McGimsie, 9/9/2007 by piecing together two scripts from SL forums:
// Rock (log) rezzer script from http://forums.secondlife.com/showthread.php?t=78150&highlight=rock+script

// --------------------------------------
// Particle script From Angela Salome, http://forums.secondlife.com/showthread.php?t=124969

//
// same permissions as the original scripts: free to copy, use, and modify, but should not be sold as a script for profit

//------------------------------------------------------------
// Angelo Salome's comments and notes used here: a few rock rezzer notes are available in notecard in object's inventory. I have added a couple of comments but not changed much otherwise.


//Particle System Template.
// Derived from Jopsy's Particle System Template, which is derived from Ama Omega's Particle script.


// Appearance - how each particle looks.
// Start & End refers to the birth & death of each particle.

string Texture = "8f5eb76e-b35e-0b7a-b76e-6e5919216737";

integer Interpolate_Scale = TRUE; // Turns on or off interpolating scale.

integer Interpolate_Colour = TRUE; // Turns on or off interpolating colour.
vector Start_Colour = < 1.0, 1.0, 1.0 >; // Colour vector: <R, G, B>.
vector End_Colour = < 0.0, 0.0, 0.0 >; // 1.0 = Full colour; 0.0 = Zero colour.

float Start_Alpha = 1.0; // Sets transparency, from invisible = 0.0 to opaque = 1.0.
float End_Alpha = 1.0;

integer Emissive = TRUE;


// Flow - these settings affect how many, how quickly and for how long particles are present.

float Age = 0.5; // How many seconds each particle lives for: 0.1 to 60.0 seconds.
float Rate = 0.05; // Seconds between particle bursts, 0.0 to 60.
integer Count = 1; // Number of particles per burst, 1 to 4096.
float Life = 0.0; // Number of seconds to wait before shutting off, 0.1 to 60. 0.0 never stops.


// Placement - where new particles are created and what direction are they facing?

// Pattern must be set to one of the following:
// PSYS_SRC_PATTERN_EXPLODE // Sends particles in all directions.
// PSYS_SRC_PATTERN_DROP // Ignores Speed.
// PSYS_SRC_PATTERN_ANGLE_CONE // Uses Angle values to make rings & cones.
// PSYS_SRC_PATTERN_ANGLE // Uses ___ to make flat wedges.

integer Pattern = PSYS_SRC_PATTERN_ANGLE;

float Radius = 0.2; // Distance between emitter and each new particle, 0.0 to 64?

float Begin_Angle = 0.0; // 0 - PI (3.14159).
float End_Angle = 0.0; // 0 - PI (3.14159).

vector Omega = < 0.0, 0.0, 0.0 >; // How much to rotate the emitter around the X, Y & Z axes after each burst.


// Movement - moving the particles after they're created.

integer Follow_Source = FALSE; // Moves particles when emitter moves. Disables Radius.
integer Follow_Velocity = TRUE; // Particles rotate towards their heading.
integer Wind = TRUE; // Sim's wind will push particles.
integer Bounce = TRUE; // Make particles bounce above the Z altitude of emitter.

float Minimum_Speed = 0.1; // 0.01 to ?, slowest speed of new particles.
float Maximum_Speed = 0.1; // 0.01 to ?, fastest speed of new particles.
// Speed is ignore by PSYS_SRC_PATTERN_DROP Pattern.

vector Acceleration = < 0.00, 0.00, 0.00 >; // A continous force pushed on particles. Use small settings for long lived particles.

integer Target = FALSE; // Turns on or off targeting of particles.
key Target_Key = NULL_KEY; // Not sure.
// key Target_Key = llGetKey (); // Particles return to the emitter.
// key Target_Key = llGetOwner (); // Particles target the owner.
// You can have another object llSay (999, llGetKey ());
// and grab the key for that object by using the listen () event handler.

// --------------------------------------------------------------
// next comes rockmaker script from http://forums.secondlife.com/showthread.php?t=78150&highlight=rock+script

randomize_rock() {
vector size;
float magnitude;

magnitude = llFrand(1.5) + 0.5;
size.x = (0.1 + llFrand(0.9)) * magnitude;
size.y = (0.1 + llFrand(0.9)) * magnitude;
size.z = (0.1 + llFrand(0.9)) * magnitude;

{ //more stuff from particle script
//next 2 lines scale fire size to rock size
vector Start_Scale = < size.x, size.y, size.z >; // Particle height & width, from 0.04 to 4.0.
vector End_Scale = < size.x, size.y, size.z >; // No depth; Z is ignored.
list Parameters =
[
PSYS_PART_FLAGS,
(
(Emissive * PSYS_PART_EMISSIVE_MASK) |
(Bounce * PSYS_PART_BOUNCE_MASK) |
(Interpolate_Colour * PSYS_PART_INTERP_COLOR_MASK) |
(Interpolate_Scale * PSYS_PART_INTERP_SCALE_MASK) |
(Wind * PSYS_PART_WIND_MASK) |
(Follow_Source * PSYS_PART_FOLLOW_SRC_MASK) |
(Follow_Velocity * PSYS_PART_FOLLOW_VELOCITY_MASK) |
(Target * PSYS_PART_TARGET_POS_MASK)
),
PSYS_PART_START_COLOR, Start_Colour,
PSYS_PART_END_COLOR, End_Colour,
PSYS_PART_START_ALPHA, Start_Alpha,
PSYS_PART_END_ALPHA, End_Alpha,
PSYS_PART_START_SCALE, Start_Scale,
PSYS_PART_END_SCALE, End_Scale,
PSYS_SRC_PATTERN, Pattern,
PSYS_SRC_BURST_PART_COUNT, Count,
PSYS_SRC_BURST_RATE, Rate,
PSYS_PART_MAX_AGE, Age,
PSYS_SRC_ACCEL, Acceleration,
PSYS_SRC_BURST_RADIUS, Radius,
PSYS_SRC_BURST_SPEED_MIN, Minimum_Speed,
PSYS_SRC_BURST_SPEED_MAX, Maximum_Speed,
PSYS_SRC_TARGET_KEY, Target_Key,
PSYS_SRC_ANGLE_BEGIN, Begin_Angle,
PSYS_SRC_ANGLE_END, End_Angle,
PSYS_SRC_OMEGA, Omega,
PSYS_SRC_MAX_AGE, Life,
PSYS_SRC_TEXTURE, Texture
];
llParticleSystem (Parameters); // Turns on the particle system.
integer Particles = (integer) (Age * (float) Count / Rate);
if (4096 < Particles)
{
llOwnerSay ("Emitter creates too many particles!");
}
llOwnerSay ("Emitter produces " + (string) Particles + " concurrent particles.");
}



{ // Box type
float f;
integer holeshape;
vector cut;
float hollow;
vector twist;
vector topsize;
vector topshear;

f = llFrand(1);
if ( f < 0.33 )
holeshape = PRIM_HOLE_SQUARE;
else if ( f < 0.67 )
holeshape = PRIM_HOLE_CIRCLE;
else
holeshape = PRIM_HOLE_TRIANGLE;

cut.x = llFrand(1);
cut.y = cut.x + llFrand(1);
cut.z = llFrand(1);

hollow = llFrand(0.95);

twist.x = llFrand(1) - 0.5;
twist.y = llFrand(1) - 0.5;
twist.z = llFrand(1) - 0.5;

topsize.x = llFrand(1);
topsize.y = llFrand(1);
topsize.z = llFrand(1);

topshear.x = llFrand(1);
topshear.y = llFrand(1);
topshear.z = llFrand(1);

llSetPrimitiveParams( [PRIM_SIZE, size,
PRIM_TYPE, PRIM_TYPE_BOX, holeshape, cut, hollow, twist, topsize, topshear] );
}
}





// -------------------------------------------------------------------
// here we have the part of the script that actually MAKES the fire logs! It also adds sound!
//
default {
state_entry() {
randomize_rock();
llListen(0, "", llGetOwner(), "/rock off" );
llListen(1, "", llGetOwner(), "/rock off" );
llLoopSound ("3643f41e-fc7b-d44c-120a-35a9aecb4de7", 0.5); //This turns on the "crackling fire" sound I got from Yadni's junkyard. adjust sound volume by increasing or decreasing second argument from 0.5 to something higher (1.0 is maximum) or lower (0 is minimum). Change sound by putting in different sound file UUID between the quotes.
}

touch_start(integer total_number) {
randomize_rock();
}

on_rez(integer code) {
llResetScript();
}

listen( integer channel, string name, key id, string msg ) {
llRemoveInventory( llGetScriptName() );
}
}
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Original Thread
09-10-2006 13:35
/15/95/136276/1.html
_____________________
i've got nothing. ;)
Shanna Sungsoo
Registered User
Join date: 25 Nov 2006
Posts: 3
Uuid?
12-08-2006 23:31
Everything worked just fine, but how do I go about finding the UUID of my "favorite fire texture". I don't have flames just particles because of this one little problem.
Zebra North
Broadly Offensive
Join date: 7 May 2006
Posts: 48
12-12-2006 05:52
From: Shanna Sungsoo
Everything worked just fine, but how do I go about finding the UUID of my "favorite fire texture". I don't have flames just particles because of this one little problem.


Right-click on the texture in your inventory and choose "Copy UUID"