Jump to content

Fade In/Out Script With Timer


MiG2107
 Share

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

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

Recommended Posts

Welcome aboard!  You've got the right plan.  Take a look at the function llSetAlpha, which will control your object's transparency.  Turn the timer on in a listen event, triggered by your secret word.  The only mild trick you will need to perform is to change the rate of your timer once it engages, so that it runs faster while you loop from alpha = 1.0 down to alpha = 0.0.  When you have a script that's looking halfway promising, feel free to post it here for comment.  That's what the LSL Scripting forum is for.  

Link to comment
Share on other sites

Welcome to the forums!

 

Everything Rolig said with the addition of adding the option of doing the fade within a loop (possibly having a llSleep(0.01); in it) in your timer event handler (requiring only a local variable for the current transparency) as opposed to using the timer from that point on (which would require a global variable).

 

Only caveat to that approach would be having event messages queued until the loop finished. Benefit would be finer control of the effect and one less global variable.

Link to comment
Share on other sites


Rolig Loon wrote:

... Take a look at the function
llSetAlpha
, which will control your object's transparency... 

Errr, I just realized that's prim specific.

 

For an object (which may or may not be a link set) one needs to use llSetLinkAlpha(LINK_SET, alphaFloatVar, ALL_SIDES); where alphaFloatVar is, of course, the decrementing transparency control.

 

See http://wiki.secondlife.com/wiki/LlSetLinkAlpha , for details, which also has a fade in/out script that the OP could easily mod to their specs.

Link to comment
Share on other sites

That's true.  Since the OP didn't specify and is a beginning scripter, I figured it was smarter to suggest the simple llSetAlpha instead of leaping directly into the confusion of more complicated functions -- certainly not SLPPF, which can make experienced scripters blanch.  That is a nice fader script, though, I agree.  :smileyhappy:

Link to comment
Share on other sites


revochen Mayne wrote:

Another way to achieve an alpha fade in or out is by using a texture grid and the llSetTextureAnim function. This might be the less lag way, especially as llSetTextureAnim is client side.

Looks good on paper, have you ever attempted this approach?

 

 

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3719 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...