Wednesday, February 12, 2014

Script: Fountain - Basic Edition


By Auryn Beorn (2012)



For your fountain (or other build) being the least lag possible, please use the scripts and guidelines explained in the included free box "[Black Tulip] How to create ZERO LAG animated water" In there you will learn to create ZERO LAG animated water, which is the perfect complement for this script.


Perfect for fountains, this script allows you to give the following interactivity via menu:

  • Let the user start/stop a loopsound for the object
  • Let the user turn on/off the preset water and foam effect from all the linked prims that you decide
  • Change the volume of the sound
  • Change who can access the menu (everybody/owner only/group)

IMPORTANT: The sound will play only if there's water running.
If there's no water running... the sound doesn't make much sense! :-)

Optionally, this script can be integrated as a module called by other scripts, such as MLP, AVsitter...

All these features are controlled by a single, low lag script.

This box contains two copy/transfer scripts:

[Black Tulip] Fountain - Basic Edition
[Black Tulip] Fountain - Basic Edition [MODULE]

The differences are explained later in this document. You will need only one of them.


In order to have any of these scripts working in your object, you have to:

  • Decide which primitives from your linkset will be the ones having the water jet effect
  • Change the *description* of these primitives to:

water jet

Note that the description is not the same as the name!
We want here the description.

  • Decide which primitives from your linkset will be the ones having the foam effect
  • Change the *description* of these primitives to:


Again, note that the description is not the same as the name!
We want here the description too.

  • Drop in the object the sound clip that you want to be played looped when the sound is ON.
  • Drop the one script you want to use, from the four scripts available in the box.

Use only one script from the two in the box!
The description in the previous section should help you decide which to use depending of your application.

IMPORTANT: Don't forget to change permissions of these scripts AND your sound samples! Refer to the license of use for instructions to change the permissions of the script you use.


  • You may use this script whether the object is a single prim, or several linked prims.
  • If there is no sound clip in the primitive, a built-in sound will be played. (If you don't want sound, there it is another tool that works only with light, not this one.)

You can rez the sample object [Black Tulip] Fountain Nodes - SAMPLE to check out a possible design. Pay special attention to the values of the SLICE parameters in the edit window for the cylinders that work as water jets and foam. Check also the suggestion for the foam emitters, which have their transparency set to 100.


There is a script which is a version of the main script, but ready so you can use this menu integrated with other tools you have that feature the ability to send messages.

You should choose the one main script:

[Black Tulip] Fountain - Basic Edition [MODULE]

and drop it together with your system.

Then you should modify your existing system to add a new entry in your menus, so when you click an option to open the menus from this tool, you should add the following code in your script/system:

llMessageLinked(LINK_THIS, -18640984, "message", toucherKey);

If you work with MLP, you can easily add a Controller button in the main menu by adding the following line in the .MENUITEMS notecard:

LINKMSG Controller | 1,-4,-18640984,fromMLP

fromMLP would be here the message passed in a llMessageLinked call.

Your box has a .MENUITEMS notecard with this included, so you can study how and where to add it.

Remember to restart your MLP for the notecard to be read.

If you work with AVSitter, it is also easy to add a button in the main menu to open the menu. All you have to do is include a line such as:

BUTTON Controller|-18640984

in your AVpos notecard.

Your box has an AVpos notecard with this included, so you can study how and where to add it.

IMPORTANT: You should consider warning your users about NOT linking/unlinking the object if it is using the [MODULE] version. Alternatively, you may suggest to them to use the *RESET* function from the menu, to recalculate the nodes.