Xyzzy text (how to write more than 2 lines ?)
|
|
Dominique Laville
Registered User
Join date: 24 Apr 2008
Posts: 84
|
06-05-2008 07:20
Hello, I'm using Xyzzy text and I would like to know how to handle more than 2 lines. I added a third line and I modified the code as follow, but I can't display the text on the third line. Could you help me ? listen(integer channel,string name, key id, string message) { if (gToggle==0) llMessageLinked(LINK_THIS,DISPLAY_STRING,message,"0"  ; if (gToggle==1) llMessageLinked(LINK_THIS,DISPLAY_STRING,message,"1"  ; if (gToggle==2) llMessageLinked(LINK_THIS,DISPLAY_STRING,message,"2"  ; gToggle=(gToggle+1)%3; } PS: Furthermore, I noticed that it is important in which order I select the labels when I link them to the root prism, to display the text in order. Instead, the label names seem to not interfere. thanks, Patrick
|
|
Ravanne Sullivan
Pole Dancer Extraordinair
Join date: 10 Dec 2005
Posts: 674
|
06-05-2008 10:08
Have you made sure that you are actually trying to display a third line? If gToggle == "2" is never true that could be the problem and it just looks like an Xyzzy text problem.
I've done this myself in the past so its now one of the first things I check when things don't happen as expected. I am using Xyzzy text with 6 lines without any problems.
|
|
Dominique Laville
Registered User
Join date: 24 Apr 2008
Posts: 84
|
06-05-2008 11:01
what do you mean when you say
"Have you made sure that you are actually trying to display a third line? If gToggle == "2" is never true that could be the problem and it just looks like an Xyzzy text problem."
If gToggle == 0 the text goes to the first line, If gToggle == 1 the text goes to the second line
I assumed that if gToggle == 2 the text goes to the third line, but maybe I'm wrong. Can you help me ? or showing me your code with 6 lines ?
ps. I noticed that even if I change the name of the prisms the result is the same.
i.e. xyzzytext-0-0 -> xyzzytext-1-0
It is instead important the order in which I select the prisms. The first line that I select is also the line matching with gToggle == 0.
|
|
Ravanne Sullivan
Pole Dancer Extraordinair
Join date: 10 Dec 2005
Posts: 674
|
06-05-2008 14:21
if (gToggle==2) llSay(0,"I made it to line 3"  ; llMessageLinked(LINK_THIS,DISPLAY_STRING,message,"2"  ; This would give you an indication that you had indeed made it thru the logic to try and send the text to line 3. If you don't get the message then there may be so reason that if(gToggle ==2) is failing. The following would give you even more information. llSay(0,"gToggle = " + (string)gToggle); if (gToggle==2) llSay(0,"I made it to line 3"  ; llMessageLinked(LINK_THIS,DISPLAY_STRING,message,"2"  ; If it gives you the message that it is sending to line 3 yet you still don't see the text check your prims, I have had issues show up when linking that the order of the linkages got scrambled somehow. Here is the code that I use to clear the text on 5 lines, I used to have 6 but removed one since I never needed it and to clear up some space on the base prim. For actually writing the text I use a loop to set the text from a list. llMessageLinked(LINK_THIS,DISPLAY_STRING,"","0"  ; llMessageLinked(LINK_THIS,DISPLAY_STRING,"","1"  ; llMessageLinked(LINK_THIS,DISPLAY_STRING,"","2"  ; llMessageLinked(LINK_THIS,DISPLAY_STRING,"","3"  ; llMessageLinked(LINK_THIS,DISPLAY_STRING,"","4"  ;
|
|
Dominique Laville
Registered User
Join date: 24 Apr 2008
Posts: 84
|
06-05-2008 23:27
Hi, so... You wrote: if (gToggle==2) llSay(0,"I made it to line 3"  ; yes, llSay() works. You wrote: If it gives you the message that it is sending to line 3 yet you still don't see the text check your prims, I have had issues show up when linking that the order of the linkages got scrambled somehow. I noticed the order of selection is very important (instead the name of the prisms seems doesn't matter). What you mean for order got scrambled ? I just select the first row (from the prism on the left, then the second from the prism on the left, and then the third one. N.B. If I add the last if (gToggle==2), the script always ignores the first row. So, llMessageLinked(LINK_THIS,DISPLAY_STRING,"","0"  ; writes on the second line and llMessageLinked(LINK_THIS,DISPLAY_STRING,"","1"  ; writes on the third one You wrote: llMessageLinked(LINK_THIS,DISPLAY_STRING,"","0"  ; llMessageLinked(LINK_THIS,DISPLAY_STRING,"","1"  ; llMessageLinked(LINK_THIS,DISPLAY_STRING,"","2"  ; llMessageLinked(LINK_THIS,DISPLAY_STRING,"","3"  ; llMessageLinked(LINK_THIS,DISPLAY_STRING,"","4"  ; If I do this, the same text is written on all the lines. How did you use the loop ? thanks!
|
|
Dominique Laville
Registered User
Join date: 24 Apr 2008
Posts: 84
|
06-05-2008 23:59
Hey, I solved by changing the llMessageLinked parameter to "-1" !! Why does it start from -1 ? I will try to add the fourth line and the fifth one to see what's happen llMessageLinked(LINK_THIS, RESCAN_LINKSET, "", "0"  ; if (gToggle==0) llMessageLinked(LINK_THIS,DISPLAY_STRING,message,"-1"  ; if (gToggle==1) llMessageLinked(LINK_THIS,DISPLAY_STRING,message,"0"  ; if (gToggle==2) llMessageLinked(LINK_THIS,DISPLAY_STRING,message,"1"  ;
|
|
Ravanne Sullivan
Pole Dancer Extraordinair
Join date: 10 Dec 2005
Posts: 674
|
06-06-2008 00:14
From: Dominique Laville Hey,
I solved by changing the llMessageLinked parameter to "-1" !! Why does it start from -1 ? I will try to add the fourth line and the fifth one to see what's happen Do you have a set of display prims set up for the fourth and fifth lines? It really sounds like you have your display prims mislabeled or misconfigured somehow. For a four line display the prims should be labeled like this. xyzzytext-0-0 xyzzytext-0-1 xyzzytext-0-2 xyzzytext-0-3 (4 prims line 1 xyzzytext-1-0 xyzzytext-1-1 xyzzytext-1-2 xyzzytext-1-3 (4 prims line 2 xyzzytext-2-0 xyzzytext-2-1 xyzzytext-2-2 xyzzytext-2-3 (4 prims line 3 xyzzytext-3-0 xyzzytext-3-1 xyzzytext-3-2 xyzzytext-3-3 (4 prims line 4
|
|
Dominique Laville
Registered User
Join date: 24 Apr 2008
Posts: 84
|
06-06-2008 06:06
hello, ya, that's the order in which i labelled the prisms. If I have 4 lines it works with this parameters order: llMessageLinked(LINK_THIS,DISPLAY_STRING,message,"0"  ; llMessageLinked(LINK_THIS,DISPLAY_STRING,message,"1"  ; llMessageLinked(LINK_THIS,DISPLAY_STRING,message,"-2"  ; llMessageLinked(LINK_THIS,DISPLAY_STRING,message,"-1"  ; If I have 5 lines, instead.. llMessageLinked(LINK_THIS,DISPLAY_STRING,message,"0"  ; llMessageLinked(LINK_THIS,DISPLAY_STRING,message,"1"  ; llMessageLinked(LINK_THIS,DISPLAY_STRING,message,"2"  ; llMessageLinked(LINK_THIS,DISPLAY_STRING,message,"-2"  ; llMessageLinked(LINK_THIS,DISPLAY_STRING,message,"-1"  ; Since I'm going to build 11 lines, I will wait for your suggestions before 
|
|
Dominique Laville
Registered User
Join date: 24 Apr 2008
Posts: 84
|
06-06-2008 06:10
I forgot to mention that the prism names have not effect on the visualization, while the selection order is fundamental.
I tried to swap the prism names, but the visualization order is the same.
|
|
Dominique Laville
Registered User
Join date: 24 Apr 2008
Posts: 84
|
06-07-2008 09:01
No one has any suggestion ?
Despite of the weird lines mapping (with negative numbers), everything works fine.
Do you think that if I have 11 lines, does it still work ok ?
|
|
Ravanne Sullivan
Pole Dancer Extraordinair
Join date: 10 Dec 2005
Posts: 674
|
06-07-2008 10:47
From: Dominique Laville I forgot to mention that the prism names have not effect on the visualization, while the selection order is fundamental.
I tried to swap the prism names, but the visualization order is the same. This is what puzzles me as the prim names is what determines which message gets displayed on which line of prims. It makes me think that somehow your prim naming or linking has gotten fouled up. You might try and create a new set of display prims from scratch and see if that makes a difference. Have you checked to make sure that your root prim is the board the display prims are linked to and not one of the display prims itself?
|
|
Dominique Laville
Registered User
Join date: 24 Apr 2008
Posts: 84
|
06-07-2008 11:02
ya, I've already tried to do it again and again.. still the mapping is strange,
and yes, the board is the root since it is the only yellow prism. The others are all blue.
|
|
Ravanne Sullivan
Pole Dancer Extraordinair
Join date: 10 Dec 2005
Posts: 674
|
06-07-2008 13:06
I have sent you a demo board with 12 lines on it so you can play with it and hopefully find where your problems are coming from. It also contains an example of using a loop to set each line. If you have any questions feel free to contact me or to post here.
|
|
Dominique Laville
Registered User
Join date: 24 Apr 2008
Posts: 84
|
06-07-2008 13:08
thanks!! I will check it.
|
|
Dominique Laville
Registered User
Join date: 24 Apr 2008
Posts: 84
|
06-08-2008 08:24
So guys, I finally solved.
The problem was that the scripts HAVE to be added AFTER the linking. If they are added to the root prim before, it doesn't work correctly...
I lost hours for this *!!!**!*
|