Original creations in Second Life by Oggy Fink.

Monday, September 19, 2011

ShowHide-Multi script

Since the recent release of the ShowHide script, some people have asked me for a way to make some prims of an object vanish, but not others.

Guess what ? Here it comes !

It's called ShowHide-Multi. The "Multi" part means that you can use several copies of the script in several prims of your object to make them disappear at the same time. The script is either controlled by chat over a private channel, or by link messages.

Private chat will work from a distance and may be issued directly by the viewer but can cause some server lag if many scripts are listening. Link messages, on the other hand, will cause less lag but will work only among the prims of a same object. Moreover, link messages require a helper script.

All is customizable, and a control script is available to emit either private chat or link messages. Please be sure to read the options available at the beginning of both scripts.

Again, i warn you against using this script on partially transparent prims, because the alpha setting of all faces of the prim will be overwritten by the vanishing manoeuvers :) (usual disclaimers apply).

Here is the ShowHide-Multi script to be placed in every prim that is to disappear.
// ShowHide-Multi script by Oggy Fink

// text to set above the root prim
string text="here";    // modify me, use "" for no text
vector color=<1.0,1.0,1.0>;    // color of the text

// modifiable parameters

integer channel = 8;    // channel number
string showcmd="SHOW";    // show command - use uppercase only
string hidecmd="HIDE";    // hide command - use uppercase only

integer listen_active=TRUE;	// should I listen to chat commands in addition to link messages?

// do not touch below

show() {

hide() {

interpret(string message) {	// detects if it is a show or hide command and reacts
	string m=llToUpper(llStringTrim(message,STRING_TRIM));
	if (m==showcmd) {
	} else if (m==hidecmd) {

default {
	state_entry() {
		if (listen_active) llListen(channel,"",NULL_KEY,"");

	link_message(integer sender_number, integer number, string message, key id) {
		if (number!=channel) { // the channel number acts as a key here
	listen(integer channel, string name, key id, string message) {
Then the ShowHide-Multi control script :
// www.lsleditor.org  by Alphons van der Heijden (SL: Alphons Jano)
integer channel=8;    // channel number / link key

string showtext="Show !";
string hidetext="Hide !";
vector color=<1.0,0.5,0.0>;    // color for the floating text : . Use <1.0,1.0,1.0> for white

string showcmd="SHOW";
string hidecmd="HIDE";

// the following parameter sets if the command should be "said" (0), "whispered" (1), "shouted" (2), "regionsaid" (3) or sent as a link message (4)
integer emittype=0;	// edit accordingly

// do not modify below
integer visible=TRUE;

emit(string m) { // send a command
	if (emittype==0) {
	} else if (emittype==1) {
	} else if (emittype==2) {
	} else if (emittype==3) {
	} else if (emittype==4) {

default {
	state_entry() {

	touch_start(integer total_number) {
		if (visible) {
		} else {
All this is downloadable for free at my marketplace store.

No comments:

Post a Comment