Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Changing llSay output

Kendra Denimore
Registered User
Join date: 5 Feb 2009
Posts: 2
02-03-2010 15:39
Hi all, I'm new to scripting in LSL, and am having a problem figuring out why I can't fix the output from the llSay command to eliminate the word "Object:" using the following code which creates the string shown after that.

CODE

llSay(0, "Image: " + name);


this creates the following line in the local chat:
Object: Image: Inspiration_001

hence the dilema. I would like to either remove or be able to alter the word Object.

If removed, then no problem. If altered, then it should be able to be set to a descriptive or the Actual NAME of the containing object. Could anyone guide me in doing one of these two options?

Any and all help would be appreciated!
_____________________
Cerise Sorbet
Registered User
Join date: 8 Jun 2008
Posts: 254
02-03-2010 15:54
Second Life makes us do dirty dirty things.
CODE

CheatSay(integer channel, string s)
{
list words = llParseStringKeepNulls(s, [" "], []);
string oldName = llGetObjectName();
llSetObjectName(llList2String(words, 0));
llSay(channel, "/me " + llDumpList2String(llDeleteSubList(words, 0, 0), " "));
llSetObjectName(oldName);
}

default
{
state_entry()
{
string name = "meep";

CheatSay(0, "");
CheatSay(0, name);
CheatSay(0, "Image: " + name);
CheatSay(0, "yip yip");
}
}
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
02-03-2010 16:25
a sligtly simpler (but less absolute) approach is to simply set the object name to "", which will give you a space before your text when used with the "/me " added on the front (because /me requires a space after it)

on the plus side it will avoid possible coloring the first word wrong or linking to it in some clients.

ex:
CODE

default{
state_entry(){
string vStrNom = llGetObjectName();
llSetObjectName( "" );
llSay( 0, "/meImage: " + name );
llSetObjectName( vStrNom );
}
}


or you can just do away with all that silly reading and setting the name, and have the object be named "" from the beginning...

PS Lena IS adorable isn't she... makes me wish I had a red headed step child =)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Kendra Denimore
Registered User
Join date: 5 Feb 2009
Posts: 2
02-03-2010 17:53
PS Lena IS adorable isn't she... makes me wish I had a red headed step child =)[/QUOTE]


Ty for the snippits. I'll try em both and see which one I like for it. :) as for Lena, She's Simply perfect. :) Did you know she's going to be releasing her first SOLO album soon, if it isn't out already? WooT! lol
_____________________
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
02-03-2010 18:04
good deal, she's got a good voice, and even though I have translate most of the lyrics I still enjoy the sound of them
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -