Jump to content

how to make the fire stop on touch???


Tenly
 Share

You are about to reply to a thread that has been inactive for 4213 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I have a lovely fire texture with this script in it--came with my home, is modify. Unfortunately the fire doesnt turn off.  I want to know how to make it stop on touch. I've done a bit of searching to find something that already exists but I dont know enough about LSL to know what I need. 

any help in plain english would be good. I can build a static website, but this isnt your momma's html/css

 

// anim SMOOTH Script

// By Doug Linden (I think)

//

 

// If you are interested in scripting, check out

// the Script Help under the help menu.

 

// The double slash means these lines are comments

// and ignored by the computer.

 

// All scripts have a default state, this will be

// the first code executed.

default

{

    // state_entry() is an event handler, it executes

    // whenever a state is entered.

    state_entry()

    {   

        // llSetTextureAnim() is a function that animates a texture on a face.

        llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, ALL_SIDES,1,1,1.0, 1,0.25);

                            // animate the script to scroll across all the faces.

    }

 

    

}

Link to comment
Share on other sites

That should do the trick

// anim SMOOTH Script// By Doug Linden (I think)// // If you are interested in scripting, check out// the Script Help under the help menu. // The double slash means these lines are comments// and ignored by the computer. // All scripts have a default state, this will be// the first code executed.integer giOn;default{    // state_entry() is an event handler, it executes    // whenever a state is entered.    state_entry()    {           // llSetTextureAnim() is a function that animates a texture on a face.        llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, ALL_SIDES,1,1,1.0, 1,0.25);                            // animate the script to scroll across all the faces.        giOn = 1;    }     touch_end(integer num_detected) {    	if(giOn) {    		llSetTextureAnim(FALSE, ALL_SIDES, 0, 0, 0.0, 0.0, 1.0);    	} else {    		llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, ALL_SIDES,1,1,1.0, 1,0.25);    	}    	giOn = !giOn;    }}

 

Link to comment
Share on other sites

Qie is dead right, stopping the texture anim would only make the texture stop, I think what she needs is for the fire itselfto turn off, aka go invisible.

As you're not LSL literate, I took the liberty of compiling it for you, enjoy!

 

 

// anim SMOOTH Script
// By Doug Linden (I think)
//

// If you are interested in scripting, check out
// the Script Help under the help menu.

// The double slash means these lines are comments
// and ignored by the computer.

// All scripts have a default state, this will be
// the first code executed.

integer giOn;
default
{
// state_entry() is an event handler, it executes
// whenever a state is entered.
state_entry()
{
// llSetTextureAnim() is a function that animates a texture on a face.
llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, ALL_SIDES,1,1,1.0, 1,0.25);
// animate the script to scroll across all the faces.
giOn = 1;
}

touch_end(integer num_detected) {
if(giOn) {
llSetTextureAnim(FALSE, ALL_SIDES, 0, 0, 0.0, 0.0, 1.0);
llSetAlpha(giOn, ALL_SIDES);
} else {
llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, ALL_SIDES,1,1,1.0, 1,0.25);
llSetAlpha(giOn, ALL_SIDES);
}
giOn = !giOn;
}
}


Link to comment
Share on other sites

Thanks for the help. I dont know if either will work yet as Ive had problems with SL saving the script when I try to edit it. It keeps saying it can't be uploaded because the server is experiencing difficulty. story of my life. every time I try to upload textures get the same message.

But, Ill keep trying and one of these days, bet that puppy saves! Ill letcha know if it ever saves!

Link to comment
Share on other sites

heheehe. well it appears even I can break an entire house. lol. The fireplace turned out to have three prims each with a texture. so I changed the script in each, but because they overlap, touching one, leaves the other...oooo and I broke the fire. oh sigh, only I could break fire. so, yes, scripts work, just lil ole me not competent to figure out what to do with a three prim fire. In the end, I deleted the fire and the fireplace and that saved me about 8 prims on my land! so, thats one good thing. Im thinking 8 prims, that just might mean one whole new sofa!

anyway, thanks guys. Ive tucked this away for that day when I can resurrect the fireplace and figure out how to make ALL the prims sleep on touch.

 

Tenly

Link to comment
Share on other sites

  • 7 months later...

I tried the changes to that script, I have the same one I use for building.. unfortunately even the 2nd go around with that script only literally stops the flames and makes them static, it doesn't "turn them off" and make the prim invisible. If someone does come up with a change to that script, I'd be grateful as I wish to be able to turn my fireplaces on and off since I despise particle flames.

Link to comment
Share on other sites

I'm not sure which modifications you made, but this will work...

touch_end(integer num_detected) {    if(giOn)     {        llSetTextureAnim(FALSE, ALL_SIDES, 0, 0, 0.0, 0.0, 1.0);        llSetAlpha(0.0,ALL_SIDES);    }    else     {    	llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, ALL_SIDES,1,1,1.0, 1,0.25);        llSetAlpha(1.0,ALL_SIDES);    }    giOn = !giOn;}

 

Link to comment
Share on other sites

As far as I can see at a quick glance, there's nothing wrong with the rest of the script.  The action you want is all in the touch_start event, so just replace what's in Darkie's version with what I offered.  It ought to work.  It's just a simple light switch, after all.

Well, OK, I would probably not have written giOn = 1; in state_entry.  I would have written giOn = TRUE; instead, but Darkie's version should work fine.  It's just a stylistic difference.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4213 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...