-
Posts
1,663 -
Joined
-
Last visited
Content Type
Forums
Blogs
Knowledge Base
Everything posted by Darkie Minotaur
-
Where to start... Update a HUD settings from a "server"
Darkie Minotaur replied to Tighern McDonnell's topic in LSL Scripting
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. -
This is one possibility. But you could just store the key in a global variable in the touch event.
-
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.
-
Theory About Timer Function and Event
Darkie Minotaur replied to joniveehernandez's topic in LSL Scripting
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 -
Such UI commands are not possible through (LSL) scripts. It may be possible with a custom viewer.
-
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.
-
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); } } }}
-
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); } } }}
-
Give multiple instances of iventory object.
Darkie Minotaur replied to LindaMichelle Ling's topic in LSL Scripting
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 -
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}
-
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.
-
Can you give inventory with a timer?
Darkie Minotaur replied to Avery Eiren's topic in LSL Scripting
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); }} -
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.
-
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
-
Problem with Hud to Object communication
Darkie Minotaur replied to Arquillius's topic in LSL Scripting
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. -
Looking for a 'local chat message on collision' script
Darkie Minotaur replied to Carmsie Melodie's topic in LSL Scripting
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. -
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)); } }}
-
Attachment: What am I sitting on?
Darkie Minotaur replied to Moon Corrigible's topic in LSL Scripting
In that case, llRegionSayTo should be the easiest way - the attachments of the ava will hear things said to the ava as well -
use -1 as the end index, not -0
-
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.
-
Would love a little help with this script please
Darkie Minotaur replied to kawolf's topic in LSL Scripting
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.