Showing posts with label light. Show all posts
Showing posts with label light. Show all posts

Sunday, December 14, 2014

Script: Candles - Animated Texture Edition

[Black Tulip] Candles - Animated Texture Edition (Script for Designers)

(c) 2014 Auryn Beorn

Candles - Animated Texture Edition script in Marketplace.

Thank you for having considered this script to enhance the quality of your products. Please read the following instructions carefully, especially the ones explaining which permissions to apply to the scripts for the next owner. Failure to complete this task INVALIDATES the license governing your use of this set of scripts. Should you have problems, please fill the scripts assistance form, explaining what you did and what happened, and I'll get back to you.

IMPORTANT!
The script contains a check to prevent accidental give-aways. If you haven't set permissions correctly in your inventory, then the script will self delete when you try to use it. The best way to ensure you set permissions correctly is by doing it NOW in your inventory.

TABLE OF CONTENTS



FEATURES


  • Start/Stop at the same time:
    • Candle flames
    • Sound
    • Light (SL light point)
  • Start/Stop independently the effects listed above when the global effect is ON
  • Change the light color, radius, intensity and fall off of this SL-light point.
  • Change the sound volume.
  • Personalize the SL light point colors to show on the menu, in the configuration notecard.
  • Add up to three extra buttons to call other scripts.
  • Menu timeout to reduce lag - no open listeners after timeout (0.001 ms script time when idle)
  • Final user can change access to owner only/everybody/group
  • Menu can be integrated into tools such as MLPv2, AVsitter... (AVsitter version 2 works too!)

NOTE: It is NOT mandatory to add a sound. The included sample object, indeed, has no sound clips at all.


SET UP: WHAT SCRIPT TO USE?


There are two scripts contained in your folder:

[Black Tulip] Candles - Animated Texture Edition
[Black Tulip] Candles - Animated Texture Edition [MODULE]

We need to use ONLY ONE of them in a given product.

Which one? How to choose?

The [MODULE] version, as explained in the THE MAIN SCRIPT, AS A MODULE YOU CAN USE FROM ANOTHER SCRIPT section, will allow you to use this script integrated with other scripts that allow sending linked messages, such as the Multi Love Pose (MLP) or AVSitter for multiavatar, multianimation devices.

So, depending on what we need, we'll use the following script as main one:

Normal use - We want the menu to show when the object is clicked:
[Black Tulip] Candles - Animated Texture Edition

The menu should show up after clicking a button from another script, like MLP, AVSitter:
[Black Tulip] Candles - Animated Texture Edition [MODULE]

Once we've chosen the right main script, we have to set some descriptions in the primitives of the object, following the instructions below.


SETUP: CHANGE PERMISSIONS FOR NEXT OWNER


Check the following section on this page, knowing that each [Black Tulip] ASSET refers to the following scripts:

[Black Tulip] Candles - Animated Texture Edition
[Black Tulip] Candles - Animated Texture Edition [MODULE]


SETUP: EXAMINING THE SAMPLE OBJECT


With this script, you may control the following:

  • One light point
  • As many animated-texture flames as you could need

We'll understand better what this means by examining the [Black Tulip] Candles - SCRIPTED SAMPLE object. Rez it, and let's follow this explanation.

First of all, click it to get the menu. You'll see, as soon as you select ON/OFF to start all the effects, that the flames show and are animated, the sound is on (if there's a sound and the selected volume isn't Off, of course :-) ) and the SL light emits. But there it is only one prim that will be the SL light point.

How is this done? Let's examine the object. Right click the sample object to edit it, then click the "Content" tab. When we do this, we're inspecting the contents of the ROOT PRIM. You should see:

  • The [Black Tulip] Candles - Animated Texture Edition script
  • The [Black Tulip] Candles - Animated Texture Edition ~CFG~ configuration notecard
  • A sample script, [Black Tulip] Particle Snow Example for Buttons, which is absolutely not necessary to make your flames work. It's included to illustrate how to add extra buttons with extra functionality, but by all means remove it and the associated entry menus in your own objects.

What does this mean?
That all the necessary assets, this is, candles script, the configuration notecard, and soundclip if any, have to be dropped into the ROOT PRIM. This is the default when we simply right click an object, then select "Edit" from the menu.

Having this clear, now let's examine the sample object in detail. It consists of four linked prims: different candlesticks and candle setups, all of them prepared to hold texture animated flames. Right click to edit, click "Edit linked", and now:

  • Inspect the root prim, which should be the three candles on a plate with an adornment. This is the SL-light point.
  • Inspect now the description of this prim. It says:

candleFlame;3;4;4;15;2#light

  • This means, this prim contains animated candle flames, and is also the SL-light point. Later we go in more detail about how the description is built exactly.
  • Inspect now any of the other child prims (they will highlight in blue). Inspect the description. It says:

candleFlame;3;4;4;15;1

  • This means, each of these prims will have animated textures. Later we go in more detail for this.

Now that we've inspected the object, let's study the details of the descriptions format.


SETUP: FORMAT OF THE DESCRIPTIONS


To tell the script which of the linked primitives are relevant (particle effects, animated texture effects or SL-light point), we have to write specific words (CASE SENSITIVE) in the DESCRIPTION of each primitive (DESCRIPTION - not the name, don't confuse them!)

The format of the descriptions is as follows:

parameter

or

parameter1#parameter2

It doesn't matter the order the parameters are written, as long as a # character separates them.

As we've seen, when inspecting the sample object, the following parameter-keyword would indicate that the prim is a SL-light point:

light

There is another possibility (explained below): animFire.

If we want a primitive having, for example, animated candle flames, and being at the same time a SL light point, then we write the:

candleFlame;3;4;4;15;2#light

combination. The # character will separate parameters, and it does not matter the order we choose to write the parameters.

This:

light#candleFlame;3;4;4;15;2

would have the same effect.


The possible descriptions this script recognizes are:

Expected description for a light point: light
Expected description for animated-texture flames: candleFlame (there's more to this one, explained next)

Set the DESCRIPTIONS according to these simple rules, drop the main script and the configuration notecard in your linked object, and your object is ready to go!

NOTE: Setting the description for the animated-texture candle flames takes a little more work. We explain this now.

Animated candle flames in SL are often created by animating a texture, which consists of a texture containing different "frames" of the fire animation (we call this "cell animation")

Whenever we want an animated texture, we have to tell the script:

  • The type of texture animation
  • The speed (low numbers for a slow animation, high for a faster animation)
  • In which face the animation should play (or if it should play in all the faces at once)

Apart from this, when we want a cell animation, the script needs to know how many vertical frames (we call this x) and how many horizontal frames (we call this y) the texture contains.

To avoid entering into technical details that may confuse at this point, let's just see the description format when we want animated textures as flames, and then a very common example that, most likely, will be the one you will use :-)

General format:

candleFlame;code_for_animation_type;x;y;speed;face

candleFlame
This is the code word for the script. Write it as is. Case sensitive!

code_for_animation_type
We're using cell animation in this case, so: 3

x
For cell animation: we type here how many VERTICAL frames the animation has

y
For cell animation: we type here how many HORIZONTAL frames the animation has

speed
Here we type the frames per second to show for this cell animation

face
-1: The animation will be applied to ALL THE FACES of the prim
face_number: The animation will be applied to the face face_number of the prim (you type here the face number!)

EXAMPLE


candleFlame;3;4;4;9;-1

This is a cell animation (code 3) having x = 4 vertical frames, y = 4 horizontal frames. The speed is 9 frames per second. It will show in face -1, which is the code for ALL THE FACES of the prim.

(Why just one or all faces? This is a scripting limitation. The animated texture can work only in all faces at once, or in just one of them. If you hear otherwise than one-or-all at once, it's true that there's a trick, but it's not a reliable one, and may get "fixed" by LL at any time!)


THE CONFIGURATION NOTECARD


The configuration notecard is named [Black Tulip] Candles - Animated Texture Edition ~CFG~, and it allows us to:

  • Write comment lines, for our own clarifications. Comment lines always begin with a # character.
  • Define what colors we want to be shown as menu options. for the SL light point.
  • Define which extra buttons we want to add to the menu, to call other scripts from them, having a maximum of 2 buttons.

With the exception of comment lines, all of the other lines have the structure:

parameter = value

The accepted parameter keywords are:

soundIn here, we specify the name of a soundclip that will sound when the SL light point turns on, if any
buttonIn here, we decide which extra buttons will show up in our menu, and what other scripts they will call

Now, let's explain how the values are written and what they mean.

lightColor = button_label|color_code

The SL light point may have a color we specify. There's a submenu entry, L.Color, that will show a list of colors we define in the notecard. We define the colors by specifying, separated by the | character, what name should show on the menu, and the actual color code for that menu entry.

What text will show on the menu button?
That is button_label in the notecard line.
IMPORTANT: It should not have more than 24 characters.

How do we write the color code? Check HOW TO WRITE THE COLOR CODE and examine the configuration notecard with the examples.


button = button_label|link_msg_number|link_prim|text_to_send|show_menu_again

This one is a little more complicated, and it is only required if you plan to add extra buttons that call other scripts. Skip this part if you are not doing this for now, making sure that no button lines are in the configuration notecard.

In order to "call", "execute" or "launch" another script from our main script, we have to use a communication mechanism called linked messages. This is a mechanism that allows scripts to send messages to other scripts in the same linked object, and to listen to possible messages coming from other scripts in the same linked object.

When we use a button line, it means that it will add a button on the menu. This button menu, upon click, will SEND a message to ANOTHER SCRIPT that could be in ANY of the prims of our linked object. That another script should be listening, and will expect to know from us:

A code number that should be specified in the script documentation. That is link_msg_number in the notecard line.
A message. That is text_to_send in the notecard line.
A UUID. The barbeque controller script sends the UUID of the avatar having clicked the menu.
If the main menu should show up after executing the action. That is show_menu_again in the notecard line. We type there 0 if the menu should not show up after the action, and we type 1 if the menu should show again after the action. To better understand this, check what happens when clicking the example Snow Red, Snow Green and Stop Snow do. Snow Red and Snow Green show the candles menu again after calling the particles script: if you check the configuration notecard, they have a value of 1 for show_menu_again. When clicking Stop Snow, the candles menu doesn't show. If you check the configuration notecard, it has a value of 0 for show_menu_again.

Apart from this, the main script needs a couple more data items to know about:

What text will show on the menu button?
That is button_label in the notecard line.
IMPORTANT: It should not have more than 24 characters.

To what primitive this message is being sent.
That is link_prim in the notecard line.

Unless your application has very specific requirements, this link_prim code will be one of the following, meaning:

1This will send the message to the root prim IF our object consists of more than one prim linked (Or there's an avatar sitting on a single-prim item)
-1This will send the message to all prims in the linked object
-2This will send the message to all prims BUT the one containing the SENDER (this controller) script
-3This will send the message to all child prims (that is, all prims BUT the root prim)
-4This will send the message to the prim where the SENDER (this controller) script is in (-4 could be seen as the opposite code of -2)

Please check the documentation of the other scripts you wish to send linked messages from this one, to make sure of how exactly you should write the line. The lines explained above are the generic ideas valid for every script accepting linked messages, but this documentation cannot replace any other script's documentation for their own interface. Check with the creator of the other script how this should be done.


SETUP: THE MAIN SCRIPT, AS A MODULE YOU CAN USE FROM ANOTHER SCRIPT

Check the following section on this page, knowing that:

[Black Tulip] ***Script Name*** [MODULE] refers to [Black Tulip] Candles - Animated Texture Edition [MODULE]
CODE_NUMBER is -38640983
NAME_ON_MENU is Candles

AVSitter line looks like: BUTTON Candles|-38640983
MLP line looks like: LINKMSG Candles | 1,-4,-38640983,fromMLP

You have example AVpos and .MENUITEMS notecards with your purchase. Remember that this works too with AVSitter 2.


TROUBLESHOOTING


Q: I click the light/animated texture options on the menu, but no visible outcome shows. What's going wrong?

A: Most likely, there's not a light source/animated textures source defined in the object. Double-check the DESCRIPTION of the prim you expect to be a SL light point/particles source/animated texture.


Q: I hear no sound when I change the volume from the menu. What could be going wrong?

A: Make sure that there's a sound clip on the Content tab of the prim with the script.


For any other problem not described here, please give a complete description of your issue in the following online form.

I'll get back to you after I have read your report and replicated your issue inworld, according to your description of it. Please, be detailed.

-- Auryn Beorn

Monday, November 10, 2014

Script: Coffee House Sign Switch

[Black Tulip] Coffee House Sign Switch (Script for Designers)

(c) 2014 Auryn Beorn

Coffee House Sign switch script in Marketplace.

Thank you for having considered this script to enhance the quality of your products. Please read the following instructions carefully, especially the ones explaining which permissions to apply to the scripts for the next owner. Failure to complete this task INVALIDATES the license governing your use of this set of scripts. Should you have problems, please fill the scripts assistance form, explaining what you did and what happened, and I'll get back to you.

IMPORTANT!
The script contains a check to prevent accidental give-aways. If you haven't set permissions correctly in your inventory, then the script will self delete when you try to use it. The best way to ensure you set permissions correctly is by doing it NOW in your inventory.

TABLE OF CONTENTS



FEATURES


  • Show the Open/Closed text by selecting on the menu.
  • Turn glow on/of when the open/closed text is visible.
  • Change the light color, radius, intensity and fall off of the SL-light point.
  • Menu timeout to reduce lag - no open listeners after timeout (0.001 ms script time when idle)
  • Final user can change access to owner only/everybody/group


SETUP: CHANGE PERMISSIONS FOR NEXT OWNER


Check the following section on this page, knowing that each [Black Tulip] ASSET refers to the following script:

[Black Tulip] Coffee House Signs - Switch


SETUP: EXAMINING THE SAMPLE OBJECT


With this script, you may control the following:

  • One light point
  • One prim that should have at least two different faces, one to show the Open text, the other one to show the Closed text

We'll understand better what this means by examining the [Black Tulip] Coffee Sign - SCRIPTED SAMPLE object. Rez it, and let's follow this explanation.

Right click the sample object to edit it, then click the "Content" tab. When we do this, we're inspecting the contents of the ROOT PRIM. You should see:

  • The [Black Tulip] Coffee House Signs - Switch script

What does this mean?
That the script has to be dropped into the ROOT PRIM. This is the default when we simply right click an object, then select "Edit" from the menu.

Having this clear, now let's examine the sample object in detail. It consists of two linked prims: a mesh neon sign having both the Open and Closed texts, in separate faces (only one will show, but with the menu you can see the other one) and a white, regular box, which is the root prim. Right click to edit, click "Edit linked", and now:

  • Inspect the root prim. It only contains the script.
  • Inspect the mesh sign prim.
  • Inspect now the description of this prim. It says:

sign;2;0.1;0;3;0.1;0#light

There are two parts in this description, separated by the # character. This means, this prim will feature both effects (open/closed sign and SL light point).

Now that we've inspected the object, let's study the details of the description format.


SETUP: FORMAT OF THE DESCRIPTIONS


To tell the script which of the linked primitives are relevant (open/closed text effects, SL-light point), we have to write specific words (CASE SENSITIVE) in the DESCRIPTION of each primitive (DESCRIPTION - not the name, don't confuse them!)

The format of the descriptions is as follows:

parameter

or

parameter1#parameter2

It doesn't matter the order the parameters are written, as long as a # character separates them.

As we've seen, when inspecting the sample object, the following parameter-keyword would indicate that the prim is a SL-light point:

light

There is another possibility, which tells that the primitive contains the open/closed text (explained below): sign.

If we want to specify that a primitive is, at the same time, the open/closed text and a SL light point, then we write the:

sign;2;0.1;0;3;0.1;0#light

combination. The # character will separate parameters, and it does not matter the order we choose to write the parameters.

This:

light#sign;2;0.1;0;3;0.1;0

would have the same effect.


The possible descriptions this script recognizes are:

Expected description for a light point: light
Expected description for the prim containing the open/closed text: sign (there's more to this one, explained next)

When we type sign in the description, we have to add more information: what face contains the open text, what face contains the closed text, and which values of glow each of them have, when glow is turned on/off.

How do we do this?

First, we type sign, to indicate "this is the prim with the open/closed text". Then we type a semicolon. Then we type a number: the face number of the face with the open text (Click here if you don't know how to get the face number of a prim.) Then we type another semicolon. Then we type how much glow when glow is "on" for the open text (range is from 0 -no glow- to 1 -full glow-). Then, a semicolon. Then, how much glow when glow is "off" for the open text. Then, semicolon. Then, the face number of the face with the closed text. Semicolon. How much glow when glow is "on" for the closed text. Semicolon. Finally, how much glow when glow is "off" for the closed text.

The general format, perhaps easier to understand, is:

sign;openText_faceNumber;openText_glowONvalue;openText_glowOFFvalue;closedText_faceNumber;closedText_glowONvalue;closedText_glowOFFvalue

IMPORTANT: The order is relevant in this format! Do not type sign to the end, for example. Values are expected in that order.

So the following, in the sample object description:

sign;2;0.1;0;3;0.1;0

means:

  • sign indicates the prim has the open/closed text
  • The number 2 means that the open text is in face 2 of said prim
  • The number 0.1 next to it means that glow on the open text will be 0.1 when chosen to be ON
  • The number 0 next to it means that glow on the open text will be 0 when chosen to be OFF
  • The number 3 next to it means that the closed text is in face 3 of said prim
  • The number 0.1 next to it means that glow on the closed text will be 0.1 when chosen to be ON
  • The number 0 next to it means that glow on the closed text will be 0 when chosen to be OFF

Set the DESCRIPTIONS according to these simple rules, reset the script if needed, and your object is ready to go!


TROUBLESHOOTING


Q: I click the light options on the menu, but no visible outcome shows. What's going wrong?

A: Most likely, there's not a light source defined in the object. Double-check the DESCRIPTION of the prim you expect to be a SL light point. Make also sure that the light radius and intensity are not zero, by changing their values on the menu.


For any other problem not described here, please give a complete description of your issue in the following online form.

I'll get back to you after I have read your report and replicated your issue inworld, according to your description of it. Please, be detailed.

-- Auryn Beorn

Sunday, November 2, 2014

Script: Fireplaces - Particles Edition

[Black Tulip] Fireplaces - Particles Edition (Script for Designers)

(c) 2013 Auryn Beorn

Fireplaces - Particles Edition script in Marketplace.

Thank you for having considered this script to enhance the quality of your products. Please read the following instructions carefully, especially the ones explaining which permissions to apply to the scripts for the next owner. Failure to complete this task INVALIDATES the license governing your use of this set of scripts. Should you have problems, please fill the scripts assistance form, explaining what you did and what happened, and I'll get back to you.

IMPORTANT!
The script contains a check to prevent accidental give-aways. If you haven't set permissions correctly in your inventory, then the script will self delete when you try to use it. The best way to ensure you set permissions correctly is by doing it NOW in your inventory.

TABLE OF CONTENTS



FEATURES


  • Start/Stop at the same time:
    • Particle flames and smoke
    • Sound
    • Light (SL light point)
  • Start/Stop independently the effects listed above when the global effect is ON
  • Change the light color, radius, intensity and fall off of this SL-light point.
  • Change the sound volume.
  • Menu timeout to reduce lag - no open listeners after timeout (0.001 ms script time when idle)
  • Final user can change access to owner only/everybody/group
  • Menu can be integrated into tools such as MLPv2, AVsitter... (AVsitter version 2 works too!)

NOTE: It is NOT mandatory to add a sound. The included sample sound is the well known Crackling Fire from Philip Linden, which you can use if you wish in your builds.


SET UP: WHAT SCRIPT TO USE?


There are two scripts contained in your folder:

[Black Tulip] Fireplaces - Particles Edition
[Black Tulip] Fireplaces - Particles Edition [MODULE]

We need to use ONLY ONE of them in a given product.

Which one? How to choose?

The [MODULE] version, as explained in the THE MAIN SCRIPT, AS A MODULE YOU CAN USE FROM ANOTHER SCRIPT section, will allow you to use this script integrated with other scripts that allow sending linked messages, such as the Multi Love Pose (MLP) or AVSitter for multiavatar, multianimation devices.

So, depending on what we need, we'll use the following script as main one:

Normal use - We want the menu to show when the object is clicked:
[Black Tulip] Fireplaces - Particles Edition

The menu should show up after clicking a button from another script, like MLP, AVSitter:
[Black Tulip] Fireplaces - Particles Edition [MODULE]

Once we've chosen the right main script, we have to set some descriptions in the primitives of the object, following the instructions below, and modify the parameters in the configuration notecard.

This configuration notecard is named "[Black Tulip] Fireplaces - Particles Edition ~config~"
Embedded in the documentation notecard, you have a copy. Keep it in a safe place, should you need a fresh copy at any time.


SETUP: CHANGE PERMISSIONS FOR NEXT OWNER


Check the following section on this page, knowing that each [Black Tulip] ASSET refers to the following scripts:

[Black Tulip] Fireplaces - Particles Edition
[Black Tulip] Fireplaces - Particles Edition [MODULE]


SETUP: EXAMINING THE SAMPLE OBJECT


With this script, you may control the following:

  • One light point
  • Up to two particle effects (for example, sparks and smoke, particle flames and smoke, only sparks, only smoke...)

We'll understand better what this means by examining the [Black Tulip] Fireplaces Particles Edition SAMPLE object. Rez it, and let's follow this explanation.

First of all, click it to get the menu. You'll see, as soon as you select ON/OFF to start all the effects, that the sound is on (if the selected volume isn't Off, of course :-) ), the particles emit, and the SL light emits. But there it is only one prim that will be the SL light point.

How is this done? Let's examine the object. Right click the sample object to edit it, then click the "Content" tab. When we do this, we're inspecting the contents of the ROOT PRIM. You should see:

  • The [Black Tulip] Fireplaces - Particles Edition script
  • The [Black Tulip] Fireplaces - Particles Edition ~config~ configuration notecard
  • The well known sample sound called Crackling Fire

What does this mean?
That the script, the configuration notecard and the soundclip, if any, have to be dropped into the ROOT PRIM. This is the default when we simply right click an object, then select "Edit" from the menu.

Having this clear, now let's examine the sample object in detail. It consists of two linked prims: Sculpt logs and a transparent SL-box that makes its role as extra particles emitter. Right click to edit, click "Edit linked", and now:

  • Inspect the sculpted logs prim. From it, smoke particles are emitted, and this is the SL-light point.
  • Inspect now the description of this prim. It says:

smoke#light

  • This means, this prim is a particles smoke emitter, and the SL-light point. Later we go in more detail about how the description is built exactly.
  • Inspect now the transparent box. Inspect the description. It says:

flame

  • This means that this prim will emit particle flames.

Now that we've inspected the object, let's study the details of the descriptions format.


SETUP: FORMAT OF THE DESCRIPTIONS


To tell the script which of the linked primitives are relevant (particle effects, animated texture effects or SL-light point), we have to write specific words (CASE SENSITIVE) in the DESCRIPTION of each primitive (DESCRIPTION - not the name, don't confuse them!)

The format of the descriptions is as follows:

parameter

or

parameter1#parameter2

It doesn't matter the order the parameters are written, as long as a # character separates them.

As we've seen, when inspecting the sample object, the following parameter-keyword would indicate that the prim is a SL-light point:

light

There are two other possibilities (explained below): flame and smoke.

If we want a primitive having, for example, particles flames, and being at the same time a SL light point, then we write the:

flame#light

combination. The # character will separate parameters, and it does not matter the order we choose to write the parameters.

This:

light#flame

would have the same effect.


The possible descriptions this script recognizes are:

Expected description for a light point: light
Expected description for particle effect #1: flame
Expected description for particle effect #2: smoke

Set the DESCRIPTIONS according to these simple rules, drop the main script and the configuration notecard in your linked object, and your object is ready to go!


SETUP: THE CONFIGURATION NOTECARD


The configuration notecard is named [Black Tulip] Fireplaces - Full Edition ~config~, and it allows us to:



SETUP: THE MAIN SCRIPT, AS A MODULE YOU CAN USE FROM ANOTHER SCRIPT

Check the following section on this page, knowing that:

[Black Tulip] ***Script Name*** [MODULE] refers to [Black Tulip] Fireplaces - Particles Edition [MODULE]
CODE_NUMBER is -18640987
NAME_ON_MENU is Fireplace

AVSitter line looks like: BUTTON Fireplace|-18640987
MLP line looks like: LINKMSG Fireplace | 1,-4,-18640987,fromMLP

You have example AVpos and .MENUITEMS notecards with your purchase. Remember that this works too with AVSitter 2.


TROUBLESHOOTING


Q: I click the light/particle options on the menu, but no visible outcome shows. What's going wrong?

A: Most likely, there's not a light source/particles source defined in the object. Double-check the DESCRIPTION of the prim you expect to be a SL light point/particles source/animated texture.


Q: I hear no sound when I change the volume from the menu. What could be going wrong?

A: Make sure that there's a sound clip on the Content tab of the prim with the script.


For any other problem not described here, please give a complete description of your issue in the following online form.

I'll get back to you after I have read your report and replicated your issue inworld, according to your description of it. Please, be detailed.

-- Auryn Beorn

Script: Fireplaces - Animated Texture Edition

[Black Tulip] Fireplaces - Animated Texture Edition (Script for Designers)

(c) 2013 Auryn Beorn

Fireplaces - Animated Texture Edition script in Marketplace.

Thank you for having considered this script to enhance the quality of your products. Please read the following instructions carefully, especially the ones explaining which permissions to apply to the scripts for the next owner. Failure to complete this task INVALIDATES the license governing your use of this set of scripts. Should you have problems, please fill the scripts assistance form, explaining what you did and what happened, and I'll get back to you.

IMPORTANT!
The script contains a check to prevent accidental give-aways. If you haven't set permissions correctly in your inventory, then the script will self delete when you try to use it. The best way to ensure you set permissions correctly is by doing it NOW in your inventory.

TABLE OF CONTENTS



FEATURES


  • Start/Stop at the same time:
    • Fire flames
    • Sound
    • Light (SL light point)
  • Start/Stop independently the effects listed above when the global effect is ON
  • Change the light color, radius, intensity and fall off of this SL-light point.
  • Change the sound volume.
  • Menu timeout to reduce lag - no open listeners after timeout (0.001 ms script time when idle)
  • Final user can change access to owner only/everybody/group
  • Menu can be integrated into tools such as MLPv2, AVsitter... (AVsitter version 2 works too!)

NOTE: It is NOT mandatory to add a sound. The included sample sound is the well known Crackling Fire from Philip Linden, which you can use if you wish in your builds.


SET UP: WHAT SCRIPT TO USE?


There are two scripts contained in your folder:

[Black Tulip] Fireplaces - Animated Texture Edition
[Black Tulip] Fireplaces - Animated Texture Edition [MODULE]

We need to use ONLY ONE of them in a given product.

Which one? How to choose?

The [MODULE] version, as explained in the THE MAIN SCRIPT, AS A MODULE YOU CAN USE FROM ANOTHER SCRIPT section, will allow you to use this script integrated with other scripts that allow sending linked messages, such as the Multi Love Pose (MLP) or AVSitter for multiavatar, multianimation devices.

So, depending on what we need, we'll use the following script as main one:

Normal use - We want the menu to show when the object is clicked:
[Black Tulip] Fireplaces - Animated Texture Edition

The menu should show up after clicking a button from another script, like MLP, AVSitter:
[Black Tulip] Fireplaces - Animated Texture Edition [MODULE]

Once we've chosen the right main script, we have to set some descriptions in the primitives of the object, following the instructions below.


SETUP: CHANGE PERMISSIONS FOR NEXT OWNER


Check the following section on this page, knowing that each [Black Tulip] ASSET refers to the following scripts:

[Black Tulip] Fireplaces - Animated Texture Edition
[Black Tulip] Fireplaces - Animated Texture Edition [MODULE]


SETUP: EXAMINING THE SAMPLE OBJECT


With this script, you may control the following:

  • One light point
  • As many animated-texture flames as you could need (regular prims, sculpted, mesh)

We'll understand better what this means by examining the [Black Tulip] Fireplaces AnimTex Edition - Sculpt & Mesh SAMPLE object. Rez it, and let's follow this explanation.

First of all, click it to get the menu. You'll see, as soon as you select ON/OFF to start all the effects, that the flames show and are animated, the sound is on (if the selected volume isn't Off, of course :-) ) and the SL light emits. But there it is only one prim that will be the SL light point.

How is this done? Let's examine the object. Right click the sample object to edit it, then click the "Content" tab. When we do this, we're inspecting the contents of the ROOT PRIM. You should see:

  • The [Black Tulip] Fireplaces - Animated Texture Edition script
  • The well known sample sound called Crackling Fire

What does this mean?
That the script, the configuration notecard and the soundclip, if any, have to be dropped into the ROOT PRIM. This is the default when we simply right click an object, then select "Edit" from the menu.

Having this clear, now let's examine the sample object in detail. It consists of eight linked prims: Mesh planes for animated texture flames (and mesh logs), sculpt logs, sculpt fire for animated texture fire, and several SL-boxes also for flames. The sculpt logs are the root prim here. Right click to edit, click "Edit linked", and now:

  • Inspect the sculpted logs prim. This is the SL-light point.
  • Inspect now the description of this prim. It says:

light

  • This means, this prim is the SL-light point. Later we go in more detail about how the description is built exactly.
  • Inspect now any of the regular SL-boxes over the sculpted logs. Inspect the description. It says:

animFire;3;4;4;9;-1

  • This means, the SL-box will have animated textures. Later we go in more detail for this.
  • Now inspect the mesh planes just above the mesh logs. Inspect the description. It says:

animFire;3;4;4;9;0

  • Again, an animated texture.
  • Finally, inspect the sculpted fire over the sculpted logs. Inspect the description. It says:

animFire;19;0;0;0.1;-1

  • This means that this prim has animated texture.

Now that we've inspected the object, let's study the details of the descriptions format.


SETUP: FORMAT OF THE DESCRIPTIONS


To tell the script which of the linked primitives are relevant (particle effects, animated texture effects or SL-light point), we have to write specific words (CASE SENSITIVE) in the DESCRIPTION of each primitive (DESCRIPTION - not the name, don't confuse them!)

The format of the descriptions is as follows:

parameter

or

parameter1#parameter2

It doesn't matter the order the parameters are written, as long as a # character separates them.

As we've seen, when inspecting the sample object, the following parameter-keyword would indicate that the prim is a SL-light point:

light

There is another possibility (explained below): animFire.

If we want a primitive having, for example, animated flames, and being at the same time a SL light point, then we write the:

light#animFire;3;4;4;9;-1

combination. The # character will separate parameters, and it does not matter the order we choose to write the parameters.

This:

animFire;3;4;4;9;-1#light

would have the same effect.


The possible descriptions this script recognizes are:

Expected description for a light point: light
Expected description for animated-texture flames: animFire (there's more to this one, explained next)

Set the DESCRIPTIONS according to these simple rules, drop the main script and the configuration notecard in your linked object, and your object is ready to go!

NOTE: Setting the description for the animated-texture flames takes a little more work. We explain this now.

Animated fires in SL are often created by animating a texture, which can be one of two possible types:

  • A texture containing different "frames" of the fire animation (we call this "cell animation")
  • A texture designed to slide on a sculpted/mesh fire having a fire flame shape

Whenever we want an animated texture, we have to tell the script:

  • The type of texture animation
  • The speed (low numbers for a slow animation, high for a faster animation)
  • In which face the animation should play (or if it should play in all the faces at once)

Apart from this, when we want a cell animation, the script needs to know how many vertical frames (we call this x) and how many horizontal frames (we call this y) the texture contains.

To avoid entering into technical details that may confuse at this point, let's just see the description format when we want animated textures as flames, and then a couple of very common examples that, most likely, will be the ones you will use :-)

General format:

animFire;code_for_animation_type;x;y;speed;face

animFire
This is the code word for the script. Write it as is. Case sensitive!

code_for_animation_type
If you use a cell animation: 3
If you use a slide animation: 19

x
If you use a cell animation: you type here how many VERTICAL frames the animation has
If you use a slide animation: you type here the number 0

y
If you use a cell animation: you type here how many HORIZONTAL frames the animation has
If you use a slide animation: you type here the number 0

speed
Here you type the frames per second to show (if cell animation), or the speed the animation will slide

face
-1: The animation will be applied to ALL THE FACES of the prim
face_number: The animation will be applied to the face face_number of the prim (you type here the face number!)


EXAMPLES


animFire;3;4;4;9;-1

This is a cell animation (code 3) having x = 4 vertical frames, y = 4 horizontal frames. The speed is 9 frames per second. It will show in face -1, which is the code for ALL THE FACES of the prim.

animFire;19;0;0;0.1;0

This is a slide animation (code 19), so in both x and y we type the number 0. The speed is 0.1. It will show in face 0 of the prim.

It is very important to indicate the face! Nowadays, it's very likely that we will use a multi-face mesh, and we want to animate only one face in that case, not the whole mesh! :-)

(Why just one or all faces? This is a scripting limitation. The animated texture can work only in all faces at once, or in just one of them. If you hear otherwise than one-or-all at once, it's true that there's a trick, but it's not a reliable one, and may get "fixed" by LL at any time!)


SETUP: THE MAIN SCRIPT, AS A MODULE YOU CAN USE FROM ANOTHER SCRIPT

Check the following section on this page, knowing that:

[Black Tulip] ***Script Name*** [MODULE] refers to [Black Tulip] Fireplaces - Animated Texture Edition [MODULE]
CODE_NUMBER is -18640987
NAME_ON_MENU is Fireplace

AVSitter line looks like: BUTTON Fireplace|-18640987
MLP line looks like: LINKMSG Fireplace | 1,-4,-18640987,fromMLP

You have example AVpos and .MENUITEMS notecards with your purchase. Remember that this works too with AVSitter 2.


TROUBLESHOOTING


Q: I click the light/animated texture options on the menu, but no visible outcome shows. What's going wrong?

A: Most likely, there's not a light source/animated textures source defined in the object. Double-check the DESCRIPTION of the prim you expect to be a SL light point/particles source/animated texture.


Q: I hear no sound when I change the volume from the menu. What could be going wrong?

A: Make sure that there's a sound clip on the Content tab of the prim with the script.


For any other problem not described here, please give a complete description of your issue in the following online form.

I'll get back to you after I have read your report and replicated your issue inworld, according to your description of it. Please, be detailed.

-- Auryn Beorn

Script: Fireplaces - Full Edition

[Black Tulip] Fireplaces - Full Edition (Script for Designers)

(c) 2013 Auryn Beorn

Fireplaces - Full Edition script in Marketplace.

Thank you for having considered this script to enhance the quality of your products. Please read the following instructions carefully, especially the ones explaining which permissions to apply to the scripts for the next owner. Failure to complete this task INVALIDATES the license governing your use of this set of scripts. Should you have problems, please fill the scripts assistance form, explaining what you did and what happened, and I'll get back to you.

IMPORTANT!
The script contains a check to prevent accidental give-aways. If you haven't set permissions correctly in your inventory, then the script will self delete when you try to use it. The best way to ensure you set permissions correctly is by doing it NOW in your inventory.

TABLE OF CONTENTS



FEATURES


  • Start/Stop at the same time:
    • Fire flames
    • Particles (sparks/particle flames)
    • Particles smoke
    • Sound
    • Light (SL light point)
  • Start/Stop independently the effects listed above when the global effect is ON
  • Change the light color, radius, intensity and fall off of this SL-light point.
  • Change the sound volume.
  • Menu timeout to reduce lag - no open listeners after timeout (0.001 ms script time when idle)
  • Final user can change access to owner only/everybody/group
  • Menu can be integrated into tools such as MLPv2, AVsitter... (AVsitter version 2 works too!)

NOTE: It is NOT mandatory to add a sound. The included sample sound is the well known Crackling Fire from Philip Linden, which you can use if you wish in your builds.


SET UP: WHAT SCRIPT TO USE?


There are two scripts contained in your folder:

[Black Tulip] Fireplaces - Full Edition
[Black Tulip] Fireplaces - Full Edition [MODULE]

We need to use ONLY ONE of them in a given product.

Which one? How to choose?

The [MODULE] version, as explained in the THE MAIN SCRIPT, AS A MODULE YOU CAN USE FROM ANOTHER SCRIPT section, will allow you to use this script integrated with other scripts that allow sending linked messages, such as the Multi Love Pose (MLP) or AVSitter for multiavatar, multianimation devices.

So, depending on what we need, we'll use the following script as main one:

Normal use - We want the menu to show when the object is clicked:
[Black Tulip] Fireplaces - Full Edition

The menu should show up after clicking a button from another script, like MLP, AVSitter:
[Black Tulip] Fireplaces - Full Edition [MODULE]

Once we've chosen the right main script, we have to set some descriptions in the primitives of the object, following the instructions below, and modify the parameters in the configuration notecard.

This configuration notecard is named "[Black Tulip] Fireplaces - Full Edition ~config~"
Embedded in the documentation notecard, you have a copy. Keep it in a safe place, should you need a fresh copy at any time.


SETUP: CHANGE PERMISSIONS FOR NEXT OWNER


Check the following section on this page, knowing that each [Black Tulip] ASSET refers to the following scripts:

[Black Tulip] Fireplaces - Full Edition
[Black Tulip] Fireplaces - Full Edition [MODULE]


SETUP: EXAMINING THE SAMPLE OBJECT


With this script, you may control the following:

  • One light point
  • Up to two particle effects (for example, sparks and smoke, particle flames and smoke, only sparks, only smoke...)
  • As many animated-texture flames as you could need (regular prims, sculpted, mesh)

We'll understand better what this means by examining the [Black Tulip] Fireplaces Full Edition - Sculpt & Mesh SAMPLE object. Rez it, and let's follow this explanation.

First of all, click it to get the menu. You'll see, as soon as you select ON/OFF to start all the effects, that the flames show and are animated, the sound is on (if the selected volume isn't Off, of course :-) ), the particles emit, and the SL light emits. But there it is only one prim that will be the SL light point.

How is this done? Let's examine the object. Right click the sample object to edit it, then click the "Content" tab. When we do this, we're inspecting the contents of the ROOT PRIM. You should see:

  • The [Black Tulip] Fireplaces - Full Edition script
  • The [Black Tulip] Fireplaces - Full Edition ~config~ configuration notecard
  • The well known sample sound called Crackling Fire

What does this mean?
That the script, the configuration notecard and the soundclip, if any, have to be dropped into the ROOT PRIM. This is the default when we simply right click an object, then select "Edit" from the menu.

Having this clear, now let's examine the sample object in detail. It consists of eight linked prims: Mesh planes for animated texture flames (and mesh logs), sculpt logs, sculpt fire for animated texture fire, and several SL-boxes also for flames. The sculpt logs are the root prim here. Right click to edit, click "Edit linked", and now:

  • Inspect the sculpted logs prim. From it, smoke particles are emitted, and this is the SL-light point.
  • Inspect now the description of this prim. It says:

smoke#light

  • This means, this prim is a particles smoke emitter, and the SL-light point. Later we go in more detail about how the description is built exactly.
  • Inspect now any of the regular SL-boxes over the sculpted logs. Inspect the description. It says:

animFire;3;4;4;9;-1

  • This means, the SL-box will have animated textures. Later we go in more detail for this.
  • Now inspect the mesh planes just above the mesh logs. Inspect the description. It says:

animFire;3;4;4;9;0

  • Again, an animated texture.
  • Finally, inspect the sculpted fire over the sculpted logs. Inspect the description. It says:

animFire;19;0;0;0.1;-1#sparks

  • This means that this prim has animated texture and emits particle sparks.

Now that we've inspected the object, let's study the details of the descriptions format.


SETUP: FORMAT OF THE DESCRIPTIONS


To tell the script which of the linked primitives are relevant (particle effects, animated texture effects or SL-light point), we have to write specific words (CASE SENSITIVE) in the DESCRIPTION of each primitive (DESCRIPTION - not the name, don't confuse them!)

The format of the descriptions is as follows:

parameter

or

parameter1#parameter2

or even

parameter1#parameter2#parameter3


It doesn't matter the order the parameters are written, as long as a # character separates them.

As we've seen, when inspecting the sample object, the following parameter-keyword would indicate that the prim is a SL-light point:

light

There are three other possibilities (explained below): sparks, smoke and animFire.

If we want a primitive having, for example, particles sparks, and being at the same time a SL light point, then we write the:

sparks#light

combination. The # character will separate parameters, and it does not matter the order we choose to write the parameters.

This:

light#sparks

would have the same effect.


The possible descriptions this script recognizes are:

Expected description for a light point: light
Expected description for particle effect #1: sparks
Expected description for particle effect #2: smoke
Expected description for animated-texture flames: animFire (there's more to this one, explained next)

Set the DESCRIPTIONS according to these simple rules, drop the main script and the configuration notecard in your linked object, and your object is ready to go!

NOTE: Setting the description for the animated-texture flames takes a little more work. We explain this now.

Animated fires in SL are often created by animating a texture, which can be one of two possible types:

  • A texture containing different "frames" of the fire animation (we call this "cell animation")
  • A texture designed to slide on a sculpted/mesh fire having a fire flame shape

Whenever we want an animated texture, we have to tell the script:

  • The type of texture animation
  • The speed (low numbers for a slow animation, high for a faster animation)
  • In which face the animation should play (or if it should play in all the faces at once)

Apart from this, when we want a cell animation, the script needs to know how many vertical frames (we call this x) and how many horizontal frames (we call this y) the texture contains.

To avoid entering into technical details that may confuse at this point, let's just see the description format when we want animated textures as flames, and then a couple of very common examples that, most likely, will be the ones you will use :-)

General format:

animFire;code_for_animation_type;x;y;speed;face

animFire
This is the code word for the script. Write it as is. Case sensitive!

code_for_animation_type
If you use a cell animation: 3
If you use a slide animation: 19

x
If you use a cell animation: you type here how many VERTICAL frames the animation has
If you use a slide animation: you type here the number 0

y
If you use a cell animation: you type here how many HORIZONTAL frames the animation has
If you use a slide animation: you type here the number 0

speed
Here you type the frames per second to show (if cell animation), or the speed the animation will slide

face
-1: The animation will be applied to ALL THE FACES of the prim
face_number: The animation will be applied to the face face_number of the prim (you type here the face number!)


EXAMPLES


animFire;3;4;4;9;-1

This is a cell animation (code 3) having x = 4 vertical frames, y = 4 horizontal frames. The speed is 9 frames per second. It will show in face -1, which is the code for ALL THE FACES of the prim.

animFire;19;0;0;0.1;0

This is a slide animation (code 19), so in both x and y we type the number 0. The speed is 0.1. It will show in face 0 of the prim.

It is very important to indicate the face! Nowadays, it's very likely that we will use a multi-face mesh, and we want to animate only one face in that case, not the whole mesh! :-)

(Why just one or all faces? This is a scripting limitation. The animated texture can work only in all faces at once, or in just one of them. If you hear otherwise than one-or-all at once, it's true that there's a trick, but it's not a reliable one, and may get "fixed" by LL at any time!)


SETUP: THE CONFIGURATION NOTECARD


The configuration notecard is named [Black Tulip] Fireplaces - Full Edition ~config~, and it allows us to:



SETUP: THE MAIN SCRIPT, AS A MODULE YOU CAN USE FROM ANOTHER SCRIPT

Check the following section on this page, knowing that:

[Black Tulip] ***Script Name*** [MODULE] refers to [Black Tulip] Fireplaces - Full Edition [MODULE]
CODE_NUMBER is -18640987
NAME_ON_MENU is Fireplace

AVSitter line looks like: BUTTON Fireplace|-18640987
MLP line looks like: LINKMSG Fireplace | 1,-4,-18640987,fromMLP

You have example AVpos and .MENUITEMS notecards with your purchase. Remember that this works too with AVSitter 2.


TROUBLESHOOTING


Q: I click the light/particle/animated texture options on the menu, but no visible outcome shows. What's going wrong?

A: Most likely, there's not a light source/particles source/animated textures source defined in the object. Double-check the DESCRIPTION of the prim you expect to be a SL light point/particles source/animated texture.


Q: I hear no sound when I change the volume from the menu. What could be going wrong?

A: Make sure that there's a sound clip on the Content tab of the prim with the script.


For any other problem not described here, please give a complete description of your issue in the following online form.

I'll get back to you after I have read your report and replicated your issue inworld, according to your description of it. Please, be detailed.

-- Auryn Beorn

Friday, October 24, 2014

Script: My Snowglobe - Basic Edition

[Black Tulip] Snowglobe - Basic Edition (Script for Designers)

(c) 2014 Auryn Beorn

Snowglobe Basic script in Marketplace.

Thank you for having considered this script to enhance the quality of your products. Please read the following instructions carefully, especially the ones explaining which permissions to apply to the scripts for the next owner. Failure to complete this task INVALIDATES the license governing your use of this set of scripts. Should you have problems, please fill the scripts assistance form, explaining what you did and what happened, and I'll get back to you.

IMPORTANT!
The script contains a check to prevent accidental give-aways. If you haven't set permissions correctly in your inventory, then the script will self delete when you try to use it. The best way to ensure you set permissions correctly is by doing it NOW in your inventory.

TABLE OF CONTENTS



FEATURES


  • Start/Stop at the same time:
    Light, Spin Parts (keys, stars...), Particles Snow, Animated Texture
  • Start/Stop those effects independently when the global effect is ON
  • Change the light color
  • Change the animated texture type (slide/rotate) - Global setting
  • Change the speed of the animated texture - Global setting
  • Menu timeout to reduce lag - no open listeners after timeout (0.001 ms script time when idle)
  • Final user can change access to owner only/everybody/group
  • Menu can be integrated into tools such as MLPv2, AVsitter... (AVsitter version 2 works too!)


SET UP: WHAT SCRIPT TO USE?


There are two scripts contained in your folder:

[Black Tulip] Snowglobe - Basic Edition MESH
[Black Tulip] Snowglobe - Basic Edition MESH [MODULE]

We need to use ONLY ONE of them in a given product.

Which one? How to choose?

The [MODULE] version, as explained in the THE MAIN SCRIPT, AS A MODULE YOU CAN USE FROM ANOTHER SCRIPT section, will allow you to use this script integrated with other scripts that allow sending linked messages, such as the Multi Love Pose (MLP) or AVSitter for multiavatar, multianimation devices.

So, depending on what we need, we'll use the following script as main one:

Normal use - We want the menu to show when the object is clicked:
[Black Tulip] Snowglobe - Basic Edition MESH

The menu should show up after clicking a button from another script, like MLP, AVSitter:
[Black Tulip] Snowglobe - Basic Edition MESH [MODULE]

Once we've chosen the right main script, we have to set some descriptions in the primitives of the object, following the instructions below.


SETUP: CHANGE PERMISSIONS FOR NEXT OWNER


Check the following section on this page, knowing that each [Black Tulip] ASSET refers to the following scripts:

[Black Tulip] Snowglobe - Basic Edition MESH
[Black Tulip] Snowglobe - Basic Edition MESH [MODULE]


SETUP: EXAMINING THE SAMPLE OBJECT


With this script, you may control the following:

  • Start/Stop at the same time:
    Light, Spin Parts (keys, stars...), Particles Snow, Animated Texture
  • Start/Stop those effects independently when the global effect is ON
  • Change the light color
  • Change the animated texture type (slide/rotate) - Global setting
  • Change the speed of the animated texture - Global setting

We'll understand better what this means by examining the [Black Tulip] Snowglobe - SCRIPTED SAMPLE object. Rez it, and let's follow this explanation.

Before anything, right click the object to edit, then click the "Content" tab. When we do this, we're inspecting the contents of the ROOT PRIM. You should see the "[Black Tulip] Snowglobe - Basic Edition MESH" script.

What does this mean?
That the script and texture for particle effects, if any, have to be dropped into the ROOT PRIM. This is the default when we simply right click an object, then select "Edit" from the menu. The sample object has no particle textures used (and so particles will show as a little dot), but you can drop your texture and set it up as indicated later.

Having this clear, now let's examine the sample object in detail. It consists of two linked prims: The snowglobe itself, and a winding key. Right click to edit, click "Edit linked", and now:

  • Inspect the snowglobe prim. Check its description. It says:

animTexture;2#snow#light

  • Inspect now the winding key's description. It says:

spinPrim;<1.0,0.0,0.0>;1.0;1.0

What do these descriptions mean? That's what we cover in the next section.


SETUP: FORMAT OF THE DESCRIPTIONS


With this script, we may have the following:
  • One light point
  • One animated texture point
  • One particle snow emitter point (please check the "Important notes about the snow particles!" section for more)
  • As many spinning parts as you could need

If you rez the sample [Black Tulip] Snowglobe - SCRIPTED SAMPLE object and click it to get the menu, you'll see, as soon as you select ON/OFF to start all the effects, that the winding key spins. But there it is only one prim that will be the snow emitter, only one prim that will be the light point, and only one prim that will have the texture animated.

To tell the script which these primitives are in our LINKED object, we have to write specific words (CASE SENSITIVE) in the DESCRIPTION of each primitive (DESCRIPTION - not the name, don't confuse them!)

  • Expected description for a light point: light
  • Expected description for a snow emitter: snow
  • Expected description for an animated texture prim: animTexture;FACE_NUMBER (see here for how to get the face number if you don't know how; if you want all sides animated, type -1 as FACE_NUMBER)
  • Expected description for a spinning part: see the following section, HOW TO SET UP THE SPINNING PARTS

We may want a primitive being, at the same time, animated texture AND snow emitter.
Is this possible?

Yes. The description we should write would be, in that case:

animTexture;2#snow

Does this mean, if we want to have light, snow AND animated texture in the same prim, we could write:

animTexture;2#snow#light

and it would work? YES

Does this mean, if we want a spinning part AND snow, we could write:

spinPrim;<0.0,0.0,1.0>;1.0;1.0#snow

and it would work? YES

Does it matter if we write first snow, light or any other? It matters not. Write them as you prefer. Only what specifies how the prim will spin has a very specific format to be respected, but that is explained following.

And that would be it.

Set the DESCRIPTIONS according to these simple rules, drop the main script in your linked object, and your snowglobe is ready to go!


SETUP: HOW TO SET UP THE SPINNING PARTS


As you can check in the sample [Black Tulip] Snowglobe - SCRIPTED SAMPLE object, this script allows you to ALSO rotate, by spinning, all the child prims you wish to rotate (until you hit the script's memory limit - don't worry, this won't happen with five/ten spinning prims). You could also make the root prim to rotate. Perhaps this is not what you would like anyway, but feel free to make a copy of your object and try this if you're curious about :-) (basically, it will make the whole object to spin around the root)

We have to begin by rezzing our object.
Set the rotation of the ROOT PRIM to:

X = 0.00
Y = 0.00
Z = 0.00

Don't worry if your object doesn't look like you have designed it. You will be able of rotating it again as you wish ONCE you have gathered the values for the spin vectors.

Rez the [Black Tulip] Snowglobe - SCRIPTED SAMPLE sample object to follow this explanation. The captures are taken with a different object, but the principle is the same: pay special attention to the sections of the diagram that are highlighted.


Set its root rotation as said above:

X = 0.00
Y = 0.00
Z = 0.00

Now go into Edit linked parts. Click the winding key.


Check its description field. It says:

spinPrim;<0.0,0.0,1.0>;1.0;1.0

What does this mean?

The first that we have to know is that the script will read the semicolons (;) and take all the values between them.
So in the case above:

spinPrim;<0.0,0.0,1.0>;1.0;1.0

we see that there are FOUR pieces of information:

spinPrim
<0.0,0.0,1.0>
1.0
1.0

It is VERY IMPORTANT the order these values appear! If they don't appear in this exact order, the script won't be able to read the values of the prim we want to spin.

What each of those values mean?

First one:

spinPrim

means that the script has to consider this prim as a spinning one. The word has to be written exactly as said above. It IS case sensitive!

The second one:

<0.0,0.0,1.0>

is the spin vector. Don't worry, it is explained after this how to obtain it correctly.

The third one:

1.0

is the spin rate value. It is a number with decimals that, to make it easy to understand, we can think of as the velocity, so the smaller the value we type in, the slower the piece will spin and the reverse.

and the last one:

1.0

might be complicated to understand and, anyway, it doesn't make sense if our prims are not physical. Since this last one can be very technical, we will leave it always as 1.0. If you have the knowledge to follow the explanations from the wiki, then you can learn more about it in this wiki page: http://wiki.secondlife.com/wiki/LlTargetOmega

This last value corresponds to the gain parameter the wiki mentions there.

And how the spin vector has been obtained?

With the object having the root rotation set to <0.00 ,0.00, 0.00> (as stated above), and being in WORLD COORDINATES mode, we choose the axis we want the object rotating around.

  • If the axis is X, the RED one, we write the spin vector as: <1.0, 0.0, 0.0>
  • If the axis is Y, the GREEN one, we write the spin vector as: <0.0, 1.0, 0.0>
  • If the axis is Z, the BLUE one, we write the spin vector as: <0.0, 0.0, 1.0>


IMPORTANT NOTES ABOUT THE SNOW PARTICLES


You would expect that the SIZE of your snowglobe affected somehow to the snow emitted, and in fact, this happens by using this tool. If your SNOW EMITTER PRIM is smaller, the particles effect covers less volume. If bigger, it covers more. It attempts to always fill the snowglobe, INSIDE.

To be able to achieve this, the script, internally, takes the smallest dimension of the prim where you say the snow will emit, and it will adapt the effect to that smallest dimension.

Example: if the size of the primitive you decide to be the snow emitter is X = 1.0, Y = 0.5, Z = 2.0, then the script will take 0.5 to decide how far the particles will get.

From this, a DESIGN TIP is that you set the SPHERE that snowglobes use to have as the primitive emitting snow (you can see that in fact in the sample object included). The sphere of the snowglobe will have the same size for X, Y, Z, or at least, very similar sizes among them, so the snow effect will adapt nicely to the size of your snowglobe.

If you see that your particles barely show up, check if you're using a different primitive as emitter as well as the sizes (as it could be the ground cylinder in the provided sample: Z is quite smaller than X and Y, and that value would be the one taken for the snow effect.)

Please read the following notes about WHERE to drop the particle texture if you use any, and setting permissions: IMPORTANT NOTE ABOUT THE PARTICLES


SETUP: THE MAIN SCRIPT, AS A MODULE YOU CAN USE FROM ANOTHER SCRIPT

Check the following section on this page, knowing that:

[Black Tulip] ***Script Name*** [MODULE] refers to [Black Tulip] Snowglobe - Basic Edition MESH [MODULE]
CODE_NUMBER is -18640887
NAME_ON_MENU is Snowglobe

AVSitter line looks like: BUTTON Snowglobe|-18640887
MLP line looks like: LINKMSG Snowglobe | 1,-4,-18640887,fromMLP

You have example AVpos and .MENUITEMS notecards with your purchase. Remember that this works too with AVSitter 2.


TROUBLESHOOTING


Q: I click the animated texture/light/particle options on the menu, but no visible outcome shows. What's going wrong?

A: Most likely, there's not a light source/particles source/animated texture source defined in the object. Double-check the DESCRIPTION of the prim you expect to be a SL light source/particles source/animated texture source.


For any other problem not described here, please give a complete description of your issue in the following online form.

I'll get back to you after I have read your report and replicated your issue inworld, according to your description of it. Please, be detailed.

-- Auryn Beorn

Script: My Snowglobe - Music Edition

[Black Tulip] Snowglobe - Music Edition (Script for Designers)

(c) 2014 Auryn Beorn

Snowglobe Music script in Marketplace.

Thank you for having considered this script to enhance the quality of your products. Please read the following instructions carefully, especially the ones explaining which permissions to apply to the scripts for the next owner. Failure to complete this task INVALIDATES the license governing your use of this set of scripts. Should you have problems, please fill the scripts assistance form, explaining what you did and what happened, and I'll get back to you.

IMPORTANT!
The script contains a check to prevent accidental give-aways. If you haven't set permissions correctly in your inventory, then the script will self delete when you try to use it. The best way to ensure you set permissions correctly is by doing it NOW in your inventory.

TABLE OF CONTENTS



FEATURES


  • Start/Stop at the same time:
    Light, Spin Parts (keys, stars...), Particles Snow, Animated Texture
  • Start/Stop those effects independently when the global effect is ON
  • Change the light color
  • Change the animated texture type (slide/rotate) - Global setting
  • Change the speed of the animated texture - Global setting
  • Notecard configuration for the songs
  • It allows each song having different sample duration (i.e., a song may have its samples being 9.5 seconds and another song have its samples being 9.8 seconds)
  • Volume is changed via menu
  • Menu timeout to reduce lag - no open listeners after timeout (0.001 ms script time when idle)
  • Final user can change access to owner only/everybody/group
  • Menu can be integrated into tools such as MLPv2, AVsitter... (AVsitter version 2 works too!)


SET UP: WHAT SCRIPT TO USE?


There are two scripts contained in your folder:

[Black Tulip] Snowglobe - Music Edition MESH
[Black Tulip] Snowglobe - Music Edition MESH [MODULE]

We need to use ONLY ONE of them in a given product.

Which one? How to choose?

The [MODULE] version, as explained in the THE MAIN SCRIPT, AS A MODULE YOU CAN USE FROM ANOTHER SCRIPT section, will allow you to use this script integrated with other scripts that allow sending linked messages, such as the Multi Love Pose (MLP) or AVSitter for multiavatar, multianimation devices.

So, depending on what we need, we'll use the following script as main one:

Normal use - We want the menu to show when the object is clicked:
[Black Tulip] Snowglobe - Music Edition MESH

The menu should show up after clicking a button from another script, like MLP, AVSitter:
[Black Tulip] Snowglobe - Music Edition MESH [MODULE]

Once we've chosen the right main script, we have to set some descriptions in the primitives of the object, following the instructions below.


SETUP: CHANGE PERMISSIONS FOR NEXT OWNER


Check the following section on this page, knowing that each [Black Tulip] ASSET refers to the following scripts:

[Black Tulip] Snowglobe - Music Edition MESH
[Black Tulip] Snowglobe - Music Edition MESH [MODULE]


SETUP: EXAMINING THE SAMPLE OBJECT


With this script, you may control the following:

  • Start/Stop at the same time:
    Light, Spin Parts (keys, stars...), Particles Snow, Animated Texture
  • Start/Stop those effects independently when the global effect is ON
  • Change the light color
  • Change the animated texture type (slide/rotate) - Global setting
  • Change the speed of the animated texture - Global setting
  • Notecard configuration for the songs
  • It allows each song having different sample duration (i.e., a song may have its samples being 9.5 seconds and another song have its samples being 9.8 seconds)

We'll understand better what this means by examining the [Black Tulip] Snowglobe - MUSIC SCRIPTED SAMPLE object. Rez it, and let's follow this explanation.

Before anything, right click the object to edit, then click the "Content" tab. When we do this, we're inspecting the contents of the ROOT PRIM. You should see the "[Black Tulip] Snowglobe - Music Edition MESH" script.

What does this mean?
That the script and texture for particle effects, if any, have to be dropped into the ROOT PRIM. This is the default when we simply right click an object, then select "Edit" from the menu. The sample object has no particle textures used (and so particles will show as a little dot), but you can drop your texture and set it up as indicated later.

You should also see:

  • The [Black Tulip] Snowglobe - Music Edition MESH ~CFG~ configuration notecard
  • Several sample soundclips.

Having this clear, now let's examine the sample object in detail. It consists of two linked prims: The snowglobe itself, and a winding key. Right click to edit, click "Edit linked", and now:

  • Inspect the snowglobe prim. Check its description. It says:

animTexture;2#snow#light

  • Inspect now the winding key's description. It says:

spinPrim;<1.0,0.0,0.0>;1.0;1.0

What do these descriptions mean? That's what we cover in the next section.


SETUP: FORMAT OF THE DESCRIPTIONS


With this script, we may have the following:
  • One light point
  • One animated texture point
  • One particle snow emitter point (please check the "Important notes about the snow particles!" section for more)
  • As many spinning parts as you could need

If you rez the sample [Black Tulip] Snowglobe - MUSIC SCRIPTED SAMPLE object and click it to get the menu, you'll see, as soon as you select ON/OFF to start all the effects, that the winding key spins. But there it is only one prim that will be the snow emitter, only one prim that will be the light point, and only one prim that will have the texture animated.

To tell the script which these primitives are in our LINKED object, we have to write specific words (CASE SENSITIVE) in the DESCRIPTION of each primitive (DESCRIPTION - not the name, don't confuse them!)

  • Expected description for a light point: light
  • Expected description for a snow emitter: snow
  • Expected description for an animated texture prim: animTexture;FACE_NUMBER (see here for how to get the face number if you don't know how; if you want all sides animated, type -1 as FACE_NUMBER)
  • Expected description for a spinning part: see the following section, HOW TO SET UP THE SPINNING PARTS

We may want a primitive being, at the same time, animated texture AND snow emitter.
Is this possible?

Yes. The description we should write would be, in that case:

animTexture;2#snow

Does this mean, if we want to have light, snow AND animated texture in the same prim, we could write:

animTexture;2#snow#light

and it would work? YES

Does this mean, if we want a spinning part AND snow, we could write:

spinPrim;<0.0,0.0,1.0>;1.0;1.0#snow

and it would work? YES

Does it matter if we write first snow, light or any other? It matters not. Write them as you prefer. Only what specifies how the prim will spin has a very specific format to be respected, but that is explained following.

And that would be it.

Set the DESCRIPTIONS according to these simple rules, drop the main script in your linked object, and your snowglobe is ready to go!


SETUP: HOW TO SET UP THE SPINNING PARTS


As you can check in the sample [Black Tulip] Snowglobe - MUSIC SCRIPTED SAMPLE object, this script allows you to ALSO rotate, by spinning, all the child prims you wish to rotate (until you hit the script's memory limit - don't worry, this won't happen with five/ten spinning prims). You could also make the root prim to rotate. Perhaps this is not what you would like anyway, but feel free to make a copy of your object and try this if you're curious about :-) (basically, it will make the whole object to spin around the root)

We have to begin by rezzing our object.
Set the rotation of the ROOT PRIM to:

X = 0.00
Y = 0.00
Z = 0.00

Don't worry if your object doesn't look like you have designed it. You will be able of rotating it again as you wish ONCE you have gathered the values for the spin vectors.

Rez the [Black Tulip] Snowglobe - MUSIC SCRIPTED SAMPLE sample object to follow this explanation. The captures are taken with a different object, but the principle is the same: pay special attention to the sections of the diagram that are highlighted.


Set its root rotation as said above:

X = 0.00
Y = 0.00
Z = 0.00

Now go into Edit linked parts. Click the winding key.


Check its description field. It says:

spinPrim;<0.0,0.0,1.0>;1.0;1.0

What does this mean?

The first that we have to know is that the script will read the semicolons (;) and take all the values between them.
So in the case above:

spinPrim;<0.0,0.0,1.0>;1.0;1.0

we see that there are FOUR pieces of information:

spinPrim
<0.0,0.0,1.0>
1.0
1.0

It is VERY IMPORTANT the order these values appear! If they don't appear in this exact order, the script won't be able to read the values of the prim we want to spin.

What each of those values mean?

First one:

spinPrim

means that the script has to consider this prim as a spinning one. The word has to be written exactly as said above. It IS case sensitive!

The second one:

<0.0,0.0,1.0>

is the spin vector. Don't worry, it is explained after this how to obtain it correctly.

The third one:

1.0

is the spin rate value. It is a number with decimals that, to make it easy to understand, we can think of as the velocity, so the smaller the value we type in, the slower the piece will spin and the reverse.

and the last one:

1.0

might be complicated to understand and, anyway, it doesn't make sense if our prims are not physical. Since this last one can be very technical, we will leave it always as 1.0. If you have the knowledge to follow the explanations from the wiki, then you can learn more about it in this wiki page: http://wiki.secondlife.com/wiki/LlTargetOmega

This last value corresponds to the gain parameter the wiki mentions there.

And how the spin vector has been obtained?

With the object having the root rotation set to <0.00 ,0.00, 0.00> (as stated above), and being in WORLD COORDINATES mode, we choose the axis we want the object rotating around.

  • If the axis is X, the RED one, we write the spin vector as: <1.0, 0.0, 0.0>
  • If the axis is Y, the GREEN one, we write the spin vector as: <0.0, 1.0, 0.0>
  • If the axis is Z, the BLUE one, we write the spin vector as: <0.0, 0.0, 1.0>


IMPORTANT NOTES ABOUT THE SNOW PARTICLES


You would expect that the SIZE of your snowglobe affected somehow to the snow emitted, and in fact, this happens by using this tool. If your SNOW EMITTER PRIM is smaller, the particles effect covers less volume. If bigger, it covers more. It attempts to always fill the snowglobe, INSIDE.

To be able to achieve this, the script, internally, takes the smallest dimension of the prim where you say the snow will emit, and it will adapt the effect to that smallest dimension.

Example: if the size of the primitive you decide to be the snow emitter is X = 1.0, Y = 0.5, Z = 2.0, then the script will take 0.5 to decide how far the particles will get.

From this, a DESIGN TIP is that you set the SPHERE that snowglobes use to have as the primitive emitting snow (you can see that in fact in the sample object included). The sphere of the snowglobe will have the same size for X, Y, Z, or at least, very similar sizes among them, so the snow effect will adapt nicely to the size of your snowglobe.

If you see that your particles barely show up, check if you're using a different primitive as emitter as well as the sizes (as it could be the ground cylinder in the provided sample: Z is quite smaller than X and Y, and that value would be the one taken for the snow effect.)

Please read the following notes about WHERE to drop the particle texture if you use any, and setting permissions: IMPORTANT NOTE ABOUT THE PARTICLES


SETUP: THE CONFIGURATION NOTECARD


The configuration notecard is named [Black Tulip] Snowglobe - Music Edition MESH ~CFG~ needs to be written to provide all the data we want to:

  • Specify which samples compose a full song
  • Specify which name we want showing up on the menu for each song
  • Specify the sample duration per song
  • Say if we want the script to be silent or, on the contrary, to whisper in local chat the title of the selected song

(No other mode than whisper is allowed to prevent spamming avatars around that, most likely, won't be interested in knowing about songs being played.)

This data needs to be written in a specific way, so let's examine the [Black Tulip] Snowglobe - Music Edition MESH ~CFG~ notecard.

The lines beginning by:

#

are comments in the notecard.

They give important reminders, so don't delete them unless you don't need them. Comment lines won't use more script memory. Comment lines won't make your script laggier. Comment lines won't make your script work slower.

So it is OKAY if you leave them for your own reference. The comments in the notecard from your package explain all the parameters: You may want to leave those comments.

The sample notecard (not the one in the snowglobe) shows as:

# [Black Tulip] Snowglobe - Music Edition MESH ~CFG~
#
#   SaySongInChat = M
#       M can be 0 or 1
#           0 for a silent script
#           1 for the script whispering in local chat the title of the song being played
#
#   Put as many of the follow lines as songs you wish to offer - Limit: 20
#   Song = BaseName | TitleMenu | SampleDuration
#       BaseName    The base name all the samples for a same song share
#       TitleMenu       The title we want appearing in the menu to select song
#                           Max: 35 characters
#       SampleDuration  Sample duration, in seconds, for the samples of that specific song
#                               A default value of 9.5 will be provided if the value is not
#                               in the range [0.1, 9.95] (10.0 won't be accepted - for your safety)

SaySongInChat = 0

Song = BaseName | TitleMenu | SampleDuration


After all the comment lines, we find the following:

SaySongInChat = 0

This means that the script will NOT say anything when a song is played. If we wish to have the script whispering which song is going to be played once selected, we would write instead:

SaySongInChat = 1

And then the lines that would define the songs. We should write ONE line with the following format PER SONG:

Song = BaseName | TitleMenu | SampleDuration

What do BaseName, TitleMenu and SampleDuration mean here?

BaseName
This is the base name all the samples for a same song share. This will be clear with an example.

Let's suppose we have a song composed of five samples, named:

Little_Black_Rain_Cloud-0
    Little_Black_Rain_Cloud-1
    Little_Black_Rain_Cloud-2
    Little_Black_Rain_Cloud-3
    Little_Black_Rain_Cloud-4

By writing the following line in the configuration notecard:

Song = Little_Black_Rain_Cloud- | Little Black Rain Cloud | 9.5

we can see that the first part, BaseName, says:

Little_Black_Rain_Cloud-

The script will look for all the samples in your object with name beginning by Little_Black_Rain_Cloud- and will find all the samples mentioned above, so internally, it will know that the five samples above are all part of the same song.

IMPORTANT: All spaces around the specified name in the notecard will be DISCARDED. This has consequences. If your samples are, for example:

Little_Black_Rain_Cloud 0
    Little_Black_Rain_Cloud 1
    Little_Black_Rain_Cloud 2

and you specify in the notecard:

Song = Little_Black_Rain_Cloud | Little Black Rain Cloud | 9.5

this would make the script to look for sample names like:

Little_Black_Rain_Cloud0
    Little_Black_Rain_Cloud1
    Little_Black_Rain_Cloud2

and not like:

Little_Black_Rain_Cloud 0
    Little_Black_Rain_Cloud 1
    Little_Black_Rain_Cloud 2

Rename your samples accordingly before running into this issue. Usually, all songs you purchase will have names that won't be a problem in this regard.

TitleMenu
The title we want appearing in the menu to select song.
Max: 35 characters - Longer titles will be cut to fit this

Continuing with the sample line said above:

Song = Little_Black_Rain_Cloud | Little Black Rain Cloud | 9.5

we find

Little Black Rain Cloud

as value for TitleMenu, so this will be shown in the menu as the title for that song.

SampleDuration
Sample duration, in seconds, for the samples of that specific song.
A default value of 9.5 will be provided if the value is not in the range [0.1, 9.95] (10.0 won't be accepted - for your safety)

In the sample line we're using to explain this:

Song = Little_Black_Rain_Cloud | Little Black Rain Cloud | 9.5

we are saying that all the samples that are part of this song have a duration of 9.5 seconds. Since this value is in the allowed range for the script (greater or equal than 0.1 AND less or equal than 9.95), it will be accepted as the sample duration - for that one song.


WHERE DO I PURCHASE SONGS?


In order to have this item working, you will need, of course, to have songs to work with!

You can always check the Second Life Marketplace for songs. I sell some public domain, full permissions songs that you may use in items you create, at my main store.

But then, you can create yourself the samples you need and upload them. I explain all the procedure in the "Music!" book, which you can purchase in Marketplace or inworld.

This might be, perhaps, the best choice: that you look for public domain sources and you create your own samples. Be careful and do not use songs that have copyright!


SETUP: THE MAIN SCRIPT, AS A MODULE YOU CAN USE FROM ANOTHER SCRIPT

Check the following section on this page, knowing that:

[Black Tulip] ***Script Name*** [MODULE] refers to [Black Tulip] Snowglobe - Music Edition MESH [MODULE]
CODE_NUMBER is -18640887
NAME_ON_MENU is Snowglobe

AVSitter line looks like: BUTTON Snowglobe|-18640887
MLP line looks like: LINKMSG Snowglobe | 1,-4,-18640887,fromMLP

You have example AVpos and .MENUITEMS notecards with your purchase. Remember that this works too with AVSitter 2.


TROUBLESHOOTING


Q: I click the animated texture/light/particle options on the menu, but no visible outcome shows. What's going wrong?

A: Most likely, there's not a light source/particles source/animated texture source defined in the object. Double-check the DESCRIPTION of the prim you expect to be a SL light source/particles source/animated texture source.


For any other problem not described here, please give a complete description of your issue in the following online form.

I'll get back to you after I have read your report and replicated your issue inworld, according to your description of it. Please, be detailed.

-- Auryn Beorn