Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Xy Text Help.

Douglas Callahan
Fresh Prince Of SL
Join date: 2 Jul 2004
Posts: 349
03-20-2005 19:05
I have some Xy text problems. I am making a scoreboard with numbers (being the places, link 1st, 2nd...) and corresponding names. There are three prims per name. I want each name to go on a separate three prims. Here's what I have:

CODE
integer ThisLink = llGetLinkNumber();
llMessageLinked(ThisLink + 1, SET_CELL_INFO, llList2CSV([SET_LINE_CHANNEL, 0]), "");
llMessageLinked(ThisLink + 2, SET_CELL_INFO, llList2CSV([SET_LINE_CHANNEL, 6]), "");
llMessageLinked(ThisLink + 3, SET_CELL_INFO, llList2CSV([SET_LINE_CHANNEL, 12]), "");


and later...

CODE
llMessageLinked(LINK_SET, SET_LINE_CHANNEL, "" + (string) high_scorer() + ""  + (string) high_scorer2() + ""  + (string) high_scorer3() + ""  + (string) high_scorer4() + ""  + (string) high_scorer5() + "", "");


However this simply tries to put all of the names on one line of three prims, which doesn't work. Please help, if you need anymore info from the script say so. This is my first time with Xy text.
Corster Mousehold
The other white meat
Join date: 18 Jan 2005
Posts: 23
03-20-2005 19:21
The code that indicates the "ThisLink" should be the only prim with this code:

integer ThisLink = llGetLinkNumber();
llMessageLinked(ThisLink + 1, SET_CELL_INFO, llList2CSV([SET_LINE_CHANNEL, 0]), "";);
llMessageLinked(ThisLink + 2, SET_CELL_INFO, llList2CSV([SET_LINE_CHANNEL, 6]), "";);
llMessageLinked(ThisLink + 3, SET_CELL_INFO, llList2CSV([SET_LINE_CHANNEL, 12]), "";);

This prim will actually not be the xytext prims but another prim linked right before the xytext prims. So if you have like a scoreboard that was prim0 then you would want prim1 to be xyprim1 prim2 to be xyprim2 and prim3 to be xyprim3 then this will work. The trick to the xyText (especially if you are doing multiple text lines) is to know what link order each prim is in relation to each other.

Furthermore if you wanted to have multiple lines you would have to modify the base prim to change the names for that line so line 1 would be the before mentioned code and then line 2 would be
llMessageLinked(ThisLink + 4, SET_CELL_INFO, llList2CSV([SET_LINE_CHANNEL, 0]), "";);
llMessageLinked(ThisLink + 5, SET_CELL_INFO, llList2CSV([SET_LINE_CHANNEL, 6]), "";);
llMessageLinked(ThisLink + 6, SET_CELL_INFO, llList2CSV([SET_LINE_CHANNEL, 12]), "";);

Line 3:

llMessageLinked(ThisLink + 7, SET_CELL_INFO, llList2CSV([SET_LINE_CHANNEL, 0]), "";);
llMessageLinked(ThisLink + 8, SET_CELL_INFO, llList2CSV([SET_LINE_CHANNEL, 6]), "";);
llMessageLinked(ThisLink + 9, SET_CELL_INFO, llList2CSV([SET_LINE_CHANNEL, 12]), "";);

and so on...

Hope this helps

-cor-
Douglas Callahan
Fresh Prince Of SL
Join date: 2 Jul 2004
Posts: 349
03-20-2005 19:35
This sets up for 6 characters for one prims and 6 more for the next and so on, correct? How do I get it to not go by characters, but by names, one name could be 8 characters, Joe Shmoe, then another 6 character name, Jim Bim, so how would I make it not turn up like Joe ShmoeJimBim on one line instead of two separate lines.
Spuds Milk
Registered User
Join date: 28 Sep 2004
Posts: 94
03-20-2005 20:36
From: Douglas Callahan
This sets up for 6 characters for one prims and 6 more for the next and so on, correct? How do I get it to not go by characters, but by names, one name could be 8 characters, Joe Shmoe, then another 6 character name, Jim Bim, so how would I make it not turn up like Joe ShmoeJimBim on one line instead of two separate lines.


XYText is restricted to a max of 6 characters to be displayed per unit. If you want more characters than that, you need to add an additional 'unit' of XYText
So if you want an 8 char name, you'd need to put 2 units beside each other (wasting 4 char slots on the 2nd) and split the name, sending each part to the respective unit.

As an example, I have a program that gives 3 different times, 1 per line. as an example, take:
CODE

DISPLAYED XYText units
14:12:12 PST [14:12:][12 PST]
0:12:12 GMT [ 0:12:][12 GMT]
17:12:12 EST [17:12:][12 EST]

Thus using 6 XYText display units. Due to lazyness/not thinking ahead, I didn't link them in order, so sent a link message to 1-6 and found what number each location was, then setup my real link messages in the correct order (ie line 1 may have been link#1 and #4, but as long as I send message to correct link#, it's fine[though ugly to parse the LSL]).
Douglas Callahan
Fresh Prince Of SL
Join date: 2 Jul 2004
Posts: 349
03-21-2005 16:37
i see what you are saying with the brackets to split it up, but that does not exactly help me in my situation because I do not know how many characters the messages are going to be. Here is the string:

CODE
llMessageLinked(LINK_SET, SET_LINE_CHANNEL, "" + (string) high_scorer() + ""  + (string) high_scorer2() + ""  + (string) high_scorer3() + ""  + (string) high_scorer4() + ""  + (string) high_scorer5() + "", "");


I am trying to get high_scorer() (which is a name) to go across the first three prims, then high_scorer2() to go across the next three. If high scorer() is too long (more than 18 characters), I just want it to cut off. and if it is too short, I want it to stop and have the next name be on the next line so it doesn't turn out like: JoeShmoeJi next line mBim. I want it to be Joe Shmoe, next line Jim Bim.
Douglas Callahan
Fresh Prince Of SL
Join date: 2 Jul 2004
Posts: 349
03-21-2005 18:30
does the lack of response mean that there is no way to do this?