ft_msg = "Line 1\nLine 2";
llSetText(ft_msg, <0, 0, 0>, 1);
evething works as I would expect. The first line of FLOATING TEXT reads:
Line 1
and the second line of FLOATING TEXT reads:
Line 2
BUT if I create a line in a notecard that is:
FLOATING TEXT = Line1\nLine2
and use:
ft_msg = llGetSubString(data, 16, llStringLength(data));
llSetText(ft_msg, <0, 0, 0>, 1);
the FLOATING TEXT reads:
Line 1\nLine2
all on one line.
I've compared the two ft_msg strings and they are equal.
So here is my question---What am I doing wrong? Can one of you kind folks help me?
--------------------------------------------------------------------------------------------------
Here is the whole script:
string notecard_key;
integer n;
string ft_msg;
default
{
state_entry()
{
notecard_key = llGetNotecardLine("Test Notecard", n);
}
dataserver(key query_id, string data)
{
if(query_id == notecard_key)
{
if (data == EOF)
{
llOwnerSay("No more lines in notecard, read " + (string)n + " lines."
;n=0;
}
else
{
n++;
if(llSubStringIndex(data, "FLOATING TEXT = "
== 0){
// ft_msg = "Line 1\nLine 2";
ft_msg = llGetSubString(data, 16, llStringLength(data));
llSetText(ft_msg, <0, 0, 0>, 1);
llOwnerSay(ft_msg);
}
if(ft_msg = "Line1\nLine2"

{
llOwnerSay("They are equal"
;}
notecard_key = llGetNotecardLine("Security Notecard", n); // Get the next line
}
}
}
}
Here is the text in the Test notecard:
FLOATING TEXT = Line 1\nLine 2
- something to do with how escape characters work - but... try this: