Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

notecard reader in chat

Jackson Racer
Mhm I gotta SL Blog
Join date: 19 Dec 2006
Posts: 130
02-22-2008 07:05
Hi I’m trying to make a very simple text tutorial on how to copy a prim for some step by step work-on-your-own tutorials.
My goal was to click a prim and have text displayed in a delayed manner reading from a note card.

So if the clickee clicked on the prim a portion of text would display “drop a prim on ground…..”
It would wait a few seconds and then the next line of text would display “select prim hold shift key…..”
Of course the note card goes a little more in detail…..
For some reason maybe its lag it doesn’t appear to be working for me


CODE

key kQuery;
integer iLine = 0;
default {

state_entry() {
llSay(0, "Reading notecard...");
kQuery = llGetNotecardLine("My Notecard", iLine); // read in "My Notecard" when you can
}

dataserver(key query_id, string data) {

if (query_id == kQuery) { // were we called to work on "My Notecard"?
// this is a line of our notecard
if (data == EOF) {

llSay(0, "No more lines in notecard, read " + (string)iLine + " lines.");

} else {

// increment line count
llSay(0, "Line " + (string)iLine + ": " + data); // data has the current line from this notecard

//request next line
iLine++;
kQuery = llGetNotecardLine("My Notecard", iLine); // read another line when you can

}
}
}
}



I plan on making a few of the super easy techniques like this for some of the newer builder.

Thanks for your help
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
02-22-2008 07:26
What is not working for you?
The part with the pause, displaying the lines or what?
_____________________
From Studio Dora
Jackson Racer
Mhm I gotta SL Blog
Join date: 19 Dec 2006
Posts: 130
02-22-2008 07:37
From: Dora Gustafson
What is not working for you?
The part with the pause, displaying the lines or what?


I'm sorry was trying my best to go into detail about what I wanted to accomplish and didnt say exactly what the problem was. :D

The delay in the text is my problem, I have the first line of the note card to display and then thats it. I'm hoping it's just a lag issue but wasn't sure --maybe the code.
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
02-22-2008 07:50
From: Jackson Racer
I'm sorry was trying my best to go into detail about what I wanted to accomplish and didnt say exactly what the problem was. :D

The delay in the text is my problem, I have the first line of the note card to display and then thats it. I'm hoping it's just a lag issue but wasn't sure --maybe the code.

As I read your script it will show all lines with no delay between them, is that what is the problem?
A delay can be accomplished with a llSleep( x ) function or a llSetTimerEvent( y ) function with event: timer()
_____________________
From Studio Dora
Jackson Racer
Mhm I gotta SL Blog
Join date: 19 Dec 2006
Posts: 130
02-22-2008 08:42
Ah ok, thanks soon as I can get In World I will tinker around


Thanks