Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Flame Script - Help?

Solanghe Sarlo
Gypsy Free Thinker
Join date: 19 Jul 2006
Posts: 644
11-04-2007 11:20
Hi all,

I have a simple flame script that I know I need to edit but am unsure as to how. When I place the script into my candle wick prim, it causes the flame texture to spin really wildly. How can I correct this so the flame texture will flicker rather than spin like a top?

Any help is greatly appreciated. ;) Here is the script:

integer animOn = TRUE; //Set to FALSE and call initAnim() again to stop the animation.

//Effect parameters: (can be put in list together, to make animation have all of said effects)

//LOOP - loops the animation
//SMOOTH - plays animation smoothly
//REVERSE - plays animation in reverse
//PING_PONG - plays animation in one direction, then cycles in the opposite direction

list effects = [SMOOTH,LOOP];

//Movement parameters (choose one):
//ROTATE - Rotates the texture
//SCALE - Scales the texture
//Set movement to 0 to slide animation in the X direction, without any special movement.

integer movement = 0;

integer face = ALL_SIDES; //Number representing the side to activate the animation on.
integer sideX = 1; //Represents how many horizontal images (frames) are contained in your texture.
integer sideY = 1; //Same as sideX, except represents vertical images (frames).
float start = 0.0; //Frame to start animation on. (0 to start at the first frame of the texture)
float length = 0.0; //Number of frames to animate, set to 0 to animate all frames.
float speed = 10.0; //Frames per second to play.


initAnim() //Call this when you want to change something in the texture animation.
{
if(animOn)
{
integer effectBits;
integer i;
for(i = 0; i < llGetListLength(effects); i++)
{
effectBits = (effectBits | llList2Integer(effects,i));
}
integer params = (effectBits|movement);
llSetTextureAnim(ANIM_ON|params,face,sideX,sideY,
start,length,speed);
}
else
{
llSetTextureAnim(0,face,sideX,sideY,
start,length,speed);
}
}


default
{
state_entry()
{
initAnim();
}
}
_____________________
The key to a contented life: Figure out who you are, what you are, fix what you can and make peace with the rest.
Annabelle Babii
Unholier than thou
Join date: 2 Jun 2007
Posts: 1,797
11-04-2007 15:54
lower your FPS so you can see what it's really doing.
Is your texture set at the proper angle?
do you have the right amount of pix per texture?
Solanghe Sarlo
Gypsy Free Thinker
Join date: 19 Jul 2006
Posts: 644
11-04-2007 20:45
From: Annabelle Babii
lower your FPS so you can see what it's really doing.
Is your texture set at the proper angle?
do you have the right amount of pix per texture?



Annabelle,

Thanks for answering. OK, is FPS frames per second? Also, the texture is a single flame, like on a match or candle, and it is vertical which I think is correct. I don't know about pix per texture - can you expand abit on what that means?

Thanks,

Sol
_____________________
The key to a contented life: Figure out who you are, what you are, fix what you can and make peace with the rest.