Prize Chair! (Jesse was bored)
|
|
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
|
11-30-2006 20:54
Alright guys.. Jesse just sent me an IM.. letting me know he was bored. (bet he never does that again!). Over the last few weeks, I've been trying to make a "Lucky Chair"... I realize that the nice ones are only $400L.. but camping chairs are relatively cheap too, and we made one. (and a tip jar, and a... okay.. it's something to make.) A Prize chair is a fairly 'new' object on the market. It's function is ingenious. How to attract large numbers of people to your land, in a short period of time, without having them turn into zombies? The answer seems to be, give stuff away. People are encouraged to use groups to kibitz about what letters are where.. and to teleport in their friends and cohorts. The chairs cycle faster, more "fun stuff" is distributed, and traffic scores go up. Whether those people will actually buy something from you, or return later to shop.. that's up to the owner's skill and product quality.
A prize chair operates on the "I'm picking a letter" concept. The chair randomly selects a letter, and then displays that letter in some manner. At the same time, it selects a random "prize" form it's inventory. The best prize chairs display a picture of that prize. Then, a timer begins.
If a person sist down, whose name BEGINS with that letter... (W for me, not V).. the chair makes some "Huzzah" noise (particles, sound, chat lines) and then kicks the person sitting, and gives to them, the prize. It then resets the timer, selects a new prize and letter, and waits for it's next winner.
If someone sits on it whose name doesn't start with the magic letter.. it politely boots the sitter with a "sorry, I'm looking for someone whose name begins with _____" I tried to break this down into sections, to make it easier to attack. Frankly, there's a lot of ccomponents, and I'm really slow at scripting. But I'll share the code sections I have, and we can work from there. My brother, Edgar Tully did a bunch of the work on this too. The scripts below ARE NOT COMPLETE, FUNCTIONING SCRIPTS.... and frankly there's a lot of work that needs to be done to hammer these into a useful shape. But it's less boring than a digital clock.. and the cheaper we make these to implement.. perhaps we'll see fewer camping chair complaints in the forums. The Chair Script integer newLetterEvery = 30;
string alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; key userKey; string userName; string userLetter; integer randomNumber; string randomLetter;
detectLetter() { userKey = llAvatarOnSitTarget(); userName = llKey2Name(userKey); userLetter = llToUpper(llGetSubString(userName, 0, 0)); llSay(0, "Detected user: " + userName); llSay(0, "Detected user's name begins with: " + userLetter); }
pickLetter() { randomNumber = (integer)llRound(llFrand(25)); string randomLetter = llGetSubString(alphabet, randomNumber, randomNumber); llSetText("I have chosen a letter, and that letter is " + randomLetter, <1, 1, 1>, 1); }
newLetter() { pickLetter(); llSetTimerEvent(newLetterEvery); }
Detect Letter Script default { state_entry() { llSay(0, "Ready"); newLetter(); } timer() { pickLetter(); }
changed(integer change) { detectLetter(); if (change & CHANGED_LINK) { if(userKey != NULL_KEY) { if(userLetter == randomLetter) { llSay(0, "You win the prize! Yay!"); llUnSit(userKey); } else { llSay(0, "You don't win! Yay!"); llUnSit(userKey); } } if (userKey == NULL_KEY) { llSay(0, "null key"); //Do nothing } } } } I had been working on some of the display elements.. but apparrently it never got renamed, and is lost in thesea of "Objects" in my inventory. I spent more time looking than I should have. Here's the UUID of the letters I was going to use for the display.. though now that I think about it, I had planned to go in and redo the graphic so that it also had numbers on it (that way, only ONE texture had to load to display numbers and/or letters. da60cf15-3508-2951-3ec9-c83e0252626a (I'll make a new one (512x 256.. 9 wide by 4 long, as follows: 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 1 2 3 4 5 6 7 8 9 0
_____________________
 ● Inworld Store: http://slurl.eclectic-randomness.com ● Website: http://www.eclectic-randomness.com ● Twitter: @WinterVentura
|
|
Benni Lederberg
Registered User
Join date: 25 Sep 2006
Posts: 0
|
He He He - That bored Jesse?????
12-01-2006 12:35
Newgy's entry... I've added an owner menu to allow setting of the time out. // Owner Menu for Prize Chair
string prizeString = "30 Seconds";
list Choices = ["Off","30 Seconds","1 minute","2 minutes","3 minutes","4 minutes","5 minutes","6 minutes","7 minutes","8 minutes","9 minutes","10 minutes"];
integer Listening = 0; integer listenchannel = 0;
SaveParameters() { llSetObjectDesc(prizeString); llMessageLinked(LINK_THIS,0,"RESET",NULL_KEY); }
GetParameters() { string str = llGetObjectDesc(); if(llStringLength(str) > 0) prizeString = str; }
UpdateListen(key id) { CancelListen(); Listening = llListen(listenchannel,"",id,""); llSetTimerEvent(30); }
CancelListen() { if(Listening > 0) llListenRemove(Listening); Listening = 0; llSetTimerEvent(0); }
// Owner Conversation Dialog ShowMainMenu(key id) { string text = "Prize Chair Menu\nCurrent Settings is " + prizeString + "\nPlease Select an Option"; // finally show the dialog llDialog(id,text,Choices,listenchannel); UpdateListen(id); }
// States default { state_entry() { GetParameters(); state Running; } on_rez(integer num) { llResetScript(); } }
state Running { state_entry() { llSetTimerEvent(0); }
touch_start(integer total_number) { // Owner key id = llDetectedKey(0); if( (id == llGetOwner())) { state Menu; } } }
state Menu { state_entry() { listenchannel = (integer)llFrand(2147483646) + 1; ShowMainMenu(llGetOwner()); } on_rez(integer num) { state default; }
timer() { CancelListen(); state Running; }
listen( integer channel, string name, key id, string message ) { CancelListen(); if("On" == message) { // Force the anuimation script to reset SaveParameters(); state Running; } else if("Off" == message) state Disabled; else { integer index = llListFindList(Choices, [ message ]); if(index >= 0) { prizeString = message; SaveParameters(); state Running; } } } }
state Disabled { state_entry() { llMessageLinked(LINK_THIS,0,"DISABLED",NULL_KEY); } touch_start(integer total_number) { // Owner or owner Group control key id = llDetectedKey(0); if( (id == llGetOwner())) { state Menu; } } }
And now the main script Used Winters orginal code where appliciable. Automatically builds a list of prizes from the objects in its inventory Could be expanded to be from anything in inventory... // Prize Chair key userKey; string userName; string userLetter; string randomLetter;
string Letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
integer newLetterEvery = 30;
list Inventory;
GetParameters() { newLetterEvery = (integer)llGetObjectDesc(); if(newLetterEvery < 30)newLetterEvery *= 60; // Convert to minutes if less than 30 }
detectLetter() { userName = llKey2Name(userKey); userLetter = llToUpper(llGetSubString(userName, 0, 0)); llSay(0, "Detected user: " + userName); llSay(0, "Detected user's name begins with: " + userLetter); }
pickLetter() { integer randomNumber = (integer)llRound(llFrand(llStringLength(Letters))); randomLetter = llGetSubString(Letters, randomNumber, randomNumber); llSetText("I have chosen a letter, and that letter is " + randomLetter, <1, 1, 1>, 1); }
newLetter() { pickLetter(); llSetTimerEvent(newLetterEvery); }
GivePrize() { integer length = llGetListLength(Inventory); integer prize = (integer)llFrand(length); string prizeString = llList2String(Inventory,prize); llShout(0,"Congratulations " + userName + ", you win a " + prizeString); llGiveInventory(userKey,prizeString); }
GetInventoryList() { Inventory = []; integer i; // Only allow Objects - could be expanded to include anything. integer num = llGetInventoryNumber(INVENTORY_OBJECT); for (i = 0; i < num; ++i) { string name = llGetInventoryName(INVENTORY_OBJECT, i); Inventory = (Inventory = []) + Inventory + [name]; } }
// States default { state_entry() { GetInventoryList(); GetParameters(); newLetter(); } timer() { pickLetter(); }
changed(integer change) { if (change & CHANGED_LINK) { userKey = llAvatarOnSitTarget(); if(userKey != NULL_KEY) { detectLetter(); if(userLetter == randomLetter) { GivePrize(); llUnSit(userKey); newLetter(); } else { llSay(0, "Sorry You don't win!"); llUnSit(userKey); } } } else if(change & CHANGED_INVENTORY) { llResetScript(); } }
link_message(integer sender_num, integer num, string str, key id) { if("DISABLED" == str) { state Disabled; } else if("RESET" == str) { llResetScript(); } }
on_rez(integer num) { llResetScript(); } }
state Disabled { state_entry() { llSetText("Sorry not in Use",<1,0,0>,1); // Set the hovertext to off } link_message(integer sender_num, integer num, string str, key id) { if("RESET" == str) llResetScript(); } }
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
12-01-2006 12:38
Newgy's entry... I've added an owner menu to allow setting of the time out. // Owner Menu for Prize Chair
string prizeString = "30 Seconds";
list Choices = ["Off","30 Seconds","1 minute","2 minutes","3 minutes","4 minutes","5 minutes","6 minutes","7 minutes","8 minutes","9 minutes","10 minutes"];
integer Listening = 0; integer listenchannel = 0;
SaveParameters() { llSetObjectDesc(prizeString); llMessageLinked(LINK_THIS,0,"RESET",NULL_KEY); }
GetParameters() { string str = llGetObjectDesc(); if(llStringLength(str) > 0) prizeString = str; }
UpdateListen(key id) { CancelListen(); Listening = llListen(listenchannel,"",id,""); llSetTimerEvent(30); }
CancelListen() { if(Listening > 0) llListenRemove(Listening); Listening = 0; llSetTimerEvent(0); }
// Owner Conversation Dialog ShowMainMenu(key id) { string text = "Prize Chair Menu\nCurrent Settings is " + prizeString + "\nPlease Select an Option"; // finally show the dialog llDialog(id,text,Choices,listenchannel); UpdateListen(id); }
// States default { state_entry() { GetParameters(); state Running; } on_rez(integer num) { llResetScript(); } }
state Running { state_entry() { llSetTimerEvent(0); }
touch_start(integer total_number) { // Owner key id = llDetectedKey(0); if( (id == llGetOwner())) { state Menu; } } }
state Menu { state_entry() { listenchannel = (integer)llFrand(2147483646) + 1; ShowMainMenu(llGetOwner()); } on_rez(integer num) { state default; }
timer() { CancelListen(); state Running; }
listen( integer channel, string name, key id, string message ) { CancelListen(); if("Off" == message) state Disabled; else { integer index = llListFindList(Choices, [ message ]); if(index >= 0) { prizeString = message; SaveParameters(); state Running; } } } }
state Disabled { state_entry() { llMessageLinked(LINK_THIS,0,"DISABLED",NULL_KEY); } touch_start(integer total_number) { // Owner or owner Group control key id = llDetectedKey(0); if( (id == llGetOwner())) { state Menu; } } }
And now the main script Used Winters orginal code where appliciable. Automatically builds a list of prizes from the objects in its inventory Could be expanded to be from anything in inventory... // Prize Chair key userKey; string userName; string userLetter; string randomLetter;
string Letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
integer newLetterEvery = 30;
list Inventory;
GetParameters() { newLetterEvery = (integer)llGetObjectDesc(); if(newLetterEvery < 30)newLetterEvery *= 60; // Convert to minutes if less than 30 }
detectLetter() { userName = llKey2Name(userKey); userLetter = llToUpper(llGetSubString(userName, 0, 0)); llSay(0, "Detected user: " + userName); llSay(0, "Detected user's name begins with: " + userLetter); }
pickLetter() { integer randomNumber = (integer)llRound(llFrand(llStringLength(Letters))); randomLetter = llGetSubString(Letters, randomNumber, randomNumber); llSetText("I have chosen a letter, and that letter is " + randomLetter, <1, 1, 1>, 1); }
newLetter() { pickLetter(); llSetTimerEvent(newLetterEvery); }
GivePrize() { integer length = llGetListLength(Inventory); integer prize = (integer)llFrand(length); string prizeString = llList2String(Inventory,prize); llShout(0,"Congratulations " + userName + ", you win a " + prizeString); llGiveInventory(userKey,prizeString); }
GetInventoryList() { Inventory = []; integer i; // Only allow Objects - could be expanded to include anything. integer num = llGetInventoryNumber(INVENTORY_OBJECT); for (i = 0; i < num; ++i) { string name = llGetInventoryName(INVENTORY_OBJECT, i); Inventory = (Inventory = []) + Inventory + [name]; } }
// States default { state_entry() { GetInventoryList(); GetParameters(); newLetter(); } timer() { pickLetter(); }
changed(integer change) { if (change & CHANGED_LINK) { userKey = llAvatarOnSitTarget(); if(userKey != NULL_KEY) { detectLetter(); if(userLetter == randomLetter) { GivePrize(); llUnSit(userKey); newLetter(); } else { llSay(0, "Sorry You don't win!"); llUnSit(userKey); } } } else if(change & CHANGED_INVENTORY) { llResetScript(); } }
link_message(integer sender_num, integer num, string str, key id) { if("DISABLED" == str) { state Disabled; } else if("RESET" == str) { llResetScript(); } }
on_rez(integer num) { llResetScript(); } }
state Disabled { state_entry() { llSetText("Sorry not in Use",<1,0,0>,1); // Set the hovertext to off } link_message(integer sender_num, integer num, string str, key id) { if("RESET" == str) llResetScript(); } }
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
12-01-2006 14:08
I spend a little bit of time Lucky Chair hopping when I am rarely on the MG. You mentioned using a texture for showing the letter. I can tell you from experience that the new chairs that use textures to show the letter basically s**k compared to the older llSetText chairs. When you teleport into an area crowded with people, you can see the floating text minutes before seeing the texture letter sometimes.
Sorry I didn't get a chance to jump on the script and thank you for posting it. Unfortunately I was trying to clearly repro some of the problems after this last update.
_____________________
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
|
|
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
|
12-01-2006 14:16
From: Jesse Barnett I can tell you from experience that the new chairs that use textures to show the letter basically s**k compared to the older llSetText chairs. When you teleport into an area crowded with people, you can see the floating text minutes before seeing the texture letter sometimes. Perhaps sticking something like "now looking for letter X" in the item description would help? It doesn't litter the place with hovertext, and at the same time anyone interested can put mouse over the chair and find out the current letter without having to load textures... o.O
|
|
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
|
12-01-2006 14:53
Obviously I'm gonna have to wake up before I can begin to look at this implementation, and then I'll come back with some responses. (sorry for the non-post... kind of a bad night's sleep)
_____________________
 ● 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-02-2006 06:36
From: Joannah Cramer Perhaps sticking something like "now looking for letter X" in the item description would help? It doesn't litter the place with hovertext, and at the same time anyone interested can put mouse over the chair and find out the current letter without having to load textures... o.O Although I understand the idea of limiting 'noise pollution' by not showing text, the whole idea is that we are advertising the chair so it needs to be overtly obvious. How about a particle stream of the letter in question? 
|
|
Draco Kamachi
Registered User
Join date: 24 Apr 2007
Posts: 5
|
Syntax
05-27-2007 06:03
Ive done a lot of work on the syntax of this, however I am very new to scripting, and am stumped. Someone else wanna give it a go? string prizeString = "30 Seconds"; list Choices = ["Off","30 Seconds","1 minute","2 minutes","3 minutes","4 minutes","5 minutes","6 minutes","7 minutes","8 minutes","9 minutes","10 minutes"]; integer Listening = 0; integer listenchannel = 0; // key userKey; string userName; string userLetter; string randomLetter; string Letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; integer newLetterEvery = 30; list Inventory; // SaveParameters() { llSetObjectDesc(prizeString); llMessageLinked(LINK_THIS,0,"RESET",NULL_KEY); } GetParameters() { string str = llGetObjectDesc(); if(llStringLength(str) > 0) prizeString = str; } UpdateListen(key id) { CancelListen(); Listening = llListen(listenchannel,"",id,""  ; llSetTimerEvent(30); } CancelListen() { if(Listening > 0) llListenRemove(Listening); Listening = 0; llSetTimerEvent(0); } ShowMainMenu(key id) { string text = "Prize Chair Menu\nCurrent Settings is " + prizeString + "\nPlease Select an Option"; llDialog(id,text,Choices,listenchannel); UpdateListen(id); } default { state_entry() { GetParameters(); state Running; } on_rez(integer num) { llResetScript(); } } state Running { state_entry() { llSetTimerEvent(0); } touch_start(integer total_number) { key id = llDetectedKey(0); if( (id == llGetOwner())) { state Menu; } } } state Menu { state_entry() { listenchannel = (integer)llFrand(2147483646) + 1; ShowMainMenu(llGetOwner()); } on_rez(integer num) { state default; } timer() { CancelListen(); state Running; } listen( integer channel, string name, key id, string message ) { CancelListen(); if("Off" == message) state Disabled; else { integer index = llListFindList(Choices, [ message ]); if(index >= 0) { prizeString = message; SaveParameters(); state Running; } } } } state Disabled { state_entry() { llMessageLinked(LINK_THIS,0,"DISABLED",NULL_KEY); } touch_start(integer total_number) { key id = llDetectedKey(0); if( (id == llGetOwner())) { state Menu; { } //} GetParameters(); { newLetterEvery = (integer)llGetObjectDesc(); if(newLetterEvery < 30)newLetterEvery *= 60; } detectLetter(); { userName = llKey2Name(userKey); userLetter = llToUpper(llGetSubString(userName, 0, 0)); llSay(0, "Detected user: " + userName); llSay(0, "Detected user's name begins with: " + userLetter); } pickLetter(); { integer randomNumber = (integer)llRound(llFrand(llStringLength(Letters))) ; randomLetter = llGetSubString(Letters, randomNumber, randomNumber); llSetText("I have chosen a letter, and that letter is " + randomLetter, <1, 1, 1>, 1); } newLetter(); { pickLetter(); llSetTimerEvent(newLetterEvery); } GivePrize(); { integer length = llGetListLength(Inventory); integer prize = (integer)llFrand(length); string prizeString = llList2String(Inventory,prize); llShout(0,"Congratulations " + userName + ", you win a " + prizeString); llGiveInventory(userKey,prizeString); } GetInventoryList(); { Inventory = []; integer i; integer num = llGetInventoryNumber(INVENTORY_OBJECT); for (i = 0; i < num; ++i) { string name = llGetInventoryName(INVENTORY_OBJECT, i); Inventory = (Inventory = []) + Inventory + [name]; } } default { state_entry() { GetInventoryList(); GetParameters(); newLetter(); } timer() { pickLetter(); } changed(integer change) { if (change & CHANGED_LINK) { userKey = llAvatarOnSitTarget(); if(userKey != NULL_KEY) { detectLetter(); if(userLetter == randomLetter) { GivePrize(); llUnSit(userKey); newLetter(); } else { llSay(0, "Sorry You don't win!"  ; llUnSit(userKey); } } } else if(change & CHANGED_INVENTORY) { llResetScript(); } } link_message(integer sender_num, integer num, string str, key id) { if("DISABLED" == str) { state Disabled; } else if("RESET" == str) { llResetScript(); } } on_rez(integer num) { llResetScript(); } } state Disabled { state_entry() { llSetText("Sorry not in Use",<1,0,0>,1); } link_message(integer sender_num, integer num, string str, key id) { if("RESET" == str) llResetScript(); } }
|
|
Usagi Musashi
UM ™®
Join date: 24 Oct 2004
Posts: 6,083
|
05-27-2007 06:29
WOW people this scripts are great!!!!!!!!!!!!!!!!  Thank you!!!!!!!
|
|
Draco Kamachi
Registered User
Join date: 24 Apr 2007
Posts: 5
|
05-27-2007 06:38
Wait till you try them, the syntax drove me mad. If you get it working please post the fix.
|
|
Usagi Musashi
UM ™®
Join date: 24 Oct 2004
Posts: 6,083
|
05-27-2007 06:57
From: Draco Kamachi Wait till you try them, the syntax drove me mad. If you get it working please post the fix. well i got most of them working eheh
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
05-27-2007 09:45
From: Draco Kamachi Wait till you try them, the syntax drove me mad. If you get it working please post the fix. What precisely gave you problems?
_____________________
I'm back......
|
|
Draco Kamachi
Registered User
Join date: 24 Apr 2007
Posts: 5
|
05-27-2007 10:26
Well, I ran into a lot of syntax errors and fixed all I could but one keeps popping up in the region where the menu stops and the chair starts, that I dont see a problem with.
} default { state_entry() { GetInventoryList(); GetParameters(); newLetter(); } The default is as far as I got.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
05-27-2007 12:19
From: Draco Kamachi Well, I ran into a lot of syntax errors and fixed all I could but one keeps popping up in the region where the menu stops and the chair starts, that I dont see a problem with.
} default { state_entry() { GetInventoryList(); GetParameters(); newLetter(); } The default is as far as I got. Interesting since both scripts compile fine for me. You do realise it was two seperate scripts?
_____________________
I'm back......
|
|
Draco Kamachi
Registered User
Join date: 24 Apr 2007
Posts: 5
|
lol
06-03-2007 06:40
That fixed it, Im going to beat my head against a brick wall now
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
06-03-2007 11:48
From: Draco Kamachi That fixed it, Im going to beat my head against a brick wall now Blame it on the lack of BB codes
_____________________
I'm back......
|
|
Sky Kawaguichi
Registered User
Join date: 6 Apr 2007
Posts: 2
|
08-28-2007 07:00
hello dear all
i can 't make it work .. maybe because i m french and i don't understand all you are saying .... ^-^
is there someone to help me ? maybe in game? pleaaasssseeeeeeee ......
|
|
Draco Kamachi
Registered User
Join date: 24 Apr 2007
Posts: 5
|
French
08-28-2007 07:11
Bien types. Jesse m'a juste envoyé un IM.. me faisant savoir qu'il s'est ennuyé (pari il ne fait encore jamais cela !). Au cours des dernières semaines, j'avais essayé de faire "une chaise chanceuse"... Je me rends compte que le gentil est seulement $400L.. mais les chaises campantes sont relativement bon marché aussi, et nous avons fait un (et une fiole de bout, et... un correct. il est quelque chose faire.) [ la chaise professionnelle d'INDENT] A est un objet assez 'nouvel 'sur le marché. C'est fonction est ingénieux. Comment attirer un grand nombre de personnes à votre terre, dans une période courte, sans les faire se transformer en zombis ? La réponse semble être, substance d'élasticité loin. Les gens sont encouragés à employer des groupes au kibitz au sujet de quelles lettres sont où. et pour déplacer par télépathie dans leurs amis et cohortes. Les chaises font un cycle plus rapidement, plus de "substance d'amusement" est distribuée, et les points du trafic montent. Si ces gens achèteront réellement quelque chose de vous, ou revenez plus tard au magasin. qui est jusqu'à la compétence du propriétaire et à la qualité du produit. Une chaise professionnelle actionne dessus "je le concept sélectionne lettre". La chaise choisit aléatoirement une lettre, et puis les affichages qui marquent avec des lettres d'une façon quelconque. En même temps, elle choisit une forme "professionnelle" aléatoire que c'est inventaire. Les meilleures chaises professionnelles montrent une image de ce prix. Puis, un temporisateur commence. Si un sist de personne vers le bas, dont le nom COMMENCE par cette lettre... (W pour moi, pas V).. la chaise fait un certain bruit de "Huzzah" (particules, bruit, lignes de causerie) et puis donne un coup de pied la séance de personne, et leur donne, le prix. Elle alors remet à zéro le temporisateur, choisit un nouveaux prix et lettre, et les attentes elle est prochain gagnant. Si quelqu'un s'assied là-dessus à qui nom ne commence pas par le magique marquez avec des lettres. il initialise poliment la garde d' enfants avec un "désolé, je recherche quelqu'un dont le nom commence par _____"[/ I ] [/CREUX ] que j'ai essayé de casser ceci vers le bas en sections, pour le faciliter pour attaquer. Franchement, il y a beaucoup de ccomponents, et je suis vraiment lent à scripting. Mais je partagerai les sections de code que j'ai, et nous pouvons travailler de là. Mon frère, Edgar Tully a effectué un groupe du travail sur ceci aussi. Les manuscrits ci-dessous NE SONT PAS LES MANUSCRITS COMPLETS et FONCTIONNANTS.... et franchement il y a beaucoup de travail qui doit être effectué pour marteler ces derniers dans une forme utile. Mais il est moins ennuyeux qu'un pendule à lecture digitale. et plus nous faisons ces derniers pour nous mettre en application meilleur marché. peut-être verront peu de plaintes de chaise campante dans les forum.
The Chair Script
integer newLetterEvery = 30;
string alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; key userKey; string userName; string userLetter; integer randomNumber; string randomLetter;
detectLetter() { userKey = llAvatarOnSitTarget(); userName = llKey2Name(userKey); userLetter = llToUpper(llGetSubString(userName, 0, 0)); llSay(0, "Detected user: " + userName); llSay(0, "Detected user's name begins with: " + userLetter); }
pickLetter() { randomNumber = (integer)llRound(llFrand(25)); string randomLetter = llGetSubString(alphabet, randomNumber, randomNumber); llSetText("I have chosen a letter, and that letter is " + randomLetter, <1, 1, 1>, 1); }
newLetter() { pickLetter(); llSetTimerEvent(newLetterEvery); }
Detect Letter Script default {
state_entry() { llSay(0, "Ready"); newLetter(); }
timer() { pickLetter(); }
changed(integer change) { detectLetter();
if (change & CHANGED_LINK) { if(userKey != NULL_KEY) { if(userLetter == randomLetter) { llSay(0, "You win the prize! Yay!"); llUnSit(userKey); } else { llSay(0, "You don't win! Yay!"); llUnSit(userKey); } } if (userKey == NULL_KEY) {
llSay(0, "null key"); //Do nothing } } }
}
J'avais travaillé à certains des éléments graphiques. mais apparrently il n'a jamais obtenu retitré, et est perdu dans le thesea des "objets" dans mon inventaire. J'ai passé plus de temps regardant que je devrais avoir. Voici l'UUID des lettres que j'allais employer pour l'affichage. cependant maintenant que je pense cela, j'avais projeté entrer et refaire le graphique de sorte qu'il ait également eu des nombres là-dessus (de cette façon, seulement UNE texture a dû charger pour montrer des nombres et/ou des lettres.
da60cf15-3508-2951-3ec9-c83e0252626a (I'll make a new one (512x 256.. 9 wide by 4 long, as follows:
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 1 2 3 4 5 6 7 8 9 0
Heres the first post my french sucks but you can get the idea of whats going on, I speak english and I never got it completely working so good luck. I used http://babelfish.altavista.com/tr for some of it and a lot of the grammar you might try them
Hopefully the creator can help you but if not I will give you what I have if I can find it, but it did not change letters.
|
|
Sky Kawaguichi
Registered User
Join date: 6 Apr 2007
Posts: 2
|
08-28-2007 07:23
draco was very nice here and in game, trying to help me .... but still not work  is there any lucky chairs creator around? lol
|
|
Sandor Jacobus
Registered User
Join date: 18 May 2007
Posts: 1
|
03-26-2008 04:47
It cannot works without this line in state entry: llSitTarget(<0.0, 0.0, 0.1>, ZERO_ROTATION);
llAvatarOnSitTarget() need it to works!!!
Then I also find lot of troubles in the last main release. Plz, rewrite it!
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
03-26-2008 19:48
From: Sandor Jacobus It cannot works without this line in state entry: llSitTarget(<0.0, 0.0, 0.1>, ZERO_ROTATION);
llAvatarOnSitTarget() need it to works!!!
Then I also find lot of troubles in the last main release. Plz, rewrite it! uhm this thread is 8mos old, and I'll bet the creator assumed that the person making this object would set a sit target (it is a chair) which doesn't actually have to be declared in the code, since it's a prim property and once called is set until changed... only you can prevent necro-posting.... =)
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|