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() {
	llSetAlpha(1.0,ALL_SIDES);
	llSetText(text,color,1.0);
}

hide() {
	llSetAlpha(0.0,ALL_SIDES);
	llSetText("",color,1.0);
}

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

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

	link_message(integer sender_number, integer number, string message, key id) {
		if (number!=channel) { // the channel number acts as a key here
			return;
		}
		interpret(message);
	}
	
	listen(integer channel, string name, key id, string message) {
		interpret(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) {
		llSay(channel,m);
	} else if (emittype==1) {
		llWhisper(channel,m);
	} else if (emittype==2) {
		llShout(channel,m);
	} else if (emittype==3) {
		llRegionSay(channel,m);
	} else if (emittype==4) {
		llMessageLinked(LINK_SET,channel,m,NULL_KEY);
	}
}

default {
	state_entry() {
		llSetText(hidetext,color,1.0);
	}

	touch_start(integer total_number) {
		if (visible) {
			emit(hidecmd);
			visible=FALSE;
			llSetText(showtext,color,1.0);
		} else {
			emit(showcmd);
			visible=TRUE;
			llSetText(hidetext,color,1.0);
		}
	}
}
All this is downloadable for free at my marketplace store.

Saturday, September 17, 2011

Unicode Box 3.2

This new item is dedicated to be a chat-helping gadget and, more generally, a tool to convert text from one form to another, with the idea of special unicode characters in mind. Now at Oggy's Scripted Items !

Specifically, using the unicode box or HUD, you can type ordinary text and get cool looking unicode characters as a result. Use it for a variety of purposes :
  • Type "everyone gets to party at <insert club name here>" and get "€♥ℯґ¥øηℯ ℊℯ☂ṧ ☂ø ℘@ґ☂¥ @☂ <insert club name here> !"
  • Ⓤⓢⓔ ⓒⓘⓡⓒⓛⓔⓓ ⓛⓔⓣⓣⓔⓡⓢ (and digits too)
  • ¡ uʍop ǝpısdn ʇuɐʍ noʎ ʇxǝʇ ʎuɐ ǝʇıɹM
  • Maкє уоцґ cнaт lоок cґazу aйd/оґ cооl
  • Usᴇ ɢʀᴇᴀᴛ-ʟᴏᴏᴋɪɴɢ Sᴍᴀʟʟ Cᴀᴘɪᴛᴀʟs ɪɴ ʏᴏᴜʀ ᴘʀᴏғɪʟᴇ
  • Wide letters to make your words clearer :)
  • Ḙṃḅḙḷḷḭṣḥ ẏṍṷṛ ṭḙẋṭ ẉḭṭḥ ḁ ṿḁṛḭḙṭẏ ṍḟ ḙḟḟḙḉṭṣ
You are not limited in the available effects : write and use your own translation tables !

This item comes bundled with 3 objects :
  • An easy-to-use standalone HUD. Wear it and go !
  • A rezzable unicode box, so that several people can use it, either through chat over a private channel or using the remote HUD,
  • A remote HUD, to easily control the unicode box from a distance.
 At any time you can select to whisper or shout instead of just talking, and issue control words like list, status, reset, etc.

All these actions are available as buttons in the HUD and the HUD itself may be iconified to take as little space as possible on your screen. The translation tables used by the HUD are defined in a solid configuration notecard, feel free to design your own ...

Numerous options are available, among which the channel number to use, the command mode (chat, link or both), user policy (who can use the box and who cannot), automatically use the name of the controlling avatar to emit chat...

The HUDs and the box are modifiable and copiable, but the scripts are only copiable. For the techies, full documentation is given on the format of the chat and link messages used to control the box, so that you can either design your own HUD or interface the box with your own objects.

I'll be happy to hear any remark or feature request : please drop me a notecard or send me an email at oggy.fink@gmail.com.

Special thanks to Carisma Alex for helping me testing the whole thing and for the general ideas... ♥♥

The original unicode box artwork uses graphic works from liftarn and Patrick Hoesly released under a creative commons license.