Sunbleached Posted June 13, 2019 Share Posted June 13, 2019 Hello! What is the easiest way to make the light blink using the llSetLinkPrimitiveParametersFast? Preferably not using a timer, since there is already one timer, and I tried to build it into it, but it didn’t work out yet. Is it possible at all? Link to comment Share on other sites More sharing options...
Fionalein Posted June 13, 2019 Share Posted June 13, 2019 (edited) while true loop + sleep Edited June 13, 2019 by Fionalein 1 Link to comment Share on other sites More sharing options...
Sunbleached Posted June 13, 2019 Author Share Posted June 13, 2019 5 minutes ago, Fionalein said: while true loop + sleep Thanks for responding so quickly! I've never come across while before, can I have a little more details, please? Link to comment Share on other sites More sharing options...
Rolig Loon Posted June 13, 2019 Share Posted June 13, 2019 Why not just run a second fake timer? Or, depending on what sort of light you have, how about using llSetTextureAnim to ping-pong back and forth between a nice yellow light image and a dull gray one? 1 1 Link to comment Share on other sites More sharing options...
Rolig Loon Posted June 13, 2019 Share Posted June 13, 2019 Just now, Sunbleached said: I've never come across while before, can I have a little more details, please? The LSL wiki is your friend.... http://wiki.secondlife.com/wiki/While 1 Link to comment Share on other sites More sharing options...
Wulfie Reanimator Posted June 13, 2019 Share Posted June 13, 2019 1 hour ago, Fionalein said: while true loop + sleep But this would lock the script into that one loop, unable to process any new events once it begins. 2 Link to comment Share on other sites More sharing options...
Rolig Loon Posted June 14, 2019 Share Posted June 14, 2019 1 hour ago, Wulfie Reanimator said: But this would lock the script into that one loop, unable to process any new events once it begins. True, but since the OP never said what else he expects the script to do, we're free to guess. It's not our script. 1 Link to comment Share on other sites More sharing options...
Kyrah Abattoir Posted June 14, 2019 Share Posted June 14, 2019 If you only need the "impression" of a light and no change in light emission you can use a two step texture animation and consume no script time. 3 Link to comment Share on other sites More sharing options...
Rolig Loon Posted June 14, 2019 Share Posted June 14, 2019 3 hours ago, Kyrah Abattoir said: If you only need the "impression" of a light and no change in light emission you can use a two step texture animation and consume no script time. As I suggested earlier ^^ 🙃 1 Link to comment Share on other sites More sharing options...
Qie Niangao Posted June 14, 2019 Share Posted June 14, 2019 5 hours ago, Rolig Loon said: True, but since the OP never said what else he expects the script to do, we're free to guess. It's not our script. But there was this: 7 hours ago, Sunbleached said: ... there is already one timer... so that timer won't work while the script is in a tight while loop. I guess it's possible there's no blinkenlight while the existing timer is relevant, but then the timer would be eligible to control the light blink. Anyway, I mostly wanted to mention that under advanced lighting, emitted light "blinks" when behind a texture animation that's part transparent, part opaque, requiring no script at all. Of course, those without ALM enabled won't see it, but I use this often for stuff like flickering fluorescent lights and candles, figuring the non-ALM-equipped are already missing a lot more than some flickering lights. 2 1 Link to comment Share on other sites More sharing options...
animats Posted June 14, 2019 Share Posted June 14, 2019 1 hour ago, Qie Niangao said: that under advanced lighting, emitted light "blinks" when behind a texture animation that's part transparent, part opaque, requiring no script at all. Does that work only with shadows on? 1 Link to comment Share on other sites More sharing options...
Lucia Nightfire Posted June 14, 2019 Share Posted June 14, 2019 My only gripe with animated texture "light blinking" is that depending on the size of the object, animated textures stop animated from a certain draw distance. 1 Link to comment Share on other sites More sharing options...
Kyrah Abattoir Posted June 14, 2019 Share Posted June 14, 2019 5 hours ago, Rolig Loon said: As I suggested earlier ^^ 🙃 My bad I missed this one. 1 Link to comment Share on other sites More sharing options...
Qie Niangao Posted June 14, 2019 Share Posted June 14, 2019 2 hours ago, animats said: Does that work only with shadows on? Yeah, I think that's probably right. Also, I realize I said "emitted light" when I should have said "projected light" -- it's not enough for it to be simply a point light source, it has to be using projected light. The distance where it's visible definitely depends on keeping the light-masking object rezzed -- if it's small enough to disappear (or, I suppose, lose shape by LoD), the blinking will stop -- but I've usually set the projected light radius shorter than that anyway. 1 Link to comment Share on other sites More sharing options...
Sunbleached Posted June 14, 2019 Author Share Posted June 14, 2019 (edited) The script itself if it somehow clarifies the situation, this was the basic menu script, I only built-in options for controlling the brightness of the light and on/off. trying to add a blinking button. I tried giTick and BillThePirate by Rolig. But no success. I also plan to add automatic on and off depending on the position of the sun and this will be the third timer! vector LIGHT_COLOR = < 1.0, 1.0, 1.0 > ; //Light color integer LIGHT_PRIM = LINK_THIS; //LINK_SET or prim number integer LIGHT_FACE = ALL_SIDES; //light face list MENU_MAIN = ["MIN","MID","MAX","ON","OFF","DELETE","BLINK","AUTO ON","AUTO OFF"]; float sun_height; vector sun_position; integer menu_handler; integer menu_channel; menu(key user,string title,list buttons) { llListenRemove(menu_handler); menu_channel = (integer)(llFrand(99999.0) * -1); menu_handler = llListen(menu_channel,"","",""); llDialog(user,title,buttons,menu_channel); llSetTimerEvent(30.0); //how long to wait for user to press a button before giving up and closing listen } default { state_entry() { } touch_start(integer total_number) { menu(llDetectedKey(0), "\nText for Menu.", MENU_MAIN); } listen(integer channel,string name,key id,string message) { if (channel == menu_channel) { llListenRemove(menu_handler); //close listen llSetTimerEvent(0); //stop timeout timer if (message == "MIN") { llSay(0, "Min Light"); llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, LIGHT_FACE, 0.25, PRIM_POINT_LIGHT, TRUE, LIGHT_COLOR // START COLOR , 0.25 // START INTENSITY , 5.0 // START RADIUS , 1.0 // START FALLOFF ]); } else if (message == "MID") { llSay(0, "Mid Light"); llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, LIGHT_FACE, 0.50, PRIM_POINT_LIGHT, TRUE, LIGHT_COLOR // START COLOR , 0.5 // START INTENSITY , 10.0 // START RADIUS , 0.5 // START FALLOFF ]); } else if (message == "MAX") { llSay(0, "Max Light"); llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, LIGHT_FACE, 1.00, PRIM_POINT_LIGHT, TRUE, LIGHT_COLOR // START COLOR , 1.0 // START INTENSITY , 20.0 // START RADIUS , 0.0 // START FALLOFF ]); } else if (message == "ON") { llSay(0, "Light is ON"); llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, LIGHT_FACE, 1.00, PRIM_POINT_LIGHT, TRUE, LIGHT_COLOR // START COLOR , 1.0 // START INTENSITY , 20.0 // START RADIUS , 0.0 // START FALLOFF ]); } else if (message == "OFF") { llSay(0, "Light is OFF"); llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, ALL_SIDES, FALSE, PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR // COLOR , 0.0 // INTENSITY , 0.0 // RADIUS , 2.0 // FALLOFF ]); } else if (message == "DELETE") { llSay(0, "Script Deleted"); llRemoveInventory(llGetScriptName()); } else if (message == "BLINK") { llSay(0, "Blinking"); // BLINKING STUFF } else if (message == "AUTO ON") { llSay(0, "Automatic light on"); sun_position = llGetSunDirection(); sun_height = sun_position.z; if(sun_height < 0.0) { llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, LIGHT_FACE, 1.00, PRIM_POINT_LIGHT, TRUE, LIGHT_COLOR // START COLOR , 1.0 // START INTENSITY , 20.0 // START RADIUS , 0.0 // START FALLOFF ]); } else { llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, ALL_SIDES, FALSE, PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR // COLOR , 0.0 // INTENSITY , 0.0 // RADIUS , 2.0 // FALLOFF ]); } } else if (message == "AUTO OFF") { llSay(0, "Automatic light off"); llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, ALL_SIDES, FALSE, PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR // COLOR , 0.0 // INTENSITY , 0.0 // RADIUS , 2.0 // FALLOFF ]); } //else if (message == "Button") //{ //do something //} } } timer() //VERY IMPORTANT menu timeout { llListenRemove(menu_handler); //close listen llSetTimerEvent(0); //stop timeout timer } } Edited June 14, 2019 by Sunbleached Link to comment Share on other sites More sharing options...
Rolig Loon Posted June 14, 2019 Share Posted June 14, 2019 Is that all? Just multiplex the timer. integer iTouched; default { state_entry() { llSetTimerEvent(1.0); // and whatever else } touch_start(integer num) { iTouched = 1; // and whatever else ... } timer() { if (iTouched > 1) { ++iTouched; } if (iTouched > 30) { iTouched = 0; llListenRemove(menu_handler); } } } 1 Link to comment Share on other sites More sharing options...
Sunbleached Posted June 14, 2019 Author Share Posted June 14, 2019 55 minutes ago, Rolig Loon said: Is that all? Just multiplex the timer. @Rolig Loon Thank you very much! In this discussion, the main focus was on the timers, but it’s also incomprehensible to me how to make the light blink? I would also like to understand how to make it? Link to comment Share on other sites More sharing options...
Sunbleached Posted June 14, 2019 Author Share Posted June 14, 2019 I should try harder, but I’m still unable to use multiplex timer. how to add it to my script? vector LIGHT_COLOR = < 1.0, 1.0, 1.0 > ; //Light color integer LIGHT_PRIM = LINK_THIS; //LINK_SET or prim number integer LIGHT_FACE = ALL_SIDES; //light face list MENU_MAIN = ["MIN","MID","MAX","ON","OFF","DELETE","BLINK","AUTO ON","AUTO OFF"]; float sun_height; vector sun_position; integer iTouched; integer menu_handler; integer menu_channel; menu(key user,string title,list buttons) { llListenRemove(menu_handler); menu_channel = (integer)(llFrand(99999.0) * -1); menu_handler = llListen(menu_channel,"","",""); llDialog(user,title,buttons,menu_channel); llSetTimerEvent(30.0); //how long to wait for user to press a button before giving up and closing listen } default { state_entry() { llSetTimerEvent(1.0); // and whatever else } touch_start(integer total_number) { { iTouched = 1; // and whatever else ... } { menu(llDetectedKey(0), "\nText for Menu.", MENU_MAIN); } } listen(integer channel,string name,key id,string message) { if (channel == menu_channel) { llListenRemove(menu_handler); //close listen llSetTimerEvent(0); //stop timeout timer if (message == "MIN") { llSay(0, "Min Light"); llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, LIGHT_FACE, 0.25, PRIM_POINT_LIGHT, TRUE, LIGHT_COLOR // START COLOR , 0.25 // START INTENSITY , 5.0 // START RADIUS , 1.0 // START FALLOFF ]); } else if (message == "MID") { llSay(0, "Mid Light"); llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, LIGHT_FACE, 0.50, PRIM_POINT_LIGHT, TRUE, LIGHT_COLOR // START COLOR , 0.5 // START INTENSITY , 10.0 // START RADIUS , 0.5 // START FALLOFF ]); } else if (message == "MAX") { llSay(0, "Max Light"); llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, LIGHT_FACE, 1.00, PRIM_POINT_LIGHT, TRUE, LIGHT_COLOR // START COLOR , 1.0 // START INTENSITY , 20.0 // START RADIUS , 0.0 // START FALLOFF ]); } else if (message == "ON") { llSay(0, "Light is ON"); llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, LIGHT_FACE, 1.00, PRIM_POINT_LIGHT, TRUE, LIGHT_COLOR // START COLOR , 1.0 // START INTENSITY , 20.0 // START RADIUS , 0.0 // START FALLOFF ]); } else if (message == "OFF") { llSay(0, "Light is OFF"); llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, ALL_SIDES, FALSE, PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR // COLOR , 0.0 // INTENSITY , 0.0 // RADIUS , 2.0 // FALLOFF ]); } else if (message == "DELETE") { llSay(0, "Script Deleted"); llRemoveInventory(llGetScriptName()); } else if (message == "BLINK") { llSay(0, "Blinking"); llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, LIGHT_FACE, 1.00, PRIM_POINT_LIGHT, TRUE, LIGHT_COLOR // START COLOR , 1.0 // START INTENSITY , 20.0 // START RADIUS , 0.0 // START FALLOFF ]); llSleep(1); llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, ALL_SIDES, FALSE, PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR // COLOR , 0.0 // INTENSITY , 0.0 // RADIUS , 2.0 // FALLOFF ]); // BLINKING STUFF } else if (message == "AUTO ON") { llSay(0, "Automatic light on"); sun_position = llGetSunDirection(); sun_height = sun_position.z; if(sun_height < 0.0) { llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, LIGHT_FACE, 1.00, PRIM_POINT_LIGHT, TRUE, LIGHT_COLOR // START COLOR , 1.0 // START INTENSITY , 20.0 // START RADIUS , 0.0 // START FALLOFF ]); } else { llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, ALL_SIDES, FALSE, PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR // COLOR , 0.0 // INTENSITY , 0.0 // RADIUS , 2.0 // FALLOFF ]); } } else if (message == "AUTO OFF") { llSay(0, "Automatic light off"); llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, ALL_SIDES, FALSE, PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR // COLOR , 0.0 // INTENSITY , 0.0 // RADIUS , 2.0 // FALLOFF ]); } //else if (message == "Button") //{ //do something //} } } timer() //VERY IMPORTANT menu timeout { if (iTouched > 1) { ++iTouched; } if (iTouched > 30) { iTouched = 0; llListenRemove(menu_handler); } } } Link to comment Share on other sites More sharing options...
Rolig Loon Posted June 14, 2019 Share Posted June 14, 2019 Step aside for a while, take a long walk to clear your head, then come back and think this through. You have all the parts you need now. We're not going to write your script for you. 2 Link to comment Share on other sites More sharing options...
Sunbleached Posted June 14, 2019 Author Share Posted June 14, 2019 1 hour ago, Rolig Loon said: Step aside for a while, take a long walk to clear your head, then come back and think this through. You have all the parts you need now. We're not going to write your script for you. Thank you very much! That's exactly what I am going to do! The only thing makes me sad is if I may never come back to it and if all your efforts were in vain... But the script is good for me even as is - without blinking and automation! Thank's! 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