Sari6t Posted February 12, 2017 Share Posted February 12, 2017 I am looking for a sim friendly way to accomplish this. I can do it and lag a sim likely from what Ive read using timers and loads of scripts but I am not doing that, Here is the question.I have a row of dome lights. lets say 4 for the example. They are mesh and the dome has a face number of 0 on each. What I am wondering is this. Is it possible to use a texture that animates to create the effect of a flashing series of lights in an efficient manner?Meaning one script to control the works verses one script per button.I can already control the primparams across the set but to make them flash is where timers would come in and ...well I have a lot of these potentially. anyway thanks in advance. :) Link to comment Share on other sites More sharing options...
ChinRey Posted February 12, 2017 Share Posted February 12, 2017 Yes, it is possible. Ideally you would want to use regular texture animations for it but I doubt you can get them to flash in sync that way. The second best solution is an llSetLinkPrimitiveParamsFast(); in a timer event. Use PRIM_LINK_TARGET to change several prims in the linkset with a single function. Link to comment Share on other sites More sharing options...
Dora Gustafson Posted February 12, 2017 Share Posted February 12, 2017 Texture animations are by nature not synchronized, but if they are loaded to the viewer at the same time they are. For instance if you tp to a site and can see all the animated faces they will most likely be in sync The chance for sync is even better if all faces use the same texture (it is only loaded one time) :smileysurprised::smileyvery-happy: Link to comment Share on other sites More sharing options...
Sari6t Posted February 12, 2017 Author Share Posted February 12, 2017 Oh yes thats what I needed to understand. Thank you. I can see from the wiki that the target will allow for what I need potentially. I will experiment with that. Thank you Link to comment Share on other sites More sharing options...
Qie Niangao Posted February 12, 2017 Share Posted February 12, 2017 Not particularly germane to scripting, but nonetheless possibly of interest in this application: a regular texture (diffusemap) can be partially fullbright according to its alpha channel used as an "emissive mask". This is useful for gradations of "full brightness" or in situations such as this with texture animation over surfaces switching between light-on and light-off conditions. I wrote a bit about it in a October 2015 column for the Bay City Post (search for "FullBright Scholars") which cites the wiki article on alpha modes. [EDIT: Oops, that's October 2015, not 2016 as I typo'd before.] Link to comment Share on other sites More sharing options...
ChinRey Posted February 12, 2017 Share Posted February 12, 2017 Dora Gustafson wrote: Texture animations are by nature not synchronized, but if they are loaded to the viewer at the same time they are. Yes, they should be. I'm not absolutely sure I'd trust it but it's worth a try. If I understand the OP right, she wants a series that switches one after another and for that you need to use the start parameter of the llSetTextureAnim(); function to make the different lights star at different places in the cycle. The whole function looks like this: llSetTextureAnim( integer mode, integer face, integer sizex, integer sizey, float start, float length, float rate ); Now, if you have four lights and want one of them to be on at any given time you want a texture with four frames, one "on" frame and three identical "off" frames. With the frames in a 2x2 pattern on the texture and switch rate of - let's say one second, the functions would look like these: llSetTextureAnim( ANIM_ON | LOOP, 0,2,2, 1, 4,1); llSetTextureAnim( ANIM_ON | LOOP, 0,2,2, 2, 4,1); llSetTextureAnim( ANIM_ON | LOOP, 0,2,2, 3, 4,1); llSetTextureAnim( ANIM_ON | LOOP, 0,2,2, 4, 4,1); It shouldn't be necessary to keep the scripts in the lights btw. Texture animation is a prim porperty and only needs a script to start, not to run. I have heard of, and even seen myself, unscripted texture animations stopping for no apparent reason though. Link to comment Share on other sites More sharing options...
Sari6t Posted February 13, 2017 Author Share Posted February 13, 2017 Thank you for such a detailed response. I have new ways to approach this now. The texture stopping is odd, it has happened to me and Im not sure why it does that. But at any rate this is great help. I have a bevy of option. Thanks again. 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