Jump to content
Sign in to follow this  
Sari6t

Is this possible?

Recommended Posts

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. :)

 

 

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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:

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

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.]

Share this post


Link to post
Share on other sites


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.

Share this post


Link to post
Share on other sites

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. 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...