Jump to content

testgenord1

Resident
  • Content Count

    57
  • Joined

  • Last visited

Community Reputation

8 Neutral

About testgenord1

  • Rank
    Advanced Member

Recent Profile Visitors

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

  1. Thank you very much for your help. I also thought this cannot be right. No idea how this happened. Nova Convair's suggestion seems to have solved the problem. I learned something new today. Thank you very much again!
  2. Hi! I have a script that causes an object to attach as a HUD: First the object containing the script is rezzed by a different object through touch_start. That rezzing object then sends the key of the avatar touching it over channel -10001 to the rezzed object containing the script. This now, in turn, on listening, attaches as a HUD to the touching avatar having that key. When I use the constant ATTACH_HUD_CENTER_1 as the attachment point in the script below, it produces the following error: When I use the number value (35) instead, the script works. Do you maybe have an idea why this is the case? Or is my script faulty? Thank you very much in advance. Here is the script: default { state_entry() { llListen(-10001,"",NULL_KEY,""); } listen(integer channel, string name, key id, string message) { key toucher = (key)message; llRequestPermissions(toucher , PERMISSION_ATTACH | PERMISSION_TRIGGER_ANIMATION); } run_time_permissions( integer vBitPermissions ) { if( vBitPermissions & PERMISSION_ATTACH | PERMISSION_TRIGGER_ANIMATION ) { llAttachToAvatarTemp( 35 ); llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION,0)); llSleep(15); llDetachFromAvatar( ); } else { llOwnerSay( "Permission to attach denied" ); } } on_rez(integer rez) { if(!llGetAttached()) { //reset the script if it's not attached. llResetScript(); } } }
  3. Hi! In the Firestorm Viewer, when I click "ignore" on a menu started by a script, the object remains blocked permanently. That is, when you click the object again, the dialog never shows up again, even after resetting the script. (This is not the case in the Singularity Viewer. In Singularity, re-clicking the object makes the dialog menu appear again.) I've looked through all settings but could not change this. Do you have any idea how to do this? Thank you very much in advance.
  4. Hi again! Sorry about the late reply, but I've only found time today to check again. It looks as though the Youtube settings combined with the prim texture media settings are sufficient. Here are some ideas I've got from somebody on OSGrid (djphil): In addition, I changed some of the settings in the "texture" tab of the prim (Singularity Viewer): Edit - select face - texture - Media - Choose - Customize - *uncheck* show control bar - Security - *check* Only allow Access to specified URL patterns - Add - *paste URL from 'General' tab* - OK This seems to work. No other links have been accessible so far and no scripts were necessary. If you have more ideas or still see some problems, feel free to comment. Thank you very much for your help, once again!
  5. In order to clear the screen after finishing the video, I tried LlClearLinkMedia, but after that the video could not be started again. Hence, the only work-around I could come up with is to auto-delete the entire Prim after some time and have it rezzed again through clicking a button. After rezzing, there is going to be a transparent screen in front of it to block users from clicking links on the webpage. I'm really not satisfied with this, so if anyone has a more elegant solution, please let me know. Thanks!
  6. Thank you for your quick reply. This is a good idea, however, the main problem is the links to the other videos on the web page, which can simply be clicked on, changing the video. Thank you for your idea, anyway.
  7. Hi! I would like to build a prim presenting a streaming Youtube video. This, as such, is easy. However, I would like to arrange the video in such a way that, once the video has started, the person watching it cannot click on the other video links in the browser, i.e. he/she only has the option to watch this one video, or no video at all. I've tried several methods, but they all have the same problem, which lies in the fact that the video must be started by clicking on the screen once, or otherwise you cannot watch at all. If you allow that, you automatically allow clicking on other videos, too. I cannot seem to find a work-around solution. The only hack solultion I could come up with is to rez an alpha screen-sized object in front of the screen after a few seconds, stopping the person watching from clicking the screen, but this is quite clumsy. Do you have any idea how this could be done? Here's the script I've tried, it works in general, but, with the problem described above: default { touch_start(integer num) { llSetLinkMedia( 0, 1, [PRIM_MEDIA_CURRENT_URL,"www.youtube.com/watch?v=...", PRIM_MEDIA_AUTO_PLAY,TRUE]); } } Thank you very much in advance.
  8. Thank you so much for your quick reply and explanations. I'll try that out. Thanks a lot, again.­čśŐ
  9. Thank you very much! Here's what I ended up with: integer length; list visitors =[]; default { state_entry() { llListen(0, "", NULL_KEY, ""); // listen for dialog answers (from multiple users) } listen(integer channel, string name, key id, string message) { if (message == "correct answer") { visitors=visitors+name; length = llGetListLength(visitors); integer i; for (i=0;i<length;++i) llSetText(llDumpList2String(visitors,","), <0,1,0>, 1); } } } There are two things I couldn't figure out: - The list above somehow double-records itself before you get the output, which means you do not only get the updated list, but the old list in addition. - llList2String didn't seem to work. Is it necessary to use llDumpList2String? Why can you not just use llList2String? Do you have an idea why this is the case? Thank you.
  10. Hi again! I have made a quiz. After solving the quiz, the players' names are supposed to be displayed in a floating text above the quiz prim. I can already display the name of one successful player (see script excerpt below). What I would like to do, though, is to display the names of more than one succesful player (let's say the last 5 succesful players' names). There is certainly a way to do this, but I just cannot figure it out. Any help will be appreciated. Thank you very much in advance. the script excerpt mentioned above: llListen(CHANNEL, "", NULL_KEY, ""); // listen for dialog answers (from multiple users) } listen(integer channel, string name, key id, string message) { if (message == correct_answer) { llSetText(name+" has solved the quiz!",<1.0, 1.0, 1.0>,1.0); }
  11. Hi again. I implemented Molly's and Roligloon's ideas. I also added more questions. This time it's a vocabulary quiz German - English and so it's partly German. I'm posting it below. Ideas of improvement, as always, are welcome. Thanks again. //by Mollymews, 10/16/2019 integer gameover; key player; integer counter; list quiz = [ // question answer picks (buttons) the pipe | is the delimiter "\n\nWas hei├čt auf Englisch \n\n\n'weil'", "because", "now|also|but|because", "\n\nWas hei├čt auf Englisch \n\n\n'obwohl'", "although", "although|now|but|because", "\n\nWas hei├čt auf Englisch \n\n\n'auch'", "also", "although|also|but|because", "\n\nWas hei├čt auf Englisch \n\n\n'aber'", "but", "although|now|but|because", "\n\nWas hei├čt auf Englisch \n\n\n'jetzt'", "now", "although|also|now|because", "\n\nWas hei├čt auf Englisch \n\n\n'heute'", "today", "yesterday|tomorrow|now|today", "\n\nWas hei├čt auf Englisch \n\n\n'morgen'", "tomorrow", "yesterday|tomorrow|now|today", "\n\nWas hei├čt auf Englisch \n\n\n'gestern'", "yesterday", "yesterday|tomorrow|now|today", "\n\nWas hei├čt auf Englisch \n\n\n'immer'", "always", "always|also|although|again", "\n\nWas hei├čt auf Englisch \n\n\n'wieder'", "again", "always|also|although|again" ]; integer CHANNEL = -202; integer index; integer count; string answer; default { state_entry() { count = llGetListLength(quiz) / 3; llListen(CHANNEL, "", NULL_KEY, ""); // listen for dialog answers (from multiple users) } touch_start(integer num) { key player = llDetectedKey(0); if (gameover) { gameover = FALSE; } if (llDetectedKey(0) == player) // ignore touches from people not the player { index = (index + 1 + (integer)llFrand(count)) % count * 3; // get the question string question = llList2String(quiz, index); answer = llList2String(quiz, index + 1); string picks = llList2String(quiz, index + 2); list buttons = llParseString2List(picks, ["|"], []); llSetTimerEvent(60.0); llDialog(llDetectedKey(0), question, buttons, CHANNEL); } } timer() { gameover = TRUE; llSay(0, "\n\nGame Over!\n\n\n"); llResetScript(); } listen(integer channel, string name, key id, string message) { if (message == answer) { llSay(0, "\n\nThat's correct, "+name+".\n\n\n"); index = (index + 1 + (integer)llFrand(count)) % count * 3; string question = llList2String(quiz, index); answer = llList2String(quiz, index + 1); string picks = llList2String(quiz, index + 2); list buttons = llParseString2List(picks, ["|"], []); counter ++; if(counter < 10) { llDialog(id, question, buttons, CHANNEL); } if(counter == 10) { gameover = TRUE; llDialog( id, "\n\nCongratulations! You win!", ["OK"], CHANNEL); //llDialog( id, "Congratulations! You won!\n\n\nUm das Men├╝ zu schlie├čen, klicke auf den Feldern auf 'ignore' ", buttons, CHANNEL); llPlaySound("ed124764-705d-d497-167a-182cd9fa2e6c ",1.0); llSay(0, "\n\nYou have won the quiz, " +name+ ".\n\n\n"); llSetText(name+" has solved the quiz!",<1.0, 1.0, 1.0>,1.0); llSleep(4.0); llSay(0, "\n\nDies ist deine Medaille, " +name+ ".\n\n Klicke auf 'behalten'\n\n\n"); llRezAtRoot(llGetInventoryName(INVENTORY_OBJECT, 1), llGetPos() + <1.0,3.0,1.0>,ZERO_VECTOR,llEuler2Rot(<0,90,0> * DEG_TO_RAD)*llGetRot(),0); llSleep(2.0); llGiveInventory(id,llGetInventoryName(INVENTORY_OBJECT, 0)); llSleep(4.0); llSay(0, "\n\nHier ist der Basketball, " +name+ ".\n\n Klicke im Men├╝ auf 'ja'\n\n\n"); llRezAtRoot(llGetInventoryName(INVENTORY_OBJECT, 0), llGetPos() + <1.0,3.0,-1.0>,ZERO_VECTOR,llEuler2Rot(<0,0,0> * DEG_TO_RAD)*llGetRot(),0); llResetScript(); } } else { llSay(0, "\n\nYou lose, "+name+".\n\nStart again.\n\n\n"); llResetScript(); } } }
  12. Thanks for your reply! It solves the problem with the missing first question. Thanks again! ... and the repeated 2 questions in a row seem to be solved, too.
  13. Thanks for your suggestion. It enables the first question to be asked. However, it also seems to enable the repetition of a question twice in a row, in my tests. Thanks for the idea, anyway.
  14. Hi again! I made some additions to the script above, and partly ran into some new smaller problems: - I added a counter for the correct answers. Thus, the player is supposed to have won the complete quiz after 3 correct answers. It seems to work. (The dialog still has to be closed down by hand, now, through the "ignore" button. Any ideas of how to close down the dialog automatically will be appreciated.) - I also made the dialog repeat itself automatically after each correct reply. (This is a work-around, I guess, so I'm open for suggestions of improvement.) - Now the biggest problem: There was one little problem in the original script above, which is, the section preventing the repetition of the same question index = (index + 1 + (integer)llFrand(count - 1)) % count * 3; seems to prevent the first question in the list from being asked (at least, the first question was never asked, when I tested it). So I ended up changing it into index = (index + 1 + (integer)llFrand(count)) % count * 3; Now, all 3 questions are asked. Unfortunately, this seems to enable the repetition of the same question again. If you have ideas of how to change that, I will be very grateful for suggestions. Thank you very much in advance! Here is the script containing the counter: //by Mollymews, 10/16/2019 integer counter; list quiz = [ // question answer picks (buttons) the pipe | is the delimiter "What fraction equals 1/2?", "3/6", "1/6|2/6|3/6|4/6|5/6|6/6", "What fraction equals 3/5?", "9/15", "3/15|6/15|9/15|12/15|15/15", "What is 6 times 7?", "42", "36|42|67|76" ]; integer CHANNEL = -16; integer index; integer count; string answer; default { state_entry() { count = llGetListLength(quiz) / 3; llListen(CHANNEL, "", NULL_KEY, ""); // listen for dialog answers (from multiple users) } touch_start(integer num) { // get a question not the same as the last question // this method is one way. Other methods of 'random' can be used also // index must be a value in range [0 < count] // 3 is the width of the stride. 0 * 3 = 0. 1 * 3 = 3. 2 * 3 = 6. etc index = (index + 1 + (integer)llFrand(count)) % count * 3; // get the question string question = llList2String(quiz, index); // get the answer // 1 is the offest to the answer element. 0 + 1 = 1. 3 + 1 = 4. 6 + 1 = 7. etc answer = llList2String(quiz, index + 1); // get the picks (buttons) // 2 is the offset to the picks element. 0 + 2 = 2. 3 + 2 = 5. 6 + 2 = 8. etc string picks = llList2String(quiz, index + 2); // parse the picks to a list on the pipe | delimiter // prepend a Dunno button list buttons = ["Dunno"] + llParseString2List(picks, ["|"], []); // display dialog llDialog(llDetectedKey(0), question, buttons, CHANNEL); } listen(integer channel, string name, key id, string message) { if (message == answer) { llSay(0, "you the winner!"); // get a question not the same as the last question // this method is one way. Other methods of 'random' can be used also // index must be a value in range [0 < count] // 3 is the width of the stride. 0 * 3 = 0. 1 * 3 = 3. 2 * 3 = 6. etc index = (index + 1 + (integer)llFrand(count)) % count * 3; // get the question string question = llList2String(quiz, index); // get the answer // 1 is the offest to the answer element. 0 + 1 = 1. 3 + 1 = 4. 6 + 1 = 7. etc answer = llList2String(quiz, index + 1); // get the picks (buttons) // 2 is the offset to the picks element. 0 + 2 = 2. 3 + 2 = 5. 6 + 2 = 8. etc string picks = llList2String(quiz, index + 2); // parse the picks to a list on the pipe | delimiter // prepend a Dunno button list buttons = ["Dunno"] + llParseString2List(picks, ["|"], []); // display dialog llDialog(id, question, buttons, CHANNEL); counter ++; if(counter == 3) { llPlaySound("ed124764-705d-d497-167a-182cd9fa2e6c ",1.0); llSay(0, "You have won the quiz, " +name+ "."); llGiveInventory(id,llGetInventoryName(INVENTORY_OBJECT, 0)); llSetText(name+" has solved the quiz!",<1.0, 1.0, 1.0>,1.0); llResetScript(); } } else if (message == "Dunno") { llSay(0, "you egg !"); } else { llSay(0, "totes wrong !!!"); } } }
  15. Thank you so much for your help! This script is amazing. I've already learnt a lot just from going through the explanations. I seem to have gotten it to work. I'm posting it below the way I ended up doing it. Should there be some misunderstandings on my part, or should you find other possible improvements, feel free to comment more. I might come back here in case I have some more detailed questions. Thank you very much, again!­čśŐ­čĹŹ //by Mollymews, 10/16/2019 list quiz = [ // question answer picks (buttons) the pipe | is the delimiter "What fraction equals 1/2?", "3/6", "1/6|2/6|3/6|4/6|5/6|6/6", "What fraction equals 3/5?", "9/15", "3/15|6/15|9/15|12/15|15/15", "What is 6 times 7?", "42", "36|42|67|76" ]; integer CHANNEL = -16; integer index; integer count; string answer; default { state_entry() { count = llGetListLength(quiz) / 3; llListen(CHANNEL, "", NULL_KEY, ""); // listen for dialog answers (from multiple users) } touch_start(integer num) { // get a question not the same as the last question // this method is one way. Other methods of 'random' can be used also // index must be a value in range [0 < count] // 3 is the width of the stride. 0 * 3 = 0. 1 * 3 = 3. 2 * 3 = 6. etc index = (index + 1 + (integer)llFrand(count)) % count * 3; // get the question string question = llList2String(quiz, index); // get the answer // 1 is the offest to the answer element. 0 + 1 = 1. 3 + 1 = 4. 6 + 1 = 7. etc answer = llList2String(quiz, index + 1); // get the picks (buttons) // 2 is the offset to the picks element. 0 + 2 = 2. 3 + 2 = 5. 6 + 2 = 8. etc string picks = llList2String(quiz, index + 2); // parse the picks to a list on the pipe | delimiter // prepend a Dunno button list buttons = ["Dunno"] + llParseString2List(picks, ["|"], []); // display dialog llDialog(llDetectedKey(0), question, buttons, CHANNEL); } listen(integer channel, string name, key id, string message) { if (message == answer) { llSay(0, "you the winner!"); } else if (message == "Dunno") { llSay(0, "you egg !"); } else { llSay(0, "totes wrong !!!"); } } }
×
×
  • Create New...