Jump to content

Full Bright Blinking Menu


ZoryaNite
 Share

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

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

Recommended Posts

What script would I need to have multiple full bright blinking options(like speed) to choose from a menu? I've managed to do a simple on and off menu, but I would like to be able to include blinking options. Can't seem to figure that out. Any help would be appreciated and rewarded if asked for :)

Link to comment
Share on other sites

If you already managed to script a toggle switch, you've done the "hard" part. Just put your switch into a timer event so that it toggles on/off each time that the timer fires. If it's ON, set the fullbright TRUE.  When it's OFF, set the fullbright FALSE.

To clarify ..... You have one switch that turns the option itself on or off.  That's the one in your touch_start event.  So you just need a second toggle switch -- same kind of scripting -- to put in the timer event.  The switch in the touch_start event turns the timer on/off.  The one in the timer event does the blinking.

Link to comment
Share on other sites

integer global_fullbright = FALSE;flash_face(){    llSetPrimitiveParamsFast([PRIM_FULLBRIGHT, ALL_SIDES, global_fullbright]);    if(global_fullbright){        global_fullbright = FALSE;    } else {        global_fullbright = TRUE;    }}default {    state_entry{        //yada yada yada ...        llSetTimerEvent(5.0);  // Time in seconds    }    timer(){        flash_face();    }}

Something like that.  The llSetPrimitiveParam set of functions take a list so you can change glow, color tint select a certian face and other things all at one time.  You can get a better feel for how to use it on the LSL Portal or LSL Wiki web pages.

 

Link to comment
Share on other sites

Here's a thing. It's only tangentially related to the OP's topic, but some scripters may be interested -- not in the script, per se, but in the functionality. Unfortunately, the effect is only visible for folks with Advanced Lighting Model enabled, so it's not practical for least-common-denominator applications. The sad irony: PRIM_ALPHA_MODE_EMISSIVE is by far a more efficient way to generate and render full-bright-like effects: One texture download when the object rezzes, one object update to set a blink mode, after which no more script activity and no object updates while texture animation makes all the blinkenlights. Plus the ability to arbitrarily dim the effect across space and over time.

(Sorry for some jumpiness due to this texture; my Gimp patience has limits for just a proof-of-concept sample.)

integer mode;float speed = 8.0;default{    state_entry()    {        llSetLinkPrimitiveParamsFast(LINK_THIS,            [ PRIM_TEXTURE, ALL_SIDES, "7c87789f-d2ac-f152-c125-985f787a64cb", <1.0, 1.0/16.0, 0.0>, <0.0, 1.0/32.0, 0.0>, 0.0            , PRIM_ALPHA_MODE, ALL_SIDES, PRIM_ALPHA_MODE_EMISSIVE, 0            ]);            }    touch_start(integer total_number)    {        mode = (mode + 1) % 5;        if (0 == mode)            llSetTextureAnim(ANIM_ON | LOOP | PING_PONG, ALL_SIDES, 1, 16, 4.0, 4.0, speed);        else        if (1 == mode)            llSetTextureAnim(ANIM_ON | LOOP | PING_PONG, ALL_SIDES, 1, 16, 4.0, 7.0, speed);        else        if (2 == mode)            llSetTextureAnim(ANIM_ON | LOOP | PING_PONG, ALL_SIDES, 1, 16, 1.0, 4.0, speed);        else        if (3 == mode)            llSetTextureAnim(ANIM_ON | LOOP, ALL_SIDES, 1, 16, 15.0, 2.0, speed);        else            llSetTextureAnim(ANIM_ON | LOOP | PING_PONG, ALL_SIDES, 1, 16, 11.0, 5.0, speed);    }}
  • Like 3
Link to comment
Share on other sites

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