Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Notecard Settings Help Needed

GawN Uggla
Registered User
Join date: 10 Apr 2007
Posts: 3
01-19-2008 14:58
Ok well Im trying to make it so that my script uses text string from a notecard so that the users can customise the text that is said.

Basics of my script, it is a game spotlight. Listens to the game and when the game says certain things the spotlight repsonds. So heres an example:

if (llList2String(chatline,0) == "Loading";)
{
llShout(0, "Come on people Unlock thoses Cards!";);

so its listening i want it so the shout can be customised using notecards, but i cant get my heard around the notcard settings script. It confuses me so much.

Please Help me.
Monica Balut
Beam-Me
Join date: 18 Feb 2007
Posts: 311
01-19-2008 16:05
It's not entirely clear to me what you're confused about. Looks like to plan to strore information in lists that you read from a note card. I'm assuming you're struggling with how to set up the note card.

What if you set things up as: CodeString==ExpandedString, one per line in your notecard. I assume you know how to read a note card. When you read each line, parse it using llParseString2List using == as the separator. You can store the results either in two separate lists or in one strided list. Then you can look up the CodeString as you are doing and get the Expanded string that goes with it.
GawN Uggla
Registered User
Join date: 10 Apr 2007
Posts: 3
01-19-2008 16:33
lol lost you when you said codestring, im not an expert at LSL me and a mate coded my script.

Ill try to explain better.

the script listens for certain phrases by the gameboard and when said my script replys and says somthing. I want to be able to edit what my script says in the notecard.
Monica Balut
Beam-Me
Join date: 18 Feb 2007
Posts: 311
01-19-2008 17:04
So you have a bunch of phrases that are said by your gameboard and you want your script to same something else when it hears the gameboard phrase. So using your terminology, set up each line of your note card to read like this:

GameboardPhrase1==ExpandedPhrase1
GameboardPhrase2==ExpandedPhase2

Then just parse these into separate lists: GameboardList & ExpandedPhaseList.

Then when your script hear a GameboardPhrase, get its index in the first list. Use that index to find the Expanded phrase in the second list.

If you are the only one changing these lists, you could save yourself a lot of trouble by just hard coding it all into the script rather than bothering with notecards.
GawN Uggla
Registered User
Join date: 10 Apr 2007
Posts: 3
01-19-2008 17:23
no im not the only one i wanna offer the people i have sold these to, the ability to change the announcing texts. Is there anyway you can come on SL and help me.
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
01-19-2008 21:30
I would do a property style notecard. Lines that look like "key separator value" (e.g. "key: value" or "key=value". Then create the lists suggested above in your script by reading the notecard (or sort the notecard in a way that will allow a binary search each time and possibly add a cache if it is too much data to hold in your script at any given time). When the game board says a key, you have the script speak the associated value.