Jump to content

animated chasing lights


Richard Lacombe
 Share

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

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

Recommended Posts

Hi everyone, I would like a few tips on how to create an animated string of lights such as those chasing around a movie marquee. I downloaded Genetica 3.6 and am getting familiar with this program through tutorials and vids but from what I can tell, its going to take a while to master this program. I am a flash developer in RL  and can create the gif using Flash, however, I have no clue if it will work in SL if exported as an animated gif or png. Any recomendations.  The chaser would be 5 gif images in sequence 1, 2, 3, 4 ,5 , (same marquee bg, only lights chase in one direction per image.  If I use Genetica, It can be done as a seamless animated  texture which I can repeat as many times as needed along the obect.(s)

Thanks.!

-Richard Lacombe

P.S.   I would even take an inworld class if there was one on this subject.

Link to comment
Share on other sites

Five textures loaded into the contents tab of the object and a script similar to the one below would accomplish what you describe.

--Cinn

integer choice=0;

default
{
    state_entry()
    {
        
        llSetTimerEvent(0.5);
    }
    
    on_rez(integer num)
    {
        llSetTexture("fe8da76a-4ccb-af42-60d5-2347b3c6e7f2", ALL_SIDES);
    }
    
    timer()
    {
        integer number = llGetInventoryNumber(INVENTORY_TEXTURE);
        choice = choice + 1;
        if (choice == number) choice = 0;
        string name = llGetInventoryName(INVENTORY_TEXTURE, choice);
        llSetTexture(name, ALL_SIDES);
    }
}
 

  • Like 2
Link to comment
Share on other sites

If you already have an animated GIF, what you really need is a way to convert it to a multi-frame TGA and then use llSetTextureAnim to animate it.  The service at http://www.peregrinesalon.com/2009/01/05/major-upgrade-to-animated-gif-to-animated-sl-texture-conversion-tool-v04/ will do that (although they seem to be offline right at the moment).  Even if you don't use the Peregrine Salon service, it's an easy matter to make a multi-frame TGA yourself.  Then it's a trivial bit of scripting to use http://wiki.secondlife.com/wiki/LlSetTextureAnim.

Link to comment
Share on other sites

I did use Genetica to create the 16 frames 4x4.  The strange thing is that if I uncheck stretch textures and stretch the object, the image still stretches along with the object regardless of whether I repeat horizontally or by meter.  I will need to resort to these recommendations and see what happens. I am determined to get this right...

Link to comment
Share on other sites


Richard Lacombe wrote:

I did use Genetica to create the 16 frames 4x4.  The strange thing is that if I uncheck stretch textures and stretch the object, the image still stretches along with the object regardless of whether I repeat horizontally or by meter.  I will need to resort to these recommendations and see what happens. I am determined to get this right...

Unfortunately, llSetTextureAnim resets the texture repeats to 1x1 when it's running, no matter what repeats you've set on the prim (or by using llSetPrimitiveParams or whatever).   llSetTextureAnim overrides everything and makes it 1x1 (and doesn't put reset them when it's finished, so it's sometimes necessary to switch between a static and an animated texture, if your device has an on/off switch.

There are supposed to be some work-rounds for this, but I've never been able to get them to work satisfactorily and have always ended up making a texture to fit the size and shape of the item to which I want to apply the texture animation.

I know you said you've made your own, but if anyone else reading this wants to convert an animated gif to a suitable .tga while the site Rolig mentions is offline, if you use Windows, there's a handy free tool by Goonta Maltz that does exactly the same thing you can dowload, the Gif to Second Life Animated Texture Programme

 

Link to comment
Share on other sites

Innula said:

"I know you said you've made your own, but if anyone else reading this wants to convert an animated gif to a suitable .tga while the site Rolig mentions is offline, if you use Windows, there's a handy free tool by Goonta Maltz that does exactly the same thing you can dowload, the Gif to Second Life Animated Texture Programme"

 

Innula that is a great little program, thank you for sharing. I make a lot of animated frame textures, and until now have had to position every frame exactly, one after the other to make the final jpg. When one is dealing with 256 frames, let me tell you, that is a time consuming and frustrating thing to do, especially after you have made it, uploaded it, and find that one frame is out of alignment by one pixel..  :)

 

I would also add, that if one is animating lights, its possible to use LL scripting to change the colour at random..  I.E one makes the light in 24 bit greys, or a desired base colour, and uses black or white as the transparency background.. so what one ends up with  doesnt need to be animated if all one wants is for it to change colour..  the LL script does that..

It is also possible using LL Scripting to alter the frame rate, start frame and end frame and which part of each frame is shown ( one frame can have for example 4 different images in it ), and movement of the prim the animation is on, at random, which means one can have a light that sparkles sometimes , but not all the time, changes colour,and turns at random.. i say random, but, in effect its random from a list of possible numbers.. since that works reliably.. even so it sometimes results in unexpected events.. and needs tweaking to make good..  I have a bird flying anim, that uses random prim rotation ( an animated scupted prim) that occasionaly decides to rotate very fast.. :)   because getting the time ( chosen at random from a list or a maths calculation, ) gives such a result.

What i have been able to do so far... is have an animation start, then it changes, at random each cycle ( time ) to another state,  Setting the time, is dependent on many things.. especially if the actual prim the animation is on, is rotating at random.. i.e.. start in state A, run at 16 frames a second, then run for 5 seconds in state B , then run for 5 seconds in state C , then return to State A, and continue.  States A, B and C  can be random..

Because such scripting is time consuming and made to fit the intended use, i am not going to post an example here.. but i will share, if anyone wants to do such stuff.

 

 

 

Link to comment
Share on other sites

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