Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Message Board

Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
12-14-2006 14:48
I wrote a script (I know.. I'm not very good at it.. but I try occassionally).

Anyways this script reads a notecard, and takes the data, one line at a time... chops it into letters, and sends it out to the linkset. the child prims are letter displays.. they parse the data sent to them, and after chewing on it a bit, they slide a graphic around on face 1.. so that they display their specific given letter.

It took me a number of hours.... because I'm slow.

Anyways.. I got it working. and when I say working, I mean it's really working. I'm really quite proud of how well it does work. I even managed to get it to auto-center the text. But there's a problem. Every few cycles, some of the letters seem to miss their instruction.. be it to display a letter, or to wipe.

So I need to ask for help on this one.. and I really don't know a lot of script-strong people. I suspect the problem isn't what I'm doing.. but rather the fact that I've probably done a few things "the long way".. and am creating a bit of backlog for the letters.

These scripts will show the last attempt I made to fix the problem, by re-sending the letter data several times to the linkset. It didn't help.

So here's my scripts.

Master (base) Prim
- place this in the parent object.
CODE
integer lineNum = 0;
string noteCard = "Message";
string charSend;
integer charNum = 0;
key newQuery;

integer begSpaces;
integer endSpaces;

integer messageDelay = 6; // 2x the time in seconds
integer blankDelay = 2; // 2x the time in seconds

integer messageRun;
integer blankRun;

default
{
state_entry()
{
newQuery = llGetNotecardLine(noteCard, lineNum); // request first line
}

dataserver(key queryid, string data)
{
if (queryid == newQuery)
{
if (data != EOF)
{

if (llStringLength(data) < 20)
{
integer spaces = 20 - llStringLength(data);
float spacesDiv = spaces / 2;

if ((integer)spacesDiv != spacesDiv)
{
spacesDiv = (integer)spacesDiv;
begSpaces = (integer)spacesDiv;
endSpaces = spaces - (integer)spacesDiv;
}
else
{
begSpaces = (integer)spacesDiv;
endSpaces = (integer)spacesDiv;
}

while (begSpaces > 0)
{
data = " " + data;
begSpaces -= 1;
}

while (endSpaces > 0)
{
data = data + " ";
endSpaces -= 1;
}
}
llMessageLinked(LINK_SET, 99, "wipe", NULL_KEY); // Clear the board again.

messageRun = messageDelay;
while (messageRun > 0)
{
while (charNum < 20)
{
charSend = llGetSubString(data, charNum, charNum);
llMessageLinked(charNum + 2, charNum, charSend, NULL_KEY);
llMessageLinked(charNum + 22, charNum, charSend, NULL_KEY);
charNum += 1;
}
charNum = 0; // reset character counter
llSleep(0.5);
messageRun -= 1;
}

blankRun = blankDelay;

while (blankRun > 0)
{
llMessageLinked(LINK_SET, 99, "wipe", NULL_KEY); // Clear the display
llSleep(0.5); // pause to display blank
blankRun -= 1;
}

lineNum += 1; // Change to next notecard line
newQuery = llGetNotecardLine(noteCard, lineNum); // Go get the line and start over
}

else

{
lineNum = 0;
newQuery = llGetNotecardLine(noteCard, lineNum); // request next line
}
}
}
}


Child (letter) Prim
- place this in each letter display prim (I used 20)
CODE
default
{
state_entry()
{
llScaleTexture(0.125, 0.125, ALL_SIDES);
}

link_message(integer sender_num, integer num, string str, key id)
{

if(
str == "a" ||
str == "b" ||
str == "c" ||
str == "d" ||
str == "e" ||
str == "f" ||
str == "g" ||
str == "h"
)
{
if (str == "a") {llOffsetTexture(-0.4375, -0.4375, 1);}
else if (str == "b") {llOffsetTexture(-0.3125, -0.4375, 1);}
else if (str == "c") {llOffsetTexture(-0.1875, -0.4375, 1);}
else if (str == "d") {llOffsetTexture(-0.0625, -0.4375, 1);}
else if (str == "e") {llOffsetTexture(0.0625, -0.4375, 1);}
else if (str == "f") {llOffsetTexture(0.1875, -0.4375, 1);}
else if (str == "g") {llOffsetTexture(0.3125, -0.4375, 1);}
else if (str == "h") {llOffsetTexture(0.4375, -0.4375, 1);}
}

if(
str == "i" ||
str == "j" ||
str == "k" ||
str == "l" ||
str == "m" ||
str == "n" ||
str == "o" ||
str == "p"
)
{
if (str == "i") {llOffsetTexture(-0.4375, -0.3125, 1);}
else if (str == "j") {llOffsetTexture(-0.3125, -0.3125, 1);}
else if (str == "k") {llOffsetTexture(-0.1875, -0.3125, 1);}
else if (str == "l") {llOffsetTexture(-0.0625, -0.3125, 1);}
else if (str == "m") {llOffsetTexture(0.0625, -0.3125, 1);}
else if (str == "n") {llOffsetTexture(0.1875, -0.3125, 1);}
else if (str == "o") {llOffsetTexture(0.3125, -0.3125, 1);}
else if (str == "p") {llOffsetTexture(0.4375, -0.3125, 1);}
}

if(
str == "q" ||
str == "r" ||
str == "s" ||
str == "t" ||
str == "u" ||
str == "v" ||
str == "w" ||
str == "x"
)
{
if (str == "q") {llOffsetTexture(-0.4375, -0.1875, 1);}
else if (str == "r") {llOffsetTexture(-0.3125, -0.1875, 1);}
else if (str == "s") {llOffsetTexture(-0.1875, -0.1875, 1);}
else if (str == "t") {llOffsetTexture(-0.0625, -0.1875, 1);}
else if (str == "u") {llOffsetTexture(0.0625, -0.1875, 1);}
else if (str == "v") {llOffsetTexture(0.1875, -0.1875, 1);}
else if (str == "w") {llOffsetTexture(0.3125, -0.1875, 1);}
else if (str == "x") {llOffsetTexture(0.4375, -0.1875, 1);}
}

if(
str == "y" ||
str == "z" ||
str == "8" ||
str == "9" ||
str == "1" ||
str == "-" ||
str == "'" ||
str == " "
)
{
if (str == "y") {llOffsetTexture(-0.4375, -0.0625, 1);}
else if (str == "z") {llOffsetTexture(-0.3125, -0.0625, 1);}
else if (str == "8") {llOffsetTexture(-0.1875, -0.0625, 1);}
else if (str == "9") {llOffsetTexture(-0.0625, -0.0625, 1);}
else if (str == "1") {llOffsetTexture(0.0625, -0.0625, 1);}
else if (str == "-") {llOffsetTexture(0.1875, -0.0625, 1);}
else if (str == "'") {llOffsetTexture(0.3125, -0.0625, 1);}
else if (str == " ") {llOffsetTexture(0.4375, -0.0625, 1);}
}

if(
str == "A" ||
str == "B" ||
str == "C" ||
str == "D" ||
str == "E" ||
str == "F" ||
str == "G" ||
str == "H"
)
{
if (str == "A") {llOffsetTexture(-0.4375, 0.4375, 1);}
else if (str == "B") {llOffsetTexture(-0.3125, 0.4375, 1);}
else if (str == "C") {llOffsetTexture(-0.1875, 0.4375, 1);}
else if (str == "D") {llOffsetTexture(-0.0625, 0.4375, 1);}
else if (str == "E") {llOffsetTexture(0.0625, 0.4375, 1);}
else if (str == "F") {llOffsetTexture(0.1875, 0.4375, 1);}
else if (str == "G") {llOffsetTexture(0.3125, 0.4375, 1);}
else if (str == "H") {llOffsetTexture(0.4375, 0.4375, 1);}
}

if(
str == "I" ||
str == "J" ||
str == "K" ||
str == "L" ||
str == "M" ||
str == "N" ||
str == "O" ||
str == "P" ||
str == "0"
)
{
if (str == "I") {llOffsetTexture(-0.4375, 0.3125, 1);}
else if (str == "J") {llOffsetTexture(-0.3125, 0.3125, 1);}
else if (str == "K") {llOffsetTexture(-0.1875, 0.3125, 1);}
else if (str == "L") {llOffsetTexture(-0.0625, 0.3125, 1);}
else if (str == "M") {llOffsetTexture(0.0625, 0.3125, 1);}
else if (str == "N") {llOffsetTexture(0.1875, 0.3125, 1);}
else if (str == "O" || str == "0") {llOffsetTexture(0.3125, 0.3125, 1);}
else if (str == "P") {llOffsetTexture(0.4375, 0.3125, 1);}
}

if(
str == "Q" ||
str == "R" ||
str == "S" ||
str == "T" ||
str == "U" ||
str == "V" ||
str == "W" ||
str == "X"
)
{
if (str == "Q") {llOffsetTexture(-0.4375, 0.1875, 1);}
else if (str == "R") {llOffsetTexture(-0.3125, 0.1875, 1);}
else if (str == "S") {llOffsetTexture(-0.1875, 0.1875, 1);}
else if (str == "T") {llOffsetTexture(-0.0625, 0.1875, 1);}
else if (str == "U") {llOffsetTexture(0.0625, 0.1875, 1);}
else if (str == "V") {llOffsetTexture(0.1875, 0.1875, 1);}
else if (str == "W") {llOffsetTexture(0.3125, 0.1875, 1);}
else if (str == "X") {llOffsetTexture(0.4375, 0.1875, 1);}
}

if(
str == "Y" ||
str == "Z" ||
str == "2" ||
str == "3" ||
str == "4" ||
str == "5" ||
str == "6" ||
str == "7"
)
{
if (str == "Y") {llOffsetTexture(-0.4375, 0.0625, 1);}
else if (str == "Z") {llOffsetTexture(-0.3125, 0.0625, 1);}
else if (str == "2") {llOffsetTexture(-0.1875, 0.0625, 1);}
else if (str == "3") {llOffsetTexture(-0.0625, 0.0625, 1);}
else if (str == "4") {llOffsetTexture(0.0625, 0.0625, 1);}
else if (str == "5") {llOffsetTexture(0.1875, 0.0625, 1);}
else if (str == "6") {llOffsetTexture(0.3125, 0.0625, 1);}
else if (str == "7") {llOffsetTexture(0.4375, 0.0625, 1);}
}

if (str == "wipe") {llOffsetTexture(0.4375, -0.0625, 1);}
}
}


This script also requires a texture, and a notecard called "Message". lines on the notecard should be 20 characters or less. (creating 20 letter prims is also called for)

Can someone PLEASE help me clean this thing up so it stops missing letters?
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
12-14-2006 16:54
Is this anything like XyText? /54/9c/12156/2.html#post853213

The Kermitt Quirk version of XyText allows 5 characters per face, and can be converted to read a notecard. I even have a custom version which handles word-wrapping from the notecard (with proper wrap points), and scrolls up/down, left right on the display. Check out my XyText implementation in the NW corner of Europa, inside near the garage door.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-14-2006 19:51
Remember the thread on the speed of else-if's as opposed to if's?
Don't have the texture so I can't check it against that but it does compile and run. Not sure what is going to happen with the space thou. That might need to be changed.


CODE

string alpha_numeric = "abcdefghijklmnopqrstuvwxyz891-' ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
integer string_pos;

default {
state_entry() {
llScaleTexture(0.125, 0.125, ALL_SIDES);
}

link_message(integer sender_num, integer num, string str, key id) {
if (str == "wipe") {llOffsetTexture(0.4375, -0.0625, 1);}
else if(str == "0"){llOffsetTexture(0.3125, 0.3125, 1);}
else{
string_pos = llSubStringIndex(alpha_numeric, str);
if(string_pos < 32){
if(string_pos < 16){
if(string_pos < 8){
if(string_pos < 4){
if (string_pos == 0) {llOffsetTexture(-0.4375, -0.4375, 1);} //a
else if (string_pos == 1) {llOffsetTexture(-0.3125, -0.4375, 1);}//b
else if (string_pos == 2) {llOffsetTexture(-0.1875, -0.4375, 1);}//c
else if (string_pos == 3) {llOffsetTexture(-0.0625, -0.4375, 1);}//d
}
else{
if (string_pos == 4) {llOffsetTexture(0.0625, -0.4375, 1);}//e
else if (string_pos == 5) {llOffsetTexture(0.1875, -0.4375, 1);}//f
else if (string_pos == 6) {llOffsetTexture(0.3125, -0.4375, 1);}//g
else if (string_pos == 7) {llOffsetTexture(0.4375, -0.4375, 1);}//h
}
}
else{//> 8 & < 16
if(string_pos < 12){
if (string_pos == 8) {llOffsetTexture(-0.4375, -0.3125, 1);}//i
else if (string_pos == 9) {llOffsetTexture(-0.3125, -0.3125, 1);}//j
else if (string_pos == 10) {llOffsetTexture(-0.1875, -0.3125, 1);}//k
else if (string_pos == 11) {llOffsetTexture(-0.0625, -0.3125, 1);}////l
}
else{
if (string_pos == 12) {llOffsetTexture(0.0625, -0.3125, 1);}//m
else if (string_pos == 13) {llOffsetTexture(0.1875, -0.3125, 1);}//n
else if (string_pos == 14) {llOffsetTexture(0.3125, -0.3125, 1);}//o
else if (string_pos == 15) {llOffsetTexture(0.4375, -0.3125, 1);}//p
}
}
}
else{//> 16 & < 32
if(string_pos < 24){
if(string_pos < 20){
if (string_pos == 16) {llOffsetTexture(-0.4375, -0.1875, 1);}//q
else if (string_pos == 17) {llOffsetTexture(-0.3125, -0.1875, 1);}//r
else if (string_pos == 18) {llOffsetTexture(-0.1875, -0.1875, 1);}//s
else if (string_pos == 19) {llOffsetTexture(-0.0625, -0.1875, 1);}//t
}
else{
if (string_pos == 20) {llOffsetTexture(0.0625, -0.1875, 1);}//u
else if (string_pos == 21) {llOffsetTexture(0.1875, -0.1875, 1);}//v
else if (string_pos == 22) {llOffsetTexture(0.3125, -0.1875, 1);}//w
else if (string_pos == 23) {llOffsetTexture(0.4375, -0.1875, 1);}//x
}
}
else{
if(string_pos < 28){
if (string_pos == 24) {llOffsetTexture(-0.4375, -0.0625, 1);}// y
else if (string_pos == 25) {llOffsetTexture(-0.3125, -0.0625, 1);}// z
else if (string_pos == 26) {llOffsetTexture(-0.1875, -0.0625, 1);}// 8
else if (string_pos == 27) {llOffsetTexture(-0.0625, -0.0625, 1);}// 9
}
else{
if (string_pos == 28) {llOffsetTexture(0.0625, -0.0625, 1);}// 1
else if (string_pos == 29) {llOffsetTexture(0.1875, -0.0625, 1);}// -
else if (string_pos == 30) {llOffsetTexture(0.3125, -0.0625, 1);}// '
else if (string_pos == 31) {llOffsetTexture(0.4375, -0.0625, 1);}// " "
}
}
}
}
else{//<64
if(string_pos < 48){
if(string_pos < 40){
if(string_pos < 36){
if (string_pos == 32) {llOffsetTexture(-0.4375, 0.4375, 1);}//A
else if (string_pos == 33) {llOffsetTexture(-0.3125, 0.4375, 1);}//B
else if (string_pos == 34) {llOffsetTexture(-0.1875, 0.4375, 1);}//C
else if (string_pos == 35) {llOffsetTexture(-0.0625, 0.4375, 1);}//D
}
else{
if (string_pos == 36) {llOffsetTexture(0.0625, 0.4375, 1);}//E
else if (string_pos == 37) {llOffsetTexture(0.1875, 0.4375, 1);}//F
else if (string_pos == 38) {llOffsetTexture(0.3125, 0.4375, 1);}//G
else if (string_pos == 39) {llOffsetTexture(0.4375, 0.4375, 1);}//H
}
}
else{//> 40 & < 48
if(string_pos < 44){
if (string_pos == 40) {llOffsetTexture(-0.4375, 0.3125, 1);}// I
else if (string_pos == 41) {llOffsetTexture(-0.3125, 0.3125, 1);}// J
else if (string_pos == 42) {llOffsetTexture(-0.1875, 0.3125, 1);}// K
else if (string_pos == 43) {llOffsetTexture(-0.0625, 0.3125, 1);}// L
}
else{
if (string_pos == 44) {llOffsetTexture(0.0625, 0.3125, 1);}// M
else if (string_pos == 45) {llOffsetTexture(0.1875, 0.3125, 1);}// N
else if (string_pos == 46) {llOffsetTexture(0.3125, 0.3125, 1);}// O
else if (string_pos == 47) {llOffsetTexture(0.4375, 0.3125, 1);}//P
}
}
}
else{//> 48 & < 64
if(string_pos < 56){
if(string_pos < 52){
if (string_pos == 48) {llOffsetTexture(-0.4375, 0.1875, 1);}// Q
else if (string_pos == 49) {llOffsetTexture(-0.3125, 0.1875, 1);}// R
else if (string_pos == 50) {llOffsetTexture(-0.1875, 0.1875, 1);}// S
else if (string_pos == 51) {llOffsetTexture(-0.0625, 0.1875, 1);}//T
}
else{
if (string_pos == 52) {llOffsetTexture(0.0625, 0.1875, 1);}// U
else if (string_pos == 53) {llOffsetTexture(0.1875, 0.1875, 1);}// V
else if (string_pos == 54) {llOffsetTexture(0.3125, 0.1875, 1);}// W
else if (string_pos == 55) {llOffsetTexture(0.4375, 0.1875, 1);}//X
}
}
else{
if(string_pos < 60){
if (string_pos == 56) {llOffsetTexture(-0.4375, 0.0625, 1);}// Y
else if (string_pos == 57) {llOffsetTexture(-0.3125, 0.0625, 1);}// Z
else if (string_pos == 58) {llOffsetTexture(-0.1875, 0.0625, 1);}// 2
else if (string_pos == 59) {llOffsetTexture(-0.0625, 0.0625, 1);}//3
}
else{
if (string_pos == 60) {llOffsetTexture(0.0625, 0.0625, 1);}// 4
else if (string_pos == 61) {llOffsetTexture(0.1875, 0.0625, 1);}// 5
else if (string_pos == 62) {llOffsetTexture(0.3125, 0.0625, 1);}// 6
else if (string_pos == 63) {llOffsetTexture(0.4375, 0.0625, 1);}//7
}
}
}
}
}
}
}
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
12-15-2006 01:54
Just my 2 pennies worth, Assuming you have all fixed width characters I think you should be able to work out the offsets within the texture by calculation rather than all the if's. The character position will be directly related to a row and colum within the texture. The only fly in theointment will be 0 which is remapped to O.

Looking at the offsets it would appear that each cell is 0.125 by 0.125 and you are using an 8 x 8 grid so the x and y positions can be calculated by dividing string position by 8 to get the column and then the remainder is the row.

If not then rather than if/else if make a list of the offsets and use a straight look up.

CODE

string alpha_numeric = "abcdefghijklmnopqrstuvwxyz891-' ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
list xoffset = [ -0.4375, //a
-0.3125, //b
-0.1875, //c
-0.0625, //d
0.0625, //e
0.1875, //f
0.3125, //g
0.4375, //h
-0.4375, //i
-0.3125, //j
-0.1875, //k
-0.0625, //l
0.0625, //m
0.1875,//n
0.3125,//o
0.4375,//p
-0.4375,//q
-0.3125,//r
-0.1875,//s
-0.0625,//t
0.0625,//u
0.1875,//v
0.3125,//w
0.4375,//x
-0.4375,// y
-0.3125,// z
-0.1875,// 8
-0.0625,// 9
0.0625,// 1
0.1875,// -
0.3125,// '
0.4375,// " "
-0.4375,//A
-0.3125,//B
-0.1875,//C
-0.0625,//D
0.0625,//E
0.1875,//F
0.3125,//G
0.4375,//H
-0.4375,// I
-0.3125,// J
-0.1875,// K
-0.0625, // L
0.0625,// M
0.1875,// N
0.3125,// O
0.4375,//P
-0.4375,// Q
-0.3125,// R
-0.1875,// S
-0.0625,//T
0.0625,// U
0.1875,// V
0.3125,// W
0.4375,//X
-0.4375,// Y
-0.3125,// Z
-0.1875,// 2
-0.0625,//3
0.0625,// 4
0.1875,// 5
0.3125,// 6
0.4375];//7
list yoffset = [ -0.4375, //a
-0.4375, //b
-0.4375, //c
-0.4375, //d
-0.4375, //e
-0.4375, //f
-0.4375, //g
-0.4375, //h
-0.3125, //i
-0.3125, //j
-0.3125, //k
-0.3125, //l
-0.3125, //m
-0.3125, //n
-0.3125, //o
-0.3125, //p
-0.1875, //q
-0.1875, //r
-0.1875, //s
-0.1875, //t
-0.1875, //u
-0.1875, //v
-0.1875, //w
-0.1875, //x
-0.0625, // y
-0.0625, // z
-0.0625, // 8
-0.0625, // 9
-0.0625, // 1
-0.0625, // -
-0.0625, // '
-0.0625, // " "
0.4375, //A
0.4375, //B
0.4375, //C
0.4375, //D
0.4375, //E
0.4375, //F
0.4375, //G
0.4375, //H
0.3125, // I
0.3125, // J
0.3125, // K
0.3125, // L
0.3125, // M
0.3125, // N
0.3125, // O
0.3125, //P
0.1875, // Q
0.1875, // R
0.1875, // S
0.1875, //T
0.1875, // U
0.1875, // V
0.1875, // W
0.1875, //X
0.0625, // Y
0.0625, // Z
0.0625, // 2
0.0625, //3
0.0625, // 4
0.0625, // 5,
0.0625, // 6
0.0625]; //7

default
{
state_entry()
{
llScaleTexture(0.125, 0.125, ALL_SIDES);
}

link_message(integer sender_num, integer num, string str, key id)
{
// Map special cases
if (str == "wipe")str == " ";
else if(str == "0")str = "O";

integer string_pos = llSubStringIndex(alpha_numeric, str);
if(string_pos >= 0)
{
float xpos = llList2Float(xoffset,string_pos);
float ypos = llList2Float(yoffset,string_pos);
llOffsetTexture(xpos,ypos, 1);
}
}
}


I also notice that you send wipe yet its the same effect as sending a space so why bother?
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
12-15-2006 04:15
Newgate, Jesse.. thank you both.

When I went to bed last night, after posting this, I also struck upon the idea of comparing 2 or several lists. Finding the letter in list a, then referencing that position in list 1.. or finding the letter in list b and referencing list 2, etc.

Newgate, yes the grid is 8x8. this severely limited me on punctuation, but I didn't know how to do the math for 9x9, and I was scared of 10x10. All the letters are indeed monos-paced, so your basic assumptions are correct. I did remap 0 to O in a desperate attempt to find room for a "space", a hyphen, and an apostrophe. I still wish I had about 8 more spaces.. but figuring out the coordinates for an 8x9.. forget it.

Why the wipe separate from space?

The way the master script works, it chops the 20 character string into 20 - 1 character strings. it shoots a letter out to prim 2 and 22, then shoots letter 2 to prim 3 and 23, etc etc. Originally however, the script would shoot ALL the letters out to the linkset, along with it's position number as an integer. The display letters would then check to make sure that the message was meant for them. (by comparing the integer against the prim name).. So I had 40 prims all doing checks against every letter sent out. I finally realized I could used link order to direct the messages, and hopefully releive the display lag. it helped.. but not much.

I originally did have a while loop that would send out 20 spaces to wipe the board, one to each display prim. The result was very slow. SO I decided to create a special case where one "wipe" message, sent to the linkset.. would trigger all the display prims to wipe. Basically there's some legacy code in there which is why.

The goal was to have every "phrase" wipe off the board for a second, then the next message would display. Rather than having one message directly overwrite the last. I now realize that since characters are sent to specific prims.. I could send " " to the linkset and get the same result.
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
12-15-2006 04:31
From: Winter Ventura

Newgate, yes the grid is 8x8. this severely limited me on punctuation, but I didn't know how to do the math for 9x9, and I was scared of 10x10. All the letters are indeed monos-paced, so your basic assumptions are correct. I did remap 0 to O in a desperate attempt to find room for a "space", a hyphen, and an apostrophe. I still wish I had about 8 more spaces.. but figuring out the coordinates for an 8x9.. forget it.


maths shouldnt change much as its the cell size that defines position. The texture size is always 1 ( -0.5 to 0.5 ) so cell size is always 1/rows by 1/columns. Once you have that value the rest of the calculation is identical.

Just use a LINKSET_ALL to send a space would have the same effect.
EDIT: Just noticed that Winter says this in the last line of her post.
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
12-15-2006 05:20
Okay I found a couple of glitches in my main script. NOthing that was preventing operation, but it might have been generating unneccessary amounts of linkset coms drama.

one of the biggest issues was that if the string was "merry christmas" the message was being sent thus:

2 m
3 me
4 mer
5 merr
6 merry
7 merry
8 merry c
9 merry ch

etc

So prim 20 was running through 20 characters trying to deliver the correct one, and was.. by chance.. displaying the correct letter.

The second error was a math error. I was trying to divide odd integers by 2. the results were not correct even though the result was a float. So after I cast the integer of spaces to a float, I could divide irt properly and get my centering to work.

I wrote a letter interpreter script that runs along the same lines as both Newgate and Jesse's.. with a little salt and garlic of my own.

CODE
integer string_pos;
float xpos;
float ypos;

string alpha7 = "ABCDEFGH";
string alpha6 = "IJKLMNOP";
string alpha5 = "QRSTUVWX";
string alpha4 = "YZ234567";
string alpha3 = "yz891-'_";
string alpha2 = "qrstuvwx";
string alpha1 = "ijklmnop";
string alpha0 = "abcdefgh";

list xoffset = [ -0.4375, -0.3125, -0.1875, -0.0625, 0.0625, 0.1875, 0.3125, 0.4375 ];
list yoffset = [ -0.4375, -0.3125, -0.1875, -0.0625, 0.0625, 0.1875, 0.3125, 0.4375 ];

default
{
state_entry()
{
llScaleTexture(0.125, 0.125, ALL_SIDES);
}

link_message(integer sender_num, integer num, string str, key id) {

// Let's deal with "zero"
if (str == "0")
{
str = "O";
}

// and space
if (str == " ")
{
str = "_";
}

if (llSubStringIndex(alpha0, str) != -1)
{
string_pos = llSubStringIndex(alpha0, str);
xpos = llList2Float(xoffset, string_pos);
ypos = llList2Float(yoffset, 0);
llOffsetTexture(xpos,ypos, 1);
}

else if (llSubStringIndex(alpha1, str) != -1)
{
string_pos = llSubStringIndex(alpha1, str);
xpos = llList2Float(xoffset, string_pos);
ypos = llList2Float(yoffset, 1);
llOffsetTexture(xpos,ypos, 1);
}

else if (llSubStringIndex(alpha2, str) != -1)
{
string_pos = llSubStringIndex(alpha2, str);
xpos = llList2Float(xoffset, string_pos);
ypos = llList2Float(yoffset, 2);
llOffsetTexture(xpos,ypos, 1);
}

else if (llSubStringIndex(alpha3, str) != -1)
{
string_pos = llSubStringIndex(alpha3, str);
xpos = llList2Float(xoffset, string_pos);
ypos = llList2Float(yoffset, 3);
llOffsetTexture(xpos,ypos, 1);
}

else if (llSubStringIndex(alpha4, str) != -1)
{
string_pos = llSubStringIndex(alpha4, str);
xpos = llList2Float(xoffset, string_pos);
ypos = llList2Float(yoffset, 4);
llOffsetTexture(xpos,ypos, 1);
}

else if (llSubStringIndex(alpha5, str) != -1)
{
string_pos = llSubStringIndex(alpha5, str);
xpos = llList2Float(xoffset, string_pos);
ypos = llList2Float(yoffset, 5);
llOffsetTexture(xpos,ypos, 1);
}

else if (llSubStringIndex(alpha6, str) != -1)
{
string_pos = llSubStringIndex(alpha6, str);
xpos = llList2Float(xoffset, string_pos);
ypos = llList2Float(yoffset, 6);
llOffsetTexture(xpos,ypos, 1);
}

else if (llSubStringIndex(alpha7, str) != -1)
{
string_pos = llSubStringIndex(alpha7, str);
xpos = llList2Float(xoffset, string_pos);
ypos = llList2Float(yoffset, 7);
llOffsetTexture(xpos,ypos, 1);
}
}
}


Basically the same thing, just a little differently. For script purposes I shift the " " to a "_". But that happens inside the display prim's interpreter script.

I'll be honest, I can't tell if it's fixed or not. I'm not SEEING the glitch anymore.. but when I plopped Jesse's script in, I stopped seeing it as well. The reader board still doesn't "QUITE" flash properly in sequence.. and sometimes wiping is a little randomish.. but nothing seems to be getting left behind, or not written.

In order to "solve" this... I think I may have to add a "window shade" to the system.. a single visibility prim that will "shield" the letters till they come up, then flash open, then flash closed just before they change. I could probably find a way to add a "wipe" to it.
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
12-15-2006 05:32
This version of your child script can be set for various x/y sizes in your font, and various character sets. Just change the ROWS and COLUMNS values, and make sure the string contains your character set reading left to right, top to bottom. Some sizes may work better than others due to texture coordinate rounding.

CODE

// arbitrary font size version
integer ROWS = 8;
integer COLUMNS = 8;
string charmap = "abcdefghijklmnopqrstuvwxyz891-' ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";

float xgrain;
float ygrain;

float centerx;
float centery;

default
{
state_entry()
{
xgrain = 1.0 / COLUMNS;
ygrain = 1.0 / ROWS;
centerx = (xgrain * COLUMNS / 2.0) - (xgrain / 2);
centery = (ygrain * ROWS / 2.0) - (ygrain / 2);;
llScaleTexture(xgrain, ygrain, ALL_SIDES);
}

link_message(integer sender_num, integer num, string str, key id)
{
integer len = llStringLength(str);
if (len > 1)
if (str == "wipe")
str = " ";
else
return; // reject non-single char strings

if (len < 1)
return; // reject blank strings

integer index = llSubStringIndex(charmap, str);

if (index < 0)
index = llSubStringIndex(charmap, " "); // invalid becomes space

integer x = index % COLUMNS;
integer y = index / ROWS;

llOffsetTexture(x * xgrain - centerx, y * ygrain - centery, 1);
}
}


As your prims are linked in order, you can reduce the link message load by sending one link to all, with the full string and let the child sort out which letter to display.
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
12-15-2006 07:02
Great idea.. phenominal really.

The first part.. letting the coordinates be dynamically figured by the interpreter based on the grid specs. I LOVE that... that's great.

doesn't actually work with my texture, of course.. And since I really don't understand half the math you're doing.. I'm a little bit confused with how to add new characters. This is my image map.

CODE
A B C D E F G H
I J K L M N O P
Q R S T U V W X
Y Z 2 3 4 5 6 7
y z 8 9 1 - ' _
q r s t u v w x
i j k l m n o p
a b c d e f g h


The way the string is loading, however, is bottom->up/left->right

abcdefghijklmnopqrstuvwxyz891-'_YZ234567QRSTUVWXIJKLMNOPABCDEFGH

Unfortunately, by making the string thus:

"abcdefghijklmnopqrstuvwxyz891-'_ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"

you've assumed that my map looks like this:

CODE
Y Z 2 3 4 5 6 7
Q R S T U V W X
I J K L M N O P
A B C D E F G H
y z 8 9 1 - ' _
q r s t u v w x
i j k l m n o p
a b c d e f g h


While it's reasonably easy to 'repair" my image map to coincide with your string.. or to change your string to match my image map... it's going bottom->up.. and that's really counter intuitive for me.

Actually, the more I poke at this, the more lost I become. I really have no idea what image map order you've assumed here. all I'm getting is gibberish now.

How would this be modded to read from left to right, then top to bottom, so that a 9th row would be added at the bottom?

I'm also very interested in the idea of making the letters do their own clipping and sorting (no idea how this would be accomplishged though)
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
12-15-2006 07:23
Boss's code is what I was talking about with the x and y values.
He calculates the x and y offset per character cell and the centre coordinate.

CODE

xgrain = 1.0 / COLUMNS;
ygrain = 1.0 / ROWS;
centerx = (xgrain * COLUMNS / 2.0) - (xgrain / 2);
centery = (ygrain * ROWS / 2.0) - (ygrain / 2);;


He then uses this to calculate the actual offsets

CODE

integer x = index % COLUMNS;
integer y = index / ROWS;

llOffsetTexture(x * xgrain - centerx, y * ygrain - centery, 1);


As for character ordering, Rather than change your image just reorder the lookup string!!!

If you stick with your code, which is factored quite nicely, you still have missed out removing the duplicate code in each of your tests:=-
Add a function call like this
CODE

integer Found(string letters, string character, integer row)
{
string_pos = llSubStringIndex(letters, character);
xpos = llList2Float(xoffset, string_pos);
ypos = llList2Float(yoffset, row);
llOffsetTexture(xpos,ypos, 1);
return string_pos;
}


Your match code now becomes

CODE

if (Found(alpha0, str,0) == -1)
if (Found(alpha1, str,1) == -1)
if (Found(alpha2, str,2) == -1)
if (Found(alpha3, str,3) == -1)
if (Found(alpha4, str,4) == -1)
if (Found(alpha5, str,5) == -1)
if (Found(alpha6, str,6) == -1)
Found(alpha7, str,7);
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
12-15-2006 07:49
Okay.. this is where we separate the builders from the scripters..

"HUH?"

I'm not following what to do at this point. I'm getting code snippets that I don;'t know where to put.. and my message board now flickers "hhhpphphhphppphphph" in random seizure-inducing spurts.

Care to help the blind figure out how to assemble that stuff up there into something useful.. without having the message board just say THHHBBBBT at me?
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
re-inventing XYtext
12-15-2006 08:11
DOH! I'm awake now. I had just thrown out all those numbers, assuming the first few blocks told me how it mapped. I try not to have any numbers in the code, beyond 0 and 1 (I let 2 slide now and then), it makes the code more readable. Here's a setup which uses what I described above, one message to all letter prims. It now maps top to bottom in rows. To flip the rows in the previous version, just change the y calculation:
CODE

// bottom to top (the old way)
integer y = index / ROWS);

// top to bottom (the new way)
integer y = ROWS - (index / ROWS) - 1;


Here's the new version.
controller prim code:
CODE

// main text display controller script
// this message will change the default mapping
// llMessageLinked (LINK_ALL_CHILDREN, LENGTH, CHARMAP, "4, 4");
// this message will reset to default mapping
// llMessageLinked (LINK_ALL_CHILDREN, LENGTH, "", "reset");
// this message displays the text
// llMessageLinked (LINK_ALL_CHILDREN, LENGTH, text, "");
//

string CHARMAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567yz891-' qrstuvwxijklmnopabcdefgh";

integer lineNum = 0;
string noteCard = "Message";
key newQuery;

float messageDelay = 3.0; // the time in seconds
float blankDelay = 1.0; // the time in seconds
integer blanking = FALSE;

integer LENGTH = 20;
string spaces; // filled at state entry

default
{
state_entry()
{
integer i;
for (i = 0; i < LENGTH; ++i)
spaces += " ";
newQuery = llGetNotecardLine(noteCard, lineNum = 0); // request first line
// llMessageLinked (LINK_ALL_CHILDREN, LENGTH, CHARMAP, "4, 4");
llMessageLinked (LINK_ALL_CHILDREN, LENGTH, "", "reset");
}

dataserver(key queryid, string data)
{
if (queryid == newQuery)
{
if (data != EOF)
{
list words = llParseString2List(data, [" "], []);
if (llGetListLength(words) == 0) // it was an blank line
{
newQuery = llGetNotecardLine(noteCard, ++lineNum); // next line
return;
}

integer pad = (LENGTH - llStringLength(data)) / 2;
string text;

if (pad > 0)
text = llGetSubString(spaces, 0, pad) + data;
else
text = llGetSubString(data, -pad, -1);

llMessageLinked (LINK_ALL_CHILDREN, LENGTH, text, "");

blanking = FALSE;
llSetTimerEvent(messageDelay);
}
else
{
newQuery = llGetNotecardLine(noteCard, lineNum = 0); // request first line
}
}
}

timer()
{
if (!blanking)
{
llMessageLinked (LINK_ALL_CHILDREN, LENGTH, "", "");
llSetTimerEvent(blankDelay);
blanking = TRUE;
}
else
{
newQuery = llGetNotecardLine(noteCard, ++lineNum); // request next line
llSetTimerEvent(0.0);
}
}
}

letter prim code:
CODE

// letter prim script
// single-message version
//
// incoming link messages:
// id = "reset" will reset to default size and charmap
// id = "[rows],[columns]" will change mapping,
// using str for new char set, or char set unchanged if str is empty
// id = "" will display the text in str
// unknown characters will display as blank
//

integer LINK_BASE = 1; // offset to ftrst letter prim from sender
integer FACE = 1; // face number or ALL_SIDES

integer ROWS = 8;
integer COLUMNS = 8;
// default character mapping
//A B C D E F G H
//I J K L M N O P
//Q R S T U V W X
//Y Z 2 3 4 5 6 7
//y z 8 9 1 - ' _
//q r s t u v w x
//i j k l m n o p
//a b c d e f g h
string CHARMAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567yz891-' qrstuvwxijklmnopabcdefgh";

string charMap;

integer setRows;
integer setColumns;

float xGrain;
float yGrain;

float xCenter;
float yCenter;

calc_coords(integer rows, integer columns)
{
setRows = rows;
setColumns = columns;
xGrain = 1.0 / columns;
yGrain = 1.0 / rows;
xCenter = (xGrain * columns / 2.0) - (xGrain / 2);
yCenter = (yGrain * rows / 2.0) - (yGrain / 2);
llScaleTexture(xGrain, yGrain, ALL_SIDES);
}

show_char(string char)
{
integer index = llSubStringIndex(charMap, char);

if (index < 0)
index = llSubStringIndex(charMap, " "); // invalid becomes space

integer x = index % setRows;
integer y = setRows - (index / setRows) - 1;

llOffsetTexture(x * xGrain - xCenter, y * yGrain - yCenter, FACE);
}

default
{
state_entry()
{
calc_coords(ROWS, COLUMNS);
charMap = CHARMAP;
show_char(" ");
}

link_message(integer sender_num, integer num, string str, key id)
{
if (id != "")
{
if (id == "reset")
{
calc_coords(ROWS, COLUMNS);
charMap = CHARMAP;
show_char(" ");
return;
}
list coords = llCSV2List((string)id);
if (llGetListLength(coords) != 2)
return; // silently fail

integer rows = (integer)llList2String(coords, 0);
integer columns = (integer)llList2String(coords, 1);
if (rows <= 0 || columns <= 0)
return; // silently fail

calc_coords(rows, columns);
if (str != "")
charMap = str;
show_char(" ");
}

integer mynum = llGetLinkNumber() - (sender_num + LINK_BASE);
integer len = llStringLength(str);
string mychar;

if (mynum < len)
mychar = llGetSubString(str, mynum, mynum);
else
mychar = " "; // space if out of string range

show_char(mychar);
}
}


This version can set the rows/columns from the main script, as well as the character mapping, so you don't have to go changing all the child scripts for different font textures.
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
12-15-2006 08:35
I'm getting.. errors.

spacing is very often off, centered text is being shifted to the right.. and the last line is missing the first 2 letters. Weird stuff like that.
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
12-15-2006 08:40
From: Boss Spectre
This version can set the rows/columns from the main script, as well as the character mapping, so you don't have to go changing all the child scripts for different font textures.



Could be extended to allow the controller to pass over the UUID of the texture to use, so the child prim no longer requires editing at all.
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
12-15-2006 08:45
one of you two wanna come see the thing in world so you can understand the issue I'm having at this point?
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
12-15-2006 09:44
Sounds like you have trailing spaces in the text. This change will strip leading and trailing spaces from the text for centering. User-proof solution: Add more code!

CODE

// original version (excerpt from lines 47 - 53)
integer pad = (LENGTH - llStringLength(data)) / 2;
string text;

if (pad > 0)
text = llGetSubString(spaces, 0, pad) + data;
else
text = llGetSubString(data, -pad, -1);

// new version
string text = data;
while (llGetSubString(text, -1, -1) == " ")
text = llGetSubString(text, 0, -2);
while (llGetSubString(text, 0, 0) == " ")
text = llGetSubString(text, 1, -1);
integer pad = (LENGTH - (llStringLength(text) + 1)) / 2; // add 1 to round up

if (pad > 0)
text = llGetSubString(spaces, 0, pad) + text;
else
text = llGetSubString(text, -pad, -1);
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
12-15-2006 10:45
PLEASE point me to the discussion on "else if" performance issues. SL forum search is abysmal, but with such common terms, google can't find it either.

Thanks!
Jeff
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
If else (OFF TOPIC)
12-15-2006 10:52
Jeff, you might get more people reading your question if you posted a new topic... but here's a page that might help you.

http://lslwiki.com/lslwiki/wakka.php?wakka=ifelse

~Boss
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-15-2006 10:53
From: Learjeff Innis
PLEASE point me to the discussion on "else if" performance issues. SL forum search is abysmal, but with such common terms, google can't find it either.

Thanks!
Jeff

/54/02/144383/1.html
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
12-15-2006 11:04
Okay, Newgate put in a token appearance, and saw the problem, but didn't have time to delve into it. So here's where I'm at.

I've changed the master script to trim or expand (with spaces) each line to precisely 21 characters. That line is now being sent to all prims in the linkset.

Then I made life difficult for myself.

I'm willing to deal with setting the "dimensions" of the alphanumeric texture in the display scripts. I have reduced the prim count however, and will be displaying 3 letters per prim, rather than 1. I have, however created a "faux" link order calculation.. so that each script can tell which letter to display, as if it were it's llGetLinkNumber.

The upshot of this is that I now have the numbers 0-20.. 21 faces, on a 8 prim object.

Now, I currently have it set up to display one letter per script. so weach "block of three" will have three scripts inside it. THere's probably a way to calculate all three faces in one script.. and thereby will probably be a great deal faster... but I don't know HOW to do that. frankly I barely know how to do what I'm attempting at this point.

So at this point, a 21-letter message is being sent to the linkset.

Anyone wanna help me process that into three characters on faces 3, 0, and 1 in that order?

Master script
CODE
integer lineNum = 0;
string noteCard = "Message";
string charSend;
integer charNum = 0;
key newQuery;

integer begSpaces;
integer endSpaces;

integer messageDelay = 3; // 2x the time in seconds
integer blankDelay = 1; // 2x the time in seconds

default
{
state_entry()
{
newQuery = llGetNotecardLine(noteCard, lineNum); // request first line
}

dataserver(key queryid, string data)
{
if (queryid == newQuery)
{
if (data != EOF)
{
if (llStringLength(data) > 10)
{
data = llGetSubString (data, 0, 20);
}

if (llStringLength(data) < 21)
{
integer spaces = 21 - llStringLength(data);
float spacesDiv = (float)spaces / 2;
if ((integer)spacesDiv != spacesDiv)
{
spacesDiv = (integer)spacesDiv;
begSpaces = (integer)spacesDiv;
endSpaces = spaces - (integer)spacesDiv;
}
else
{
begSpaces = (integer)spacesDiv;
endSpaces = (integer)spacesDiv;
}

while (begSpaces > 0)
{
data = " " + data;
begSpaces -= 1;
}

while (endSpaces > 0)
{
data = data + " ";
endSpaces -= 1;
}
}

llMessageLinked(LINK_SET, 0, data, NULL_KEY);
llSleep(messageDelay);
llMessageLinked(LINK_SET, 0, " ", NULL_KEY); // Clear the display
llSleep(blankDelay); // pause to display blank
lineNum += 1; // Change to next notecard line
newQuery = llGetNotecardLine(noteCard, lineNum); // Go get the line and start over
}

else

{
lineNum = 0;
newQuery = llGetNotecardLine(noteCard, lineNum); // request next line
}
}
}
}
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-15-2006 12:32
From: Winter Ventura
one of you two wanna come see the thing in world so you can understand the issue I'm having at this point?

You are still reinventing what has already been invented.

Use this to make 4 different prim(from this thread:/13/59/82618/1.html):
CODE


default
{
state_entry()
{
llSetPrimitiveParams([PRIM_TYPE, 2, 0, <0.199, 0.8, 0.0>, 0.68, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, PRIM_SIZE, <0.03, 2.89, 0.5>, PRIM_TEXTURE, 1, "09b04244-9569-d21f-6de0-4bbcf5552222", <2.48, 1.0, 0.0>, <-0.740013, 0.0, 0.0>, 0.0, PRIM_TEXTURE, 6, "09b04244-9569-d21f-6de0-4bbcf5552222", <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 0.0, PRIM_TEXTURE, 4, "09b04244-9569-d21f-6de0-4bbcf5552222", <-14.75, 1.0, 0.0>, <0.130009, 0.0, 0.0>, 0.0, PRIM_TEXTURE, 7, "09b04244-9569-d21f-6de0-4bbcf5552222", <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 0.0, PRIM_TEXTURE, 3, "09b04244-9569-d21f-6de0-4bbcf5552222", <2.48, 1.0, 0.0>, <-0.255989, 0.0, 0.0>, 0.0]);
}
}

Use kermits script here:
/54/9c/12156/2.html#post853213/54/9c/12156/2.html#post853213

Now link the four prim you made in reverse order to another root prim and in it place this script:
CODE

integer DISPLAY_STRING = 204000;

default {

state_entry() {
string message = llGetObjectDesc();
integer msg_length = llStringLength(message);
if(msg_length > 20)message = llDeleteSubString(message, 20, -1);
string link_4_msg = llGetSubString(message,15,19);
llMessageLinked(5, DISPLAY_STRING, link_4_msg, "");
string link_3_msg = llGetSubString(message,10,14);
llMessageLinked(4, DISPLAY_STRING, link_3_msg, "");
string link_2_msg = llGetSubString(message,5,9);
llMessageLinked(3, DISPLAY_STRING, link_2_msg, "");
string link_1_msg = llGetSubString(message,0,4);
llMessageLinked(2, DISPLAY_STRING, link_1_msg, "");
}
touch_start(integer num_detected) {
llResetScript();
}
}

Then just change the object description and touch the prim. It will truncate the message to 20 characters. Whenever you want to change the message, then just change the object description and touch it to show the new message.

EDIT: Hope that didn't sound unfreindly or snooty :-) I "reinvent" scripts all the time and as my understanding grows, I tackle more difficult ones.
You can see how I truncated and parsed out the message in my script and you could do the same thing.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
12-15-2006 14:33
unfortunately I don't comprehend what's actually going on in these examples (or the 4 scripts you've shown me via pasted code and links). Bosses code examples are a bit tangled, and kind of not working.. so I'd have to untangle them just to fix them. Newgate is fond of handing me code 3-6 lines at a time.. which is great when I know what he's doing.. but much of thise is way over my head.

Sure I'd love to improve what I'm doing.. but code snippets aren't going to help me. My original script reads an unlimited number of lines from a notecard... cycling through them and then returning to the top. It wipes the board between lines, and pauses each time it writes to the board. it uses a font I drew.

I realize this has been done before, but I didn't like the purchaseable versions I found, so I thought I'd make my own. I got pretty far on mine. then I was told to throw it all out and do it a different way. Then as I was doing that, someone else told me to throw it all out and do it a different way, and finally I just decided to ignore that, and now you're telling me not to even bother because it's been done before.

Problem is.. every set of scripts people throw at me, I sit here and try.. and poke.. and stare at... not knowing at all what's going on. Your "package" isn't working for me.. not broken like Boss's.. just simply "doing nothing at all". So that leaves me with my message board.. right here I was hours ago.

the 5 face prim seems cool.. til you figure out that you can't use an alpha transparency.

The fact is, I'm frustrated.. really frustrated. and so far the only thing that works.. is the script you all keep saying is a waste of time. I start refitting the script to use 3 faces on the display prim, someone throws out a 5 face prim. I try using a 4 face prim.. and end up with irregular coordinates that vary from face to face.. and therefore I have no patter to follow to determine the math involved to calculate these things. it took me 7 years to get through Algebra 1... and this is all just getting more and more complicated the shorter the scripts get.

I'm going to walk away from this whole thing at this point.. I'm going to bed. I'd say at this point there's less than a 50/50 chance that I will ever pick it back up.
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-15-2006 16:02
WOW that is one hell of a response. Let me see. I spent 45 minutes of my time rewriting your code yesterday and it did work. Then today I spent even more time digging through threads to give you some more scripts and then created my own driver code for it. I posted NO snippets at all. My last post has all the scripts and wroks just fine. I spent my own time in world and checked it. No it is not your script, but it does work and works well.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Tyken Hightower
Automagical
Join date: 15 Feb 2006
Posts: 472
12-15-2006 16:06
From: Winter Ventura

the 5 face prim seems cool.. til you figure out that you can't use an alpha transparency.

You might want to check into this more.
_____________________
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
12-15-2006 16:57
From: Winter Ventura
Newgate is fond of handing me code 3-6 lines at a time.. which is great when I know what he's doing.. but much of thise is way over my head.


Actually Newgy is just fond of solving problems, writing code and eating cheese. Oh and drinking beer. And meetign women. Nice ones anyway. And dont forget rats. Loved my ratties.

I keep finding myself stuck between writing entire scripts for people or just giving them enough to let them know how to get on and do it themselves, its the old give a man a fish problem. I dont want to be seen to be enforcing my scripting style on people or with having all the fun :) but I do find coding fun.

Unfortunately I was forced to leave SL earlier than expected, RL is such a hinderance sometimes, but I will endeavour to Newgy-ise the scripts and see if we cant produce something you're happy with.

From: Winter Ventura
Sure I'd love to improve what I'm doing.. but code snippets aren't going to help me. My original script reads an unlimited number of lines from a notecard... cycling through them and then returning to the top. It wipes the board between lines, and pauses each time it writes to the board. it uses a font I drew.


I actually like your script Winter, ok its not the best solution but it worked. And a working script can be optomised far easier than a stripped down go faster one thats broken can be made to work. It was also a good script to show where optomisation can be added by a little bit of lateral thought or stepping back and looking at the patterns in the code rather than the code itself.

From: Winter Ventura
The fact is, I'm frustrated.. really frustrated. and so far the only thing that works.. is the script you all keep saying is a waste of time. I start refitting the script to use 3 faces on the display prim, someone throws out a 5 face prim. I try using a 4 face prim.. and end up with irregular coordinates that vary from face to face.. and therefore I have no patter to follow to determine the math involved to calculate these things. it took me 7 years to get through Algebra 1... and this is all just getting more and more complicated the shorter the scripts get.


I dont remember anyone saying your script was a waste of time. I'm more than happy to work with what you have as a basis although it will ultimately mutate into something I am more happy/familiar with. But thats just writing style, we all develop our own pet ways of approaching problems.

Hopefully the scripts I post are commented enough that you can follow what Im doing, if not say so and I'll add additional comments.

Will get back to you as early as I can. and if I get any online time I'll come play again.
1 2