ZoryaNite Posted August 29, 2016 Share Posted August 29, 2016 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 More sharing options...
Rhonda Huntress Posted August 29, 2016 Share Posted August 29, 2016 Setup any glow or full bright options you want and toggle it back and forth with a timer event. Link to comment Share on other sites More sharing options...
ZoryaNite Posted August 29, 2016 Author Share Posted August 29, 2016 can you give me an example of what that would look like? My brain feels like mush, it's the first time I've done any scripting so I think I know what you mean, but I'm not entirely sure. Sorry for my "stupidness" on the subject. Link to comment Share on other sites More sharing options...
Rolig Loon Posted August 29, 2016 Share Posted August 29, 2016 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 More sharing options...
Rhonda Huntress Posted August 29, 2016 Share Posted August 29, 2016 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 More sharing options...
ZoryaNite Posted August 29, 2016 Author Share Posted August 29, 2016 No, I have an option to simply turn full bright on or off not the blinking effect. Which is the option I would like to add to the menu. Link to comment Share on other sites More sharing options...
Rolig Loon Posted August 29, 2016 Share Posted August 29, 2016 I know. That's what I explained how to do. Rhonda's script demonstrates the blinky part. So use your touch_start toggle switch to turn the timer on/off. Link to comment Share on other sites More sharing options...
Qie Niangao Posted August 30, 2016 Share Posted August 30, 2016 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); }} 3 Link to comment Share on other sites More sharing options...
wherorangi Posted August 30, 2016 Share Posted August 30, 2016 likes this Link to comment Share on other sites More sharing options...
Recommended Posts
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