Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Temp on rez flames?

Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
08-26-2006 07:02
A lot of things in SL use animated flames. Fireplaces, Tiki-torches, candles... I have an idea for making those flames temp on rez, for some items I would like to make and sell. I've worked out a lot of the details, but I am wondering if the coding example that I found is more complex than it needs to be for my purposes.

Does it make sense, and really use less system resources, if those flames are generated as temp-on-rez? If I have 8 torches around my deck, and each is using 4 prims to make the animated flames, I would save 32 prims on my parcel prim count. But would the necessary temp-on-rez scripting cause too much lag to be worth it?

In particular, I have a Tiki Torch that I designed, and that I have been selling. Right now, the whole thing is phantom, because the planes of the animated flames stick out too far for them to be done otherwise. It uses fullbright on two flame planes and local lighting on two others, so it looks nice whether local lighting is enabled or not. But it's always 'lit', and there is no way to extinguish the torch.

I would like to script a new version of the torch to do the following.

* Anyone can touch the torch to get a menu.
* Menu alows anyone to extinguish the torch if it is lit, or to light it by rezzing an appropriate 4-prim, phantom, temp-on-rez flame object just above the position of the torch.
* Menu allows Owner to set a non-zero chat channel to link multiple torches, so any one torch in the sim on the same channel can control the others that this owner has in place. If this feature is turned off, it has no open listens.

Optional goodness, if possible.

* Auto-extinguish: Menu choice toggles auto-extinguish on or off. If this feature is on, while a flame object is being ressed, the source object scans area once per 10 minutes to see if any avatars are present. If no one is around for two consecutive scans, turn off the flames (stop using resources for temp on rez), and stop scanning. If auto-extinguish is off, the torch continues to generate flames until extinguished with the menu command.

=============

In the script library, I found the "Temp Prim Rezzer, by Eata Kitty, which seems to do a fair amount of what I would want. But it also has a lot of code that looks to me like it would be unnecessary, if scripting the object for a specific purpose, like my Tiki torch.

I would like to make the script something that could also be adapted for making candles, oil lamps, fireplaces, and other things that use flames and which don't always need to be lit.

Plan B : ;)

If all that is just too laggy or too much hassle to code, I suppose I could just script the current torch to toggle the visibility of the flame prims. But of I do that, will the 'hidden' flames still be a local lighting source? Or to put it another way, would it keep glowing if the flames are 100% alpha, and I don't also toggle the local lighting property of the flame prims?
_____________________
Sorry, LL won't let me tell you where I sell my textures and where I offer my services as a sim builder. Ask me in-world.
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
08-26-2006 07:35
Rezzing, even temp on rez objects is a fair old load on the sim. Asset servers to talk to and so on... I've never actually tested it with repeats of the same temp on rez prim, but it does hit the sim.

Not a lot per each, but definitely does. I would guess, and it is just a guess, that your system rezzing several prims per torch each minute won't be that friendly at all I'm afraid.

Rezzing and killing a permanent 'flame' when turned on, and killing it when turned off would at least only hit the prim once per time. It would also avoid your plan B issues. But, to answer them - a primtive set with the local light parameters continues to emit even when 100% transparent, but a slightly longer llSetPrimitiveParams call will let you make it transparent and turn the lighting off, and back on again, so it's not hard to do.
_____________________
Eloise's MiniMall
Visit Eloise's Minimall
New, smaller footprint, same great materials.

Check out the new blog
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
08-26-2006 12:11
Thanks Eloise,

That is one reason why I brought the subject up here - to see if I was overlooking a more resource-friendly method. I haven't used Temp-on-rez for anything yet, so I was unsure of its actual impact on the sim. I'm very sensitive to issues that cause a lot of lag, because my own system is only barely capable of running SL.

I've used llSetPrimitiveParams in other scripts, and will probably try that method first. Thanks for the feedback!
_____________________
Sorry, LL won't let me tell you where I sell my textures and where I offer my services as a sim builder. Ask me in-world.
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
09-11-2006 10:09
Well, what I finally resorted to was to to have my 4-prim un-lit Tiki torch use a touch-activated script that uses llRezObject to produce a 2-prim phantom animated flame object on top of it when the torch is lit, and then it uses a listen on a non-zero channel in the rezzed flame to extinguish the flame via an llDie command that eliminates the 2-prim flame. A second timer script in the flame object does an llDie after 1 hour (when the torch 'runs out of lamp oil') to eliminate the 2-prim flame and the open listen if the torch burns for an hour.

End result: When the torch is un-lit, it uses only 4 prims, has no open listens, and requires no sensors. You can touch the torch to light it, and then it has 6 prims total, and has one open listen on a non-zero channel, and one timer script, which only lasts for 1 hour unless someone actively re-lights the torch. Both planes of the flame object are local light sources.

I think that is about as resource-friendly as I can manage to make it.

Incidentally, in dissecting the torch, I found an unexpected script embedded in the animated flame that I had adapted from some freebie Linden object. It had a 'candle flame' script in it that listened for the word 'blow' on channel 0, and de-rezzed the flame when it heard that. So my earlier 8-prim torch design, that had the flame as a linked part of the torch, actually vanished the torch entirely if someone said 'blow' near it! *laughs* Good thing I hadn't sold any like that!
_____________________
Sorry, LL won't let me tell you where I sell my textures and where I offer my services as a sim builder. Ask me in-world.