Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Removing Float Text From This Code.....

Powerspot Destiny
Registered User
Join date: 2 Nov 2007
Posts: 71
10-29-2009 08:22
This is a freebie giver list sign........
It has a floating text above it, and I am trying to figure out how to remove the words. There is no "Set Text" script in the inventory so the words must be part of rthe freebie giver script......Can anyone tell me from the code below how I would remove the float text from it?
Thank You





// Time from last touch to return to first item in list, in seconds
// Change to 0.0 to not return at all
float gResetTime = 90.0;

integer gItem = 0;
string gName = "";
integer gItemMax = 0;
integer gThisScript = 0;

// The colour to display text in
vector COLOUR = <>;
// This list holds the items to be dispensed
list gItemNames = [];
// This is the texture to display if there is no illustration in the box
// Change as desired....
string TEXTURE_NO_PIC = "0e90ed6b-84c2-8a81-359a-e556e42417dd";

list list_types = [INVENTORY_NONE, INVENTORY_TEXTURE, INVENTORY_SOUND,
INVENTORY_LANDMARK, INVENTORY_CLOTHING, INVENTORY_OBJECT, INVENTORY_NOTECARD,
INVENTORY_SCRIPT, INVENTORY_BODYPART, INVENTORY_ANIMATION, INVENTORY_GESTURE];

// this list is of the string names corresponding to the one above.
list list_names = ["None", "Texture", "Sound", "Landmark", "Clothing",
"Object", "Notecard", "Script", "Body Part", "Animation", "Gesture"];

string item_type(string item_name)
{
integer detected_type = llGetInventoryType(item_name);
integer type_index = llListFindList(list_types,[detected_type]);
return llList2String(list_names, type_index);
}

get_items()
{
integer f = 0;
string name = "";
gItemNames = [];
do {
name = llGetInventoryName(INVENTORY_ALL, f++);
// Will not vend itself, or any illustration
if (name != llGetScriptName()
&& (
// Check whether it is a picture of another item in the box
llGetSubString(name, -3, -1) != "pic"
|| llGetInventoryType(llGetSubString(name, 0, -5)) == INVENTORY_NONE
)
&& name != "";) {
gItemNames += [name];
}
} while (name != "";);
gItemMax = llGetListLength(gItemNames) - 1;
if (gItem < 0) gItem = 0;
else if (gItem > gItemMax) gItem = gItemMax;
display();
}

display()
{
if (llGetListLength(gItemNames) == 0) {
llSetText("No items available", COLOUR, 1.0);
llSetTexture(TEXTURE_NO_PIC, 2);
return;
}
gName = llList2String(gItemNames, gItem);
list permList = [];
integer perms = llGetInventoryPermMask(gName, MASK_NEXT);
if (!(perms & PERM_MODIFY)) permList += ";(no mod)";
if (!(perms & PERM_COPY)) permList += ";(no copy)";
if (!(perms & PERM_TRANSFER)) permList += ";(no transfer)";
string permMsg = ";(full permissions)";
if (permList != []) permMsg = llDumpList2String(permList, " ";);
string itemType = item_type(gName);
llSetText("ITEM " + (string)(gItem + 1) + " OF " + (string)(gItemMax + 1) + "\n" + gName + "\n" + itemType + " " + permMsg, COLOUR, 1.0);
// Set picture, if available
if (llGetInventoryType(gName + " pic";) != INVENTORY_NONE) {
llSetTexture(gName + " pic", 2);
}
else if (itemType == "Texture";) {
// Preview textures here
llSetTexture(gName, 2);
}
else {
llSetTexture(TEXTURE_NO_PIC, 2);
}
}

default
{
state_entry()
{
llOwnerSay("Ready to dispense items";);
get_items();
}

touch_start(integer total_number)
{
if (gItemMax == -1) {
llWhisper(0, "No items available";);
return;
}
string name = llDetectedName(0);
llSetText("Giving " + gName + "\nto " + name + "...", COLOUR, 1.0);
// if you want to record who took what, listen on this channel
llShout(-122, name + " took " + gName);
llGiveInventory(llDetectedKey(0), gName);
display();
}

link_message(integer s, integer n, string str, key id)
{
gItem += n;
if (gItem < 0) gItem = gItemMax;
else if (gItem > gItemMax) gItem = 0;
display();
llSetTimerEvent(gResetTime);
}

timer()
{
gItem = 0;
display();
llSetTimerEvent(0.0);
}

changed(integer change)
{
if (change & CHANGED_INVENTORY) {
get_items();
}
}
}
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
10-29-2009 08:36
Floaty text is a prim property, like color, and it won't go away if you just remove it from the script - you have to explicitly tell it to go away.

Just put this in state_entry: llSetText ("", <0,0,0>, 0);
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Rhonda Huntress
Kitteh Herder
Join date: 21 Dec 2008
Posts: 1,823
10-29-2009 08:48
Do a find/replace to change all
From: someone
llSetText(
into
From: someone
//llSetText(
those are 2 lower case L at the start of the word.
Niall Braveheart
Registered User
Join date: 5 Oct 2008
Posts: 27
10-29-2009 08:59
You will need to do both.

The text is persistant so you will needs Meade's solution to clear the last text

However the script calls llSetText later to set/change the text, so you will need to comment them out as suggested by Rhonda to stop the text reappearing
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
10-29-2009 09:03
From: Niall Braveheart
However the script calls llSetText later to set/change the text, so you will need to either comment them out as suggested by Rhonda to stop the text reappearing

Oops! Maybe I should actually read the script next time.. :o
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Niall Braveheart
Registered User
Join date: 5 Oct 2008
Posts: 27
10-29-2009 09:08
lol,

been guilty of doing the same in the past.
Powerspot Destiny
Registered User
Join date: 2 Nov 2007
Posts: 71
Wow....Thank You All
10-29-2009 09:24
I did both things as suggested and worked perfectly.......Thank all of you for the great help.