Jump to content

Darkie Minotaur

Resident
  • Posts

    1,663
  • Joined

  • Last visited

Everything posted by Darkie Minotaur

  1. You can use llRegionSay for the communication - to limit, what the HUD listens for, specify the server's name or even better the server's key (although this could change under certain ircumstances) in the call to llListen. I don't know if that answers your question - if not, be more specific. E.g.: you state that there could be serveral objects with the same name; do you want the HUD just react to one of them or to all of these objects with one name? If you just wat to look for one object, why not have the object in question say (with llRegionSay) it's position in regular intervals, so the HUD(s) don't need to scan all the time - and you don't need to pass a name to the HUD.
  2. This is one possibility. But you could just store the key in a global variable in the touch event.
  3. the http_response event isn't triggered by a SL object or agent - thus llDetectedKey() doesn't work with - this raises the error you get.
  4. In principle, Qie is right - there are at least two things tht you have to keep in mind: Lag can delay the timer If the code in your timer event takes longer to execute than your timer length, this will delay your timer
  5. Such UI commands are not possible through (LSL) scripts. It may be possible with a custom viewer.
  6. I don't know the animation and the context - but if it's a seat that you're dealing with, would it be possible to sit on the object rather that wearing it? In that case, it would be simple to adjust the position and rotation of the ava through llSitTarget. and run the animation on the Changed event.
  7. In that case, you simply assign the actual message to the variable that contains the name of the notecard: key kQuery;integer iLine;string notecard_name;default{ state_entry() { llListen(-25,"","",""); } listen(integer chan, string name, key id, string msg) { notecard_name = msg; if (llGetInventoryType(notecard_name) != -1) { kQuery = llGetNotecardLine(notecard_name,(iLine = 0)); } else { llSay(0, "Notecard with the name: '"+ notecard_name + "' could not be found."); } } dataserver(key query_id, string data) { if (query_id == kQuery) { // this is a line of our notecard if (data == EOF) { llSay(0, "End of information."); } else { llSay(0, data ); // increment line count ++iLine; //request next line of notecard. kQuery = llGetNotecardLine(notecard_name, iLine); } } }}
  8. I guess your problem stems from the script in object A - do you say the object's description there? You have simplified your concept in your last post - in the second one, the listening script has two options in respect to what object A says, so that you would have to do it a little differently from just saying the description, since you already say a command. There are again different ways to do that - here is one: Object A still says either KFPadd or KFPadd2. In object B, you can thus still differentiate betwenn the two commands - I assume, "data" should make the script read the nc. Now, you use llGetObjectDesc to get the description from object A so you have your nc name. If we include the check for the nc in the inventory of B, it could look something like this: key kQuery;integer iLine; string notecard_name;default{ state_entry() { llListen(-25,"","",""); } listen(integer chan, string name, key id, string msg) { if (msg == "KFPadd") { llSay(0, "notes"); } if (msg == "KFPadd2") { norecard_name = ""; notecard_name = llList2String(llGetObjectDetails(id,[OBJECT_DESC], 0); if (llGetInventoryType(notecard_name) != -1) { kQuery = llGetNotecardLine(msg,(iLine = 0)); } else { llSay(0, "Notecard with the name: '"+ notecard_name + "' could not be found."); } } } dataserver(key query_id, string data) { if (query_id == kQuery) { // this is a line of our notecard if (data == EOF) { llSay(0, "End of information."); } else { llSay(0, data ); // increment line count ++iLine; //request next line of notecard. kQuery = llGetNotecardLine(notecard_name, iLine); } } }}
  9. It's pretty easy to do - you can use llGiveInventoryList or llGiveInventory to give out the objects. In order to make sure, that it is the owner who has touched the object, use llDetectedKey anf compare the result with llGetOwner. To destroy the object after giving out its contents, use llDie
  10. In the touch event, you can't catch the responses. Give the attachments a little time to respond, collect them during that time, and at the end of the interval, say your keys. touch_start(integer total_number){ agents_with_hud = []; listener = llListen(-123456, "", "", ""); // listen here for hud response llRegionSay(-100000, "PING"); // ping huds for in this channel llSetTimerEvent(3.0);}listen(integer channel, string name, key id, string message){ agents_with_hud += (key) message; // list of UUIDs from hud response}timer() { llListenRemove(listener); llSetTimerEvent(0); llOwnerSay(llDumpList2String(agents_with_hud, "\n")); // display UUIDs of all the agents with attachment}
  11. You first ger the name of the toucher with llDetectedName and set the object's name to the result with llSetObjectName
  12. Obviously, you need a way to store the information somehow plus a way to retrieve this Information in your Script. I would either use a notecard or use soundnames like 14_1, 14_20... You could then parse the names and decide how to proceed
  13. Hello Athena You're right: There is no way to detect the gender of an avatar. This is an issue, that gets discussed here (and elsewhere) no ang again, usually ending up in a heated and highly emotional fight. Search this forum and the archive of this forum, and you will find pages full of arguments for and against gender detection. ETA: You cannot check the age of a person - you can check the age of an ava - you should make a clear distinction between ava and person - which is very important for gender as well.
  14. You have a timer there allright, but no timer event This should do the trick integer intChannel = -38654;integer intListen;list objects;string gsMessage;key gkReceiver;default{ state_entry() { integer num_drinks = llGetInventoryNumber(INVENTORY_OBJECT); integer i; for (i = 0; i < num_drinks; i++) { objects += [llGetInventoryName(INVENTORY_OBJECT, i)]; } } touch_start(integer num) { intListen = llListen(intChannel, "", llDetectedKey(0), ""); gkReceiver = llDetectedKey(0); llDialog(gkReceiver, "Pick Object:", objects, intChannel); } listen(integer channel, string name, key id, string message) { gsMessage = message; llSetTimerEvent(30); llInstantMessage(id, "here is your object"); llListenRemove(intListen); } timer() { llGiveInventory(gkReceiver, gsMessage); llSetTimerEvent(0); }}
  15. As for checking, the only way is to try to connect to the script from outside (either outworld or another script). The cliennt doing the test doesn't have to be external. LSL doesn't provide a function to check if the URL is still valid.
  16. Don't open a new discussion, when you still got one open with the same question - one you opened just yesterday. http://community.secondlife.com/t5/LSL-Scripting/Auto-Attach-HUD/td-p/1720443
  17. It's difficult to diagnose your problem wothout seeing the scripts - but to answer your question: A prom cannot listen to itself. So, if your listening script is in the button as well, use llMessageLinked You get it with llGetKey() - but that won't help you too much, since there are too many occations on which the key changes. But to get it running, keep it simple at first and work without UUIDs. When it runs, you may think of using llRegionSayTo - or some other way of limiting yur listeners scope.
  18. The other thread on the sound player may have led you the assumption, that this is a forum for asking for scripts - it's not. Is for discussing scriptimg issues and scripters helping scripters. You should post your request in Wanted ot in Inworld Employment.
  19. Here is one way to work with lists in your example list a = ["Monster","Prize"];list b = ["RAGGHH!", "YEHY HAZ PRIZE!"]; default{ collision_end(integer num_detected) { string name = llDetectedName(0); integer index; if ((index =llListFindList(a, [name])) != -1) { llSay(0, llList2String(b, index)); } }}
  20. This is the wrong forum for your request - move it to the Wanted forum - you even have that in your subject
  21. In that case, llRegionSayTo should be the easiest way - the attachments of the ava will hear things said to the ava as well
  22. If I understand you right, you want to delete an object if the subscription has been terminated. Now, to do so remotely, you would just have to send it some kind of remote signal. If the 'server' and the object to be deleted can be on different sims, you can use email or http - and then simply call llDie() - or ou could make the script delete itself .... In order to replace the script, the 'update server' and the object imn question would have to be in the same sim. llRemoteLoadScriptPin explains how it works.
  23. Just adding a little thing to what Qie said: you add message to totalpoints - that won't work, since totalpoints is an integer, message however is a string.
×
×
  • Create New...