Jump to content

Yurtiel

Resident
  • Posts

    26
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks Rolig, Once again you've helped me greatly. If I may though, is there any reason it was expecting me to reset it every time to use the for loop in it? Originally I had it set so that it didn't have a changed state and used the for loop and the loop was only supposed to activate if they attached it and they were the owner.
  2. default { changed(integer change) { if(change & CHANGED_OWNER) { llResetScript(); } } state_entry() { owner = llGetOwner(); llRequestPermissions(owner, PERMISSION_TRIGGER_ANIMATION); } run_time_permissions(integer perm) { if(perm & PERMISSION_TRIGGER_ANIMATION) { llSay(0, "Mmmm! Refreshing!"); integer cnt = 0; for(cnt = cnt; cnt <= cnt; ++cnt) { llStartAnimation(anim); llSleep(1.0); llPlaySound(sound, 0.5); llSleep(3.0); llStopSound(); } } } } For some stupid reason this script absolutely refuses tow ork no matter how I do it, I've worked on it for about an hour now with absolutely no progress. This is the final result and it's one that should work, but for some reason it doesn't. Whenever I wear the object this script is in, the object works fine, it plays the animation, plays the sound, doesn't give me any permission errors what so ever. Whenever I give it to anyone else however it starts to give them script errors, I noticed it's because I wasn't having the object update when it got a new owner, so I decided to have it reset when it changed owners. Originally the script was made with an attach() command but after reset the person would have to reattach it for it to work as it should which is a hassle I would like to prevent the customer from having. So in my bid I sought to just make it play the animation and sound through a start_entry() block where the wearer of the attached prim could just give it permissions manually which is much less of a hassle, however for some reason the script seems intent to not do this and instead start screaming out PERMISSION_TRIGGER_ANIMATION permission not given errors at the wearer for as long as it's attached and the loop is executing. This has frustrated me so much that I'm at the point I want to break something, and it's something I've done in prims thousands of times before in a similiar fashion. Does anyone know why this absolutely refuses to work now?
  3. Ah I see, thanks a ton, you've helped me more in less than 30 minutes than others did in an entire three days. I understand that, this was mainly just a way for me to experiment with data serve and take it in, it is rather ridiculous that script memory is limited so low, and that it breaks with such stupid reasons. SL is about as poorly optimized as you'd expect though require a ton of byte data for something that should be stupidly simple to process. Anyway, thank you for the help, it's much appreciated, and I gained a lot of new knowledge from it.
  4. Oh wow, now that I look at it it seemed so obvious. Isn't having the recursion in the translate function bad though? I was doing that before and it was causing it to have stack heap crashing errors.
  5. (Sorry, I also removed the integer translate bit so it's back to translate(integer line) )
  6. I see where the confusion coming in is at, I should have taken that out when I posted the script up, here's the original version I was using, it works fine, except for what I was explaining up there. It won't place the "Word" into the sentence as it should when it doesn't find it in the list, instead it just completely cuts out and does nothing, but it will translate words that ARE in the list if yout ry to translate a sentence again with just those words, as I explained above. integer Translate(integer line){ word = llList2String(PList, line); //take the word found = llListFindList(EnglishList, [word]); //Is that word in English vocabulary? found >=0 - if NOT found, found = -1 integer i; integer length = llGetListLength(EnglishList); for(i=0; i < length;i++) { if (found >=0) reqNC_Gorean = llGetNotecardLine("Gorean", found); //if English word is in vocabulary, find translation on G Notecard else if(found == -1) //English word is NOT in dictionary GSentence += word; //Add that to the G sentence }}
  7. integer Translate(integer line) { word = llList2String(PList, line); //take the word found = llListFindList(EnglishList, [word]); //Is that word in English vocabulary? found >=0 - if NOT found, found = -1 integer i; integer length = llGetListLength(EnglishList); for(i=0; i < length;i++) { if (found >=0) { reqNC_Gorean = llGetNotecardLine("Gorean", found); ++foundLine; return; } //if English word is in vocabulary, find translation on G Notecard else if(found == -1) //English word is NOT in dictionary { GSentence += word; //Add that to the G sentence ++foundLine; return; } } } still getting an error when that all paths are not returning a value.
  8. This didn't help at all, changing it to integer translate actually started giving me a "Not all code paths return a vlue" error and won't let me save the script.
  9. Thanks, and yeah I didn't even notice that screw up, it's supposed to be telling it to recognize when it's at the end of that particular string. I'll change it integer translate and see how it works then post the results.
  10. Been a while since I asked for help on here. I have been working on a translator to help me learn the dataserve stuff, but I seem to be having a problem with a crucial aspect of my script. As far as translating words that are in the notecard appropriately the script works fine. I'll explain what works and how it's SUPPOSED to work first of all. The script takes words that are put into channel 93, it then parses them to a list, takes out the punctuation and compares them to a notecard called "English" which has a list of words to be compared to and then fetches the equal line from another card labeled "Gorean" which is the word that it replaces the found word with. As far as finding words on the list and translating them it works fine, if it finds the word it translates it appropriately and continues on with it's job as it should, the problem I am having comes with if it does NOT find the word on the list labeled "English". What it should do in this instance, is add the word it couldn't find to the sentence and continue to translate the rest of the list before posting the sentence into chat, however the script isn't doing this, whenever it encounters a word that isn't in the list labeled "English" it instead seems to hiccup and completely forego's translating anything that's input. Example: When I put in the word above (A word in the list) it finds it and translates it correctly into Ia (Word in the translated word list). However if I put in the words above is or the word is by itself, nothing happens, and the script doesn't seem to be doing anything, I then have to reset the script before I can continue with the part that DOES translate. Can someone help with this please? I've been at it for a long time now and it's driving me insane, the script is below. list EnglishList = []; list Punctuation = [" ", "\"", "$", "(", ")", ".", ",", ";", ":", "-", "?", "!", "=", "*"]; //All Punctuation parsed away except ' and - These may be parts of English words string GSentence; //THIS will be the translated sentence in Gorean string word; //The Gorean word to be used in GSentence - will use XXXXX if word not in dictionary integer found; //The line in the Gorean notecard where the translation of the English word can be found integer foundLine= 0; //Counter on the number of wirds in the English sentence integer LL; //Length of parsed list generated from English sentence list PList; //The parsed list key reqNC_English; //Reading the English vocabulary into a list integer LineE = 0; //English NC line key reqNC_Gorean; //Reading the Gorean vocabulary, finding the right line integer LineG = 0; //Gorean NC line integer Consistency = FALSE; //Checking for same length of notecards key reqE_Length; //Finding the length of the E notecard key reqG_Length; //Finding the length of the G notecard integer ELength; integer GLength; integer limit = 64000; ParseMessage(string message) //Prsing the English sentence (said on /93) parsing away punctuations { PList = llParseString2List(message, Punctuation, []); LL = llGetListLength(PList); GSentence = ""; Translate(foundLine); //Go to translating the Parsed English sentence } Translate(integer line) { word = llList2String(PList, line); //take the word found = llListFindList(EnglishList, [word]); //Is that word in English vocabulary? found >=0 - if NOT found, found = -1 integer i; integer length = llGetListLength(EnglishList); for(i=0; i < length;i++) { if(found == -1 && word == llGetSubString(word, 0, -1)) //English word is NOT in dictionary { GSentence += word; //Add that to the G sentence ++foundLine; return line; } else if (found >=0) reqNC_Gorean = llGetNotecardLine("Gorean", found); //if English word is in vocabulary, find translation on G Notecard } } default { state_entry() { reqE_Length = llGetNumberOfNotecardLines("English"); //Get length of E notecard llSetMemoryLimit(limit); llScriptProfiler(PROFILE_SCRIPT_MEMORY); llScriptProfiler(PROFILE_NONE); } dataserver(key id, string data) { if(id == reqE_Length) //gets length of E notecard { ELength = (integer)data; reqG_Length = llGetNumberOfNotecardLines("Gorean"); //Now get length of G notecard } else if(id == reqG_Length) //Gets length of G notecard { GLength = (integer)data; if(GLength != ELength) //If they are NOT equally long (== inconsistent) { llOwnerSay("The Notecards do NOT have the same number of lines\n Fix that and try again!!"); } else if(GLength == ELength) //If they HAVE the same length { reqNC_English = llGetNotecardLine("English", LineE); //Get E notecard vocabulary into a list } } else if(id == reqNC_English) { if(data != EOF) //as long as we are NOT at the end of the NC { EnglishList += data; //add a new line ++LineE; // increase the line number reqNC_English = llGetNotecardLine("English", LineE); //and get that next line } else if(data == EOF) //If we are at the end of the E notecrd (all words are in our list now) { llListen(93, "", NULL_KEY, ""); //Open a listen on channel 93 } } else if(id == reqNC_Gorean) //THIS is the continuation of the above "Translate" function, when our E word had been on the list { //Find the Gorean translation and add a space to that word GSentence += data + " "; //Add the word to the Gorean sentence ++foundLine; //go to next English word in Parsed list if(foundLine < LL) //If there is another English word { Translate(foundLine); //translate that now } else if(foundLine == LL) //No more E word to translate { foundLine = 0; llSay(0,GSentence); //Say the Gorean Sentence llMessageLinked(LINK_THIS,0,GSentence,""); llResetScript(); } } } listen(integer channel, string name, key id, string message) //Listening on channel 93 { if(channel != 93 || id != llGetOwner()) return; else if(channel == 93 && id == llGetOwner()) //If said on correct channel { //llOwnerSay(message); ParseMessage(llToLower(message)); //Go parse that English sentence } } changed(integer change) { if(change & CHANGED_INVENTORY || change & CHANGED_OWNER) llResetScript(); //Reset if inventory is changed } }
  11. AHA, I FIXED IT. Thanks for everyone who was going to help or did : )
  12. I already tried this, it didn't make any difference.
  13. Main Menu Script: integer sCh; integer totalPrims; integer i; integer gL; string nOwn; string gOwn; string dOwn; vector link_pos; key uSr; default { touch_start(integer ts) { vector vec = llDetectedTouchST(0); if(vec.x >= 0.6 && vec.x <= 1.0 && vec.y >= 0.64 && vec.y <= 0.8) { state st_men_pos; } else if (vec.x >= 0.6 && vec.x <= 1.0 && vec.y >= 0.489 && vec.y <= 0.633) { state it_men_pos; } else if (vec.x >= 0.6 && vec.x <= 1.0 && vec.y >= 0.33 && vec.y <= 0.47) { state eq_men_pos; } else if (vec.x >= 0.6 && vec.x <= 1.0 && vec.y >= 0.165 && vec.y <= 0.308) { integer roll = (integer)(llFrand(21)); if(roll == 0) { roll = 1; } if (roll == 1) { llSay(0, "Critical Fail! " + nOwn + " Rolled a D20 check of " + (string)roll); state default; } if (roll == 21) { roll = 20; } if (roll == 20) { llSay(0, "Critical Success! " + nOwn + " Rolled a D20 check of " + (string)roll); state default; } else { llSay(0, nOwn + " Rolled a D20 check of " + (string)roll); state default; } } } } state st_men_pos { state_entry() { totalPrims = llGetNumberOfPrims(); // refresh every time in case new added for(i=1; i < totalPrims+1; i++) { // refresh for each link_pos = llList2Vector(llGetLinkPrimitiveParams(i, [PRIM_POS_LOCAL]), 0); if(llGetLinkName(i) == "StatMenu" && link_pos.y == 0.3) { llSetLinkPrimitiveParamsFast(i, [PRIM_POS_LOCAL, <0.0, -0.3, 0.0>]); } if (llGetLinkName(i) == "Strength" && link_pos.y == 0.30905) { llSetLinkPrimitiveParamsFast(i, [PRIM_POS_LOCAL, <-0.00636, -0.47530, 0.08252>]); } if (llGetLinkName(i) == "Dexterity" && link_pos.y == 0.30905) { llSetLinkPrimitiveParamsFast(i, [PRIM_POS_LOCAL, <-0.00636, -0.47530, 0.08252>]); } if (llGetLinkName(i) == "Magic" && link_pos.y == 0.30905) { llSetLinkPrimitiveParamsFast(i, [PRIM_POS_LOCAL, <-0.00636, -0.47530, 0.08252>]); } if (llGetLinkName(i) == "Vitality" && link_pos.y == 0.30905) { llSetLinkPrimitiveParamsFast(i, [PRIM_POS_LOCAL, <-0.00636, -0.47530, 0.08252>]); } if (llGetLinkName(i) == "Luck" && link_pos.y == 0.30905) { llSetLinkPrimitiveParamsFast(i, [PRIM_POS_LOCAL, <-0.00636, -0.47530, 0.08252>]); } if (llGetLinkName(i) == "Spirit" && link_pos.y == 0.30905) { llSetLinkPrimitiveParamsFast(i, [PRIM_POS_LOCAL, <-0.00636, -0.47530, 0.08252>]); } if (llGetLinkName(i) == "Pool" && link_pos.y == 0.25079) { llSetLinkPrimitiveParamsFast(i, [PRIM_POS_LOCAL, <-0.00636, -0.47530, 0.08252>]); } else if (llGetLinkName(i) == "StatMenu" && link_pos.y != 0.3) { llSetLinkPrimitiveParamsFast(i, [PRIM_POS_LOCAL, <0.0, 0.3, 0.0>]); } if (llGetLinkName(i) == "Strength" && link_pos.y != 0.30905) { llSetLinkPrimitiveParamsFast(i, [PRIM_POS_LOCAL, <-0.00636, 0.30905, 0.12671>]); } if (llGetLinkName(i) == "Dexterity" && link_pos.y != 0.30905) { llSetLinkPrimitiveParamsFast(i, [PRIM_POS_LOCAL, <-0.00636, 0.30905, 0.07813>]); } if (llGetLinkName(i) == "Magic" && link_pos.y != 0.30905) { llSetLinkPrimitiveParamsFast(i, [PRIM_POS_LOCAL, <-0.00636, 0.30905, 0.02832>]); } if (llGetLinkName(i) == "Vitality" && link_pos.y != 0.30905) { llSetLinkPrimitiveParamsFast(i, [PRIM_POS_LOCAL, <-0.00636, 0.30905, -0.02295>]); } if (llGetLinkName(i) == "Luck" && link_pos.y != 0.30905) { llSetLinkPrimitiveParamsFast(i, [PRIM_POS_LOCAL, <-0.00636, 0.30905, -0.07275>]); } if (llGetLinkName(i) == "Spirit" && link_pos.y != 0.30905) { llSetLinkPrimitiveParamsFast(i, [PRIM_POS_LOCAL, <-0.00636, 0.30905, -0.12769>]); } if (llGetLinkName(i) == "Pool" && link_pos.y != 0.25079) { llSetLinkPrimitiveParamsFast(i, [PRIM_POS_LOCAL, <-0.00636, 0.25079, -0.16455>]); } } state default; } } state it_men_pos { state_entry() { totalPrims = llGetNumberOfPrims(); // refresh every time in case new added for(i=1; i < totalPrims+1; i++) { // refresh for each link_pos = llList2Vector(llGetLinkPrimitiveParams(i, [PRIM_POS_LOCAL]), 0); if(llGetLinkName(i) == "ItemMenu" && link_pos.y == 0.3) { llSetLinkPrimitiveParamsFast(i, [PRIM_POS_LOCAL, <0.0, -0.3, 0.4>]); state default; } else if (llGetLinkName(i) == "ItemMenu" && link_pos.y != 0.3) { llSetLinkPrimitiveParamsFast(i, [PRIM_POS_LOCAL, <0.0, 0.3, 0.0>]); state default; } } } } state eq_men_pos { state_entry() { totalPrims = llGetNumberOfPrims(); // refresh every time in case new added for(i=1; i < totalPrims+1; i++) { // refresh for each link_pos = llList2Vector(llGetLinkPrimitiveParams(i, [PRIM_POS_LOCAL]), 0); if(llGetLinkName(i) == "EquipMenu" && link_pos.y == 0.3) { llSetLinkPrimitiveParamsFast(i, [PRIM_POS_LOCAL, <0.0, -0.3, -0.4>]); state default; } else if (llGetLinkName(i) == "EquipMenu" && link_pos.y != 0.3) { llSetLinkPrimitiveParamsFast(i, [PRIM_POS_LOCAL, <0.0, 0.3, 0.0>]); state default; } } } } This one works fine. Stat Menu Script: integer totalPrims; vector link_pos; vector vec; integer i; string lName; integer lNum; string dOwn; string nOwn; integer face; default { state_entry() { totalPrims = llGetNumberOfPrims(); vector vec = llDetectedTouchST(0); link_pos = llList2Vector(llGetLinkPrimitiveParams(i, [PRIM_POS_LOCAL]), 0); lName = llGetLinkName(i); lNum = llDetectedLinkNumber(i); dOwn = llDetectedKey(i); nOwn = llKey2Name(dOwn); face = llDetectedTouchFace(i); } touch_start(integer num_detected) { vector vec = llDetectedTouchST(0); for(i=1; i < totalPrims+1; i++) { } if(vec.x >= 0.78581 && vec.x <= 0.90754 && vec.y >= 0.88665 && vec.y <= 0.95054) { llMessageLinked(LINK_ALL_OTHERS, 0, "sinquiry", dOwn); state st_2men; } else if (vec.x>= 0.63341 && vec.x <= 0.74986 && vec.y >= 0.88481 &&vec.y <= 0.94738) { llMessageLinked(LINK_ALL_OTHERS, 0, "s2inquiry", dOwn); state st_2men; } if(vec.x >= 0.78581 && vec.x <= 0.90754 && vec.y >= 0.75020 && vec.y <= 0.81000) { llMessageLinked(LINK_ALL_OTHERS, 0, "dinquiry", dOwn); state st_2men; } else if (vec.x>= 0.63341 && vec.x <= 0.74986 && vec.y >= 0.74604 &&vec.y <= 0.80944) { llMessageLinked(LINK_ALL_OTHERS, 0, "d2inquiry", dOwn); state st_2men; } if(vec.x >= 0.78581 && vec.x <= 0.90754 && vec.y >= 0.60131 && vec.y <= 0.65875) { llMessageLinked(LINK_ALL_OTHERS, 0, "minquiry", dOwn); state st_2men; } else if (vec.x>= 0.63341 && vec.x <= 0.74986 && vec.y >= 0.59799 &&vec.y <= 0.65947) { llMessageLinked(LINK_ALL_OTHERS, 0, "m2inquiry", dOwn); state st_2men; } if(vec.x >= 0.78581 && vec.x <= 0.90754 && vec.y >= 0.44818 && vec.y <= 0.51979) { llMessageLinked(LINK_ALL_OTHERS, 0, "vinquiry", dOwn); state st_2men; } else if (vec.x>= 0.63341 && vec.x <= 0.74986 && vec.y >= 0.44635 &&vec.y <= 0.51735) { llMessageLinked(LINK_ALL_OTHERS, 0, "v2inquiry", dOwn); state st_2men; } if(vec.x >= 0.78581 && vec.x <= 0.90754 && vec.y >= 0.30436 && vec.y <= 0.38048) { llMessageLinked(LINK_ALL_OTHERS, 0, "linquiry", dOwn); state st_2men; } else if (vec.x>= 0.63341 && vec.x <= 0.74986 && vec.y >= 0.30615 &&vec.y <= 0.37517) { llMessageLinked(LINK_ALL_OTHERS, 0, "l2inquiry", dOwn); state st_2men; } if(vec.x >= 0.78581 && vec.x <= 0.90754 && vec.y >= 0.16449 && vec.y <= 0.23605) { llMessageLinked(LINK_ALL_OTHERS, 0, "spinquiry", dOwn); state st_2men; } else if (vec.x>= 0.63341 && vec.x <= 0.74986 && vec.y >= 0.16581 &&vec.y <= 0.23653) { llMessageLinked(LINK_ALL_OTHERS, 0, "sp2inquiry", dOwn); state st_2men; } } } state st_2men { state_entry() { totalPrims = llGetNumberOfPrims(); vector vec = llDetectedTouchST(0); link_pos = llList2Vector(llGetLinkPrimitiveParams(i, [PRIM_POS_LOCAL]), 0); lName = llGetLinkName(i); lNum = llDetectedLinkNumber(i); dOwn = llDetectedKey(i); nOwn = llKey2Name(dOwn); face = llDetectedTouchFace(i); } link_message(integer sender, integer num, string msg, key dOwn) { if(msg == "sinquiryt") { llMessageLinked(LINK_ALL_OTHERS, 0, "sadd", dOwn); state st_3men; } else if (msg == "s2inquiryf") { llSay(0, nOwn + " Stat already at minimum"); state default; } else if (msg == "s2inquiryt") { llMessageLinked(LINK_ALL_OTHERS, 0, "smin", dOwn); state st_3men; } if(msg == "dinquiryt") { llMessageLinked(LINK_ALL_OTHERS, 0, "dadd", dOwn); state st_3men; } else if (msg == "d2inquiryf") { llSay(0, nOwn + " Stat already at minimum"); state default; } else if (msg == "d2inquiryt") { llMessageLinked(LINK_ALL_OTHERS, 0, "dmin", dOwn); state st_3men; } if(msg == "minquiryt") { llMessageLinked(LINK_ALL_OTHERS, 0, "madd", dOwn); state st_3men; } else if (msg == "m2inquiryf") { llSay(0, nOwn + " Stat already at minimum"); state default; } else if (msg == "m2inquiryt") { llMessageLinked(LINK_ALL_OTHERS, 0, "mmin", dOwn); state st_3men; } if(msg == "vinquiryt") { llMessageLinked(LINK_ALL_OTHERS, 0, "vadd", dOwn); state st_3men; } else if (msg == "v2inquiryf") { llSay(0, nOwn + " Stat already at minimum"); state default; } else if (msg == "v2inquiryt") { llMessageLinked(LINK_ALL_OTHERS, 0, "vmin", dOwn); state st_3men; } if(msg == "linquiryt") { llMessageLinked(LINK_ALL_OTHERS, 0, "ladd", dOwn); state st_3men; } else if (msg == "l2inquiryf") { llSay(0, nOwn + " Stat already at minimum"); state default; } else if (msg == "l2inquiryt") { llMessageLinked(LINK_ALL_OTHERS, 0, "lmin", dOwn); state st_3men; } if(msg == "spinquiryt") { llMessageLinked(LINK_ALL_OTHERS, 0, "spadd", dOwn); state st_3men; } else if (msg == "sp2inquiryf") { llSay(0, nOwn + " Stat already at minimum"); state default; } else if (msg == "sp2inquiryt") { llMessageLinked(LINK_ALL_OTHERS, 0, "spmin", dOwn); state st_3men; } } } state st_3men { state_entry() { totalPrims = llGetNumberOfPrims(); vector vec = llDetectedTouchST(0); link_pos = llList2Vector(llGetLinkPrimitiveParams(i, [PRIM_POS_LOCAL]), 0); lName = llGetLinkName(i); lNum = llDetectedLinkNumber(i); dOwn = llDetectedKey(i); nOwn = llKey2Name(dOwn); face = llDetectedTouchFace(i); } link_message(integer sender, integer num, string msg,key dOwn) { if(msg == "sYes") { llMessageLinked(LINK_ALL_OTHERS, 0, "stadd", dOwn); state default; } else if (msg == "sNo") { llMessageLinked(LINK_ALL_OTHERS, 0, "stmin", dOwn); state default; } if(msg == "dYes") { llMessageLinked(LINK_ALL_OTHERS, 0, "dexadd", dOwn); state default; } else if(msg =="dNo") { llMessageLinked(LINK_ALL_OTHERS, 0, "dexmin", dOwn); state default; } if(msg == "mYes") { llMessageLinked(LINK_ALL_OTHERS, 0, "magadd", dOwn); state default; } else if(msg == "mNo") { llMessageLinked(LINK_ALL_OTHERS, 0, "magmin", dOwn); state default; } if(msg == "vYes") { llMessageLinked(LINK_ALL_OTHERS, 0, "vitadd", dOwn); state default; } else if(msg == "vNo") { llMessageLinked(LINK_ALL_OTHERS, 0, "vitmin", dOwn); state default; } if(msg == "lYes") { llMessageLinked(LINK_ALL_OTHERS, 0, "luckadd", dOwn); state default; } else if(msg == "lNo") { llMessageLinked(LINK_ALL_OTHERS, 0, "luckmin", dOwn); state default; } if(msg == "spYes") { llMessageLinked(LINK_ALL_OTHERS, 0, "spiritadd", dOwn); state default; } else if(msg == "spNo") { llMessageLinked(LINK_ALL_OTHERS, 0, "spiritmin", dOwn); state default; } if (msg == "No") { llSay(0, nOwn + " You have no available stat points "); state default; } if (msg == "Max") { llSay(0, nOwn + " You have maximum free points available"); state default; } } } This one worked fine until I added the "Inquiry" messages and created st_2men and st_3men. Now it's being treated as if it's not even running for some reason, the main menu script is overwriting it and whenever I click on the vectors specified it's treating them as the Main Menu vectors and moving stuff/dice rolling. Strength Pool: integer gcount = 0; integer totalPrims; vector link_pos; vector vec; integer i; string lName; integer lNum; string gOwn; string dOwn; integer face; default { state_entry() { totalPrims = llGetNumberOfPrims(); vector vec = llDetectedTouchST(0); link_pos = llList2Vector(llGetLinkPrimitiveParams(i, [PRIM_POS_LOCAL]), 0); lName = llGetLinkName(i); lNum = llDetectedLinkNumber(i); dOwn = llDetectedKey(i); face = llDetectedTouchFace(i); llSetText("+ " + (string)gcount, <1.0,1.0,1.0>, 1); } link_message(integer sender, integer num, string msg, key dOwn) { if (msg == "sinquiry" && gcount !=10) { llMessageLinked(LINK_ALL_OTHERS, 0, "sinquiryt", dOwn); state default; } else if (msg == "s2inquiry" && gcount == 0) { llMessageLinked(LINK_ALL_OTHERS, 0, "s2inquiryf", dOwn); state default; } else if (msg == "s2inquiry" && gcount !=0) { llMessageLinked(LINK_ALL_OTHERS, 0, "s2inquiryt", dOwn); state default; } if(msg == "stadd" && gcount != 10) { llSetText("+ " + (string)(++gcount), <1.0,1.0,1.0>, 1); state default; } if(msg == "stmin" && gcount == 0) { llMessageLinked(LINK_ALL_OTHERS, 0, "Min", dOwn); state default; } else if (msg == "stmin" && gcount !=0) { llSetText("+ " + (string)(--gcount), <1.0,1.0,1.0>, 1); state default; } } } Added this so you can see what's going on, the script worked fine until I put in the Inquiry messages as mentioned in the stat menu section. Free Stat Point Pool: integer gcount = 10; integer totalPrims; vector link_pos; vector vec; integer i; string lName; integer lNum; string gOwn; string dOwn; integer face; default { state_entry() { llSetText((string)gcount, <1.0, 1.0, 1.0>, 1); totalPrims = llGetNumberOfPrims(); vector vec = llDetectedTouchST(0); link_pos = llList2Vector(llGetLinkPrimitiveParams(i, [PRIM_POS_LOCAL]), 0); lName = llGetLinkName(i); lNum = llDetectedLinkNumber(i); dOwn = llDetectedKey(i); face = llDetectedTouchFace(i); } link_message(integer send, integer num, string msg, key dOwn) { if(msg == "sadd" && gcount !=0) { llSetText((string)(--gcount), <1.0,1.0,1.0>, 1); llMessageLinked(LINK_ALL_OTHERS, 0, "sYes", dOwn); state default; } else if(msg == "sadd" && gcount == 0) { llMessageLinked(LINK_ALL_OTHERS, 0, "No", dOwn); state default; } if(msg == "dadd" && gcount !=0) { llSetText((string)(--gcount), <1.0,1.0,1.0>, 1); llMessageLinked(LINK_ALL_OTHERS, 0, "dYes", dOwn); state default; } else if(msg == "dadd" && gcount == 0) { llMessageLinked(LINK_ALL_OTHERS, 0, "No", dOwn); state default; } if(msg == "madd" && gcount !=0) { llSetText((string)(--gcount), <1.0,1.0,1.0>, 1); llMessageLinked(LINK_ALL_OTHERS, 0, "mYes", dOwn); state default; } else if(msg == "madd" && gcount ==0) { llMessageLinked(LINK_ALL_OTHERS, 0, "No", dOwn); state default; } if(msg == "vadd" && gcount !=0) { llSetText((string)(--gcount), <1.0,1.0,1.0>, 1); llMessageLinked(LINK_ALL_OTHERS, 0, "vYes", dOwn); state default; } else if(msg == "vadd" && gcount ==0) { llMessageLinked(LINK_ALL_OTHERS, 0, "No", dOwn); state default; } if(msg == "ladd" && gcount !=0) { llSetText((string)(--gcount), <1.0,1.0,1.0>, 1); llMessageLinked(LINK_ALL_OTHERS, 0, "lYes", dOwn); state default; } else if (msg == "ladd" && gcount ==0) { llMessageLinked(LINK_ALL_OTHERS, 0, "No", dOwn); state default; } if(msg == "spadd" && gcount !=0) { llSetText((string)(--gcount), <1.0,1.0,1.0>, 1); llMessageLinked(LINK_ALL_OTHERS, 0, "spYes", dOwn); state default; } else if (msg == "spadd" && gcount ==0) { llMessageLinked(LINK_ALL_OTHERS, 0, "No", dOwn); state default; } if(msg == "smin" && gcount != 10) { llSetText((string)(++gcount), <1.0,1.0,1.0>, 1); llMessageLinked(LINK_ALL_OTHERS, 0, "sNo", dOwn); state default; } else if (msg == "smin" && gcount == 10) { llMessageLinked(LINK_ALL_OTHERS, 0, "Max", dOwn); state default; } if (msg == "dmin" && gcount != 10) { llSetText((string)(++gcount), <1.0,1.0,1.0>, 1); llMessageLinked(LINK_ALL_OTHERS, 0, "dNo", dOwn); state default; } else if (msg == "dmin" && gcount == 10) { llMessageLinked(LINK_ALL_OTHERS, 0, "Max", dOwn); state default; } if (msg == "mmin" && gcount != 10) { llSetText((string)(++gcount), <1.0,1.0,1.0>, 1); llMessageLinked(LINK_ALL_OTHERS, 0, "mNo", dOwn); state default; } else if (msg == "mmin" && gcount == 10) { llMessageLinked(LINK_ALL_OTHERS, 0, "Max", dOwn); state default; } if (msg == "vmin" && gcount != 10) { llSetText((string)(++gcount), <1.0,1.0,1.0>, 1); llMessageLinked(LINK_ALL_OTHERS, 0, "vNo", dOwn); state default; } else if (msg == "vmin" && gcount == 10) { llMessageLinked(LINK_ALL_OTHERS, 0, "Max", dOwn); state default; } if (msg == "lmin" && gcount != 10) { llSetText((string)(++gcount), <1.0,1.0,1.0>, 1); llMessageLinked(LINK_ALL_OTHERS, 0, "lNo", dOwn); state default; } else if (msg == "lmin" && gcount == 10) { llMessageLinked(LINK_ALL_OTHERS, 0, "Max", dOwn); state default; } if (msg == "spmin" && gcount != 10) { llSetText((string)(++gcount), <1.0,1.0,1.0>, 1); llMessageLinked(LINK_ALL_OTHERS, 0, "spNo", dOwn); state default; } else if (msg == "spmin" && gcount == 10) { llMessageLinked(LINK_ALL_OTHERS, 0, "Max", dOwn); state default; } if(gcount < 0) { gcount = 0; } if (gcount > 10) { gcount = 10; } } } This one says it's working fine, And it should be. I've been going over this for three hours now, everything worked fine with a minor bug that when you would click to remove a stat point and the stat was already at 0 it would give the free points pool an extra stat anyway and cause it to go up, so I added the "Inquiry" messages to the code with the new st_2men and st_3men states. Now it seems that the main menu script is overwriting the stat menu script. Can you guys see something I'm apparently not?
  14. I see, and is there a way to save that new number as a new integer, or would I have to define each number globally and define it within each IF statement.
  15. Now for my last question (And should be the last one I need to ask for a while.) I need to know how to set up a system where, when you click on a prim, it will have the default value of 0 It will then tick up to 1 when clicked. And will then tick up to 2 when clicked again. up to a max of 10 So on and so forth. I then need to make it so that when another prim is clicked, it will take that value and subtract 1. So on 1st click total = 9 2nd: total = 8 etc etc. I don't want people to think that I'm just requesting a script I'm going to use, I just need examples of this because I can't seem to find any anywhere. And all the ones I see use it in a loop instance of num_detected ++i. However I'd like to refrain from using num_detected if at all possible because I'm not entirely sure if it will do the equations right that I need it too.
×
×
  • Create New...