Olympia Rebus
Muse of Chaos
Join date: 22 Feb 2004
Posts: 1,831
|
05-08-2005 13:10
I'm building something which includes twinking lights. I can think of several ways to do it. Which is the most efficient? - prims set as light and equiped with a black frame, white frame animated texture
- prims set to have paramaters set from light to wood via a timer (or a counting loop)
- specific sets of prims flashing "on" (either changing from wood to light, or always light and their color changing from white to black) or "off " from signals from a main script.
Is any way more effiecnt than the other? I'm more concerned with something that runs effieciently, as oppossed to something easy to throw together. Thanks in advance
|
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
05-08-2005 14:28
Depends how fast they need to flash. I've run through this same situation before. Your first option is the most efficient, but doesn't look good for larger lights. And with local lighting enabled, the light will always be on.
Your second two options may not work well because there's a lengthy script delay when setting the material type.
The method I chose used a particle system. I rendered tiny particles that only lasted a fraction of a second each. This produced a nice twinkle. However, my further complexity was to create the wig-wag effect of police lights... two left flashes, then two right, then back to the left. That required the lights to communicate with each other in sequence. Left would do it's thing, then tell right to do it's thing, cueing back to left afterwards. That's a good way to make a series of Christmas tree lights as well.
|
Olympia Rebus
Muse of Chaos
Join date: 22 Feb 2004
Posts: 1,831
|
05-08-2005 19:25
Thanks DoteDote. 
|
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
|
05-12-2005 12:40
I dont know if I am 100% on the same subject but this is what i came up with Make up a sprite sheet of a light going off example  Make a light based prim and apply texture insert basic animation script default { state_entry() { llSetTextureAnim(ANIM_ON |PING_PONG| LOOP, ALL_SIDES, 2, 7, 0, 0, 10.); } } and you end up with this, which also works ok on other shapes  <-much lower quality than realtime its also ez to compsoite images to 1 texure out of world for blinky signs or whatever 
|
Upshaw Underhill
Techno-Hobbit
Join date: 13 Mar 2003
Posts: 293
|
05-12-2005 22:05
Only one line to add to Osgeld's excellently small impact script: default { state_entry() { llSetTextureAnim(ANIM_ON |PING_PONG| LOOP, ALL_SIDES, 2, 7, 0, 0, 10.); llRemoveInventory(llGetScriptName()); } } This removes the script after setting it animated. The animation of the texture is actually stored as a byte or three of info in the prims binary description so therefore doesn't have to be re-initialized even if taken in and out of inventory. Even a non-active script takes a cycle of the sims time to check to make sure the script hasn't become active again. Plus, since texture animation is client-side it has no effect on the sim. L8r, UU P.S. tip in a tip: create this script in your inventory then drag it to the prim... otherwise you'll get really tired of typing it in 
|