Jump to content

Estelle Pienaar

Resident
  • Posts

    143
  • Joined

  • Last visited

Everything posted by Estelle Pienaar

  1. Sorry Rollig, I also thought that I wrote exactly the same thing as you and then I deleted it (because I didn't want to be accused of plagiaism). I shouldn't have done it. :matte-motes-confused:
  2. Oh and llGetAgentList is not a scanner, it's a slim way for getting agent data. A timer and llGetAgentList does not put any stress on your Sim.
  3. You can reduce the amount of communication between scripts if you first compare the list of present agents on the Sim with the previous list of agents. For example: If you check every 10 seconds, then check in the second step who has not been there before. It is unlikely that someone crashes and relogs in 10 seconds right? Then you only ping the HUDs of the people who are new on the sim. If they do not respond you attach a new one (EDIT: Better run a second check before attaching as sometimes communication between scripts fail when there is lag in the sim). As a result there should not be too much communication going back and forth unless you expect dozens of players entering and leaving your region every minute. For the rest of Rollig's advice, the storing of data in the database, I can tell you from experience that it creates no lag problems at all.
  4. Thank you very much, everyone, for your answers. It helps me to understand the process. Fortunately I enjoyed "numbering systems" at Maths and it is quite clear to me how it works. I have also used such bit masks in the past, for example when checking for permissions. However I have always been copy and pasting existing code examples, incorporating them in my code. For the payment info, I could not find any such example in the wiki or the forums. It should have been more obvious to me that I do the same thing as in the run_time_permissions event, only in the dataserver event. Now the way forward in my script is clear to me. However, I would still ask for some clarification on the principle. (1) I would have expected that the "data" I receive in the dataserver event would result in the bit mask that I can then work with. But the string (or integer?) only contains one digit, in my personal case the "3". What's even more confusing: In the data table for llRequestAgentData, "3" is the integer constant for DATA_BORN. If you look at my script snippet in my first post, you see that I have never asked for DATA_BORN. So what the heck does this "3" mean and in what relation is it to the bit mask? (EDIT: Or is it a hexadecimal translation of the bit mask. Madelaine seems to suggest it, but it's not clear to me.) (2) My understanding is now that the bit mask cannot be printed out by the script? I can only check with an if clause, which bit mask was returned, but it's not a data value that I can "play" with? (3) I do not understand why Rollig's if ( (integer)data & 2) ) is the same as Madelaine's if( (integer)data & PAYMENT_INFO_USED) . In the Wiki for PAYMENT_INFO_USED it is said that the integer constant for it is "0x2" and not "2". So I would have expected Rollig's version to be if ( (integer)data & 0x2) ). As I have written above, I would be able to get the script working, but I'd like to also understand what is actually happening under the hood. It's good to know which switch to press to put on the light. It's even better to know why the lamp is glowing...
  5. Hi Rhonda, thanks for your answer but I still do not get it. In which event am I looking for the mask? In the data event? The "string data" in the data event is not giving me a mask but a simple "3".
  6. I wanted make a script that checks on touch if an avatar has payment information on file or used. I have written this very simple snippet: key owner_payment_query; default { touch_start(integer total_number) { owner_payment_query = llRequestAgentData(llDetectedKey(0),DATA_PAYINFO); } dataserver(key queryid, string data) { if ( owner_payment_query == queryid ) llSay(0,data); } }The LSL Wiki for llRequestAgentData says that DATA_PAYINFO returns either 0x1 for PAYMENT_INFO_ON_FILE and 0x2 for PAYMENT_INFO_USED . When I look into my profile it says "Payment info used". So I would expect the dataserver event to return "0x2" or "2". But it returns a "3"?
  7. Ezmerg has been abducted from his Goblin village. He is now cooking candy all day. Can you find and help him? Come and play this new FREE point and click adventure at Escapades. Taxi to Escapades: http://maps.secondlife.com/secondlife/Escapades/150/174/24 
  8. I lof ur language, dude. Dudes just need ta gedda flooow. Would lov ta work with u, but I am busy with otha projects... Gud luck!
  9. Nice to meet you, Jean Horten, who doesn't use display names and irihāpeti. Unfortunately my script would however know you as irihapeti without the "ā" because it is a forbidden character for object names...
  10. It's a great idea, however I am so used to the SL experience to end up unsitting in the funniest ways, that it will be strange to suddenly behave. No more jumping on the pasta of my dining table? I guess I am growing up even in SL...
  11. Ok, maybe I am missing something here, but this can be easily done as follows: 1. Add an integer in you rezzer script that remembers if pool whater is rezzed (integer = 1) or not (integer = 0). 2. When rezzer gets touched do: if (poolWater == 0) then rez object; if (poolWater == 1) then speak on channel n; 3. Put a script in the object "Pool Water" that listens at channel n; 4. When "Pool Water" receives the message from the rezzer, derrez (llDie); EDIT: @ Jenny: this might look complicated to a beginner, but it is a great way to learn working with global variables and how to communicate between two scripts in two different objects. If you need more help to get this done, let us know.
  12. With all due respect, I don't make a mess of anything. I am making the assumption that triggering a timer event and a very short dataserver event every 60 seconds uses less scripting time than one sensor event every 60 seconds. This might be right or wrong. I am curious for the opinion of other scripters on the subject. From "Scripting your World" book: llSensorRepeat() is a very costly LSL activity, in terms of server effort, and also has problems if there's a lot of lag." To come back to the original discussion, one way to make the the timer event script more efficient could be to use an llGetAgentList call and only run the dataserver event when no "zero vector" is returned.
  13. Wait! Your sensor also triggers every 60 seconds, even if nobody is there. A sensor event might very well take more resources than a timer and a short dataserver event. I am not a specialist in the impact of different events on sim resources but lets say that I am sceptical. A sensor is one of the most resource heavy LSL function calls/events out there!
  14. Your question is a little bit awkward for an experienced scripter. I will try to explain this with a language as close to the everyday language as possible. If you don't understand it, then you should read a few beginners tutorials for LSL. You said that you know how to make a script "do" something on "touch". Then Revochen has showed you how to make a script "do" something on "sit". So, the script is already doing something. It says "avatar sits on object" to the owner of the object as soon as someone sits down. It says "avatar stands up" when someone stands up. Now it is up to you. If the script should do something else, then you have to replace the function calls "llOwnerSay" with the function calls you have in mind.
  15. Thanks, I changed the script accordingly. I wouldn't say that no system is perfect, but it is not possible to cater everyone's needs. I didn't know that it is possible to change the settings in the viewer so that the open chat will only show usernames. I have never met anyone who does that and it is a strange behaviour in my eyes. You would be ignoring how people arround you are approaching each other and want to be approached. I am frankly more worried about the 0,01% of people who chose a username display name containing a ? on purpose...
  16. There is so much potential with experience keys. It's so unfortunate that this feature didn't come 10 years earlier. It might have made such a difference to the development of SL. Well let's see how many more years this platform still got and let's uses these features as long as we can...
  17. I think there is hope. If the experience tools could force the avatar to sit on an object, it would not be the perfect solution but could make a lot of what your scripter wants possible. Examples from Loki Eliot who is pushing a lot for this feature: https://community.secondlife.com/t5/Experience-Tools-Forum/Pleaze-can-he-has-llSit/td-p/2803464 There is a feature request in the JIRA that needs some support: https://jira.secondlife.com/browse/BUG-7120 Inara Pey mentioned in a blog post that during atheSimulator user group meeting on Tuesday, August 11th, the Lab said that they are considering new functions for experience keys and llSit is mentioned. http://modemworld.me/2015/08/11/sl-project-updates-331-server-viewer-experiences/ So, if you guys like that idea, support the feature request Jira (link above) by following it and tell the Lindens about it. This is something with a realistic chance of being implemented and it would enable creators to do so much more with experience keys, for example moving/rotating/animating an avatar.
  18. Today I am sharing a script that I use for a game HUD. The HUD is imitating dialogs by speaking for the Player in open chat. So it needs to imitate the player name. Most people have display names that are very different to their usernames. However usually scripts don't use display names for imitating a player name in chat, because some players use special characters like "π", "ß" or "à" in their display names. These letters cannot be used for object names and are replaced by question marks when being called by a script. My display name is "Stella π" and if I try to give an object my display name, it will show in chat as "Stella ??". This is a problem only for 5% to 10% of all users, but big enough so that no script that I know uses display names. They all refer to the username instead. However there are so many people that have chosen silly names when registering and their display names differ a lot. I would say that 5% to 10% of SL players have such silly user names. Also more than 50% of all users have display names that differ a lot from their original usernames. Why should all these people suffer for the few who can't chose display names with simple letters (like me)? It is a real immersion breaker if a spanish speaking avatar with the Display name "Mr. Tequilla" says something and then the script translator repeats his message with the username "X0ppTrom Resident". Isn't there a better solution? Here you get one. The object runs a test if the object contains question marks after the renaiming from display name. If there is no question mark, the display name is used. So from now on 90% of all people will get their display name in chat. In case that the display name contains however special characters then the script will chose the username instead. I think that this script snippet could help a lot to improve immersion when objects immitate an avatar name in chat that is actually displayed to everyone. Below you will find a proof of conecpt. Put it in a prim and touch it. EDIT: Replaced a function with llSubStringIndex and changed the chat message, so that it becomes more obvious, what the script is doing. string chatName; string oldName; integer found; default { state_entry() { oldName = llGetObjectName(); //let's save the original object name of the object containing the prim llSetText("I am an identity thief. \n Click me to lend me your name.", <1.0, 1.0, 1.0>, 1.0); } touch_start(integer total_number) { //Let's get a fake chat name from the display or username////////////////////////////////////////////////////////// //Set the object name to the display name string displayName = llGetDisplayName(llDetectedKey(0)); llSetObjectName(displayName); //Now we will run a test if the display name contains any special letters, that are not accepted as an object name. //Such letters are replaced with a "?" in the object name////////////////////////////////////////////////////////// string newobjectName = llGetObjectName(); found = llSubStringIndex(newobjectName, "?"); if (found == -1) //In this case no "?" has been found in the object name. This means that we can use the display name. { chatName = llGetDisplayName(llDetectedKey(0)); llSetObjectName(chatName); llSetText("My name is now " + chatName +".", <1.0, 1.0, 1.0>, 1.0); llSay(0, "I have stolen the identity of " + chatName + ". I used your display name as it does not contain incompatible letters."); } else //In this case there has been an "?" in the object name. This means that we need to chose the username. { key id = llDetectedKey(0); chatName = llKey2Name(id); llSetObjectName(chatName); llSetText("My name is now " + chatName +".", <1.0, 1.0, 1.0>, 1.0); llSay(0, "I have stolen the identity of " + chatName + ". I used your username as your display name contains incompatible letters."); } //llSay(0,chatName); llSleep(3.5); llSay(0, "I am going back to sleep"); llSleep(1.5); llSay(0, "*SNORE*"); llSetObjectName(oldName); llSetText("I am an identity thief. \n Click me to lend me your name.", <1.0, 1.0, 1.0>, 1.0); } }
  19. It is not so obvious how to find this place. An SURL would have been good. Here it is, so that other people don't need to search for it like I did: http://maps.secondlife.com/secondlife/Holiday%20Village/41/140/22
  20. I created https://jira.secondlife.com/browse/BUG-9939? hoping that it sparks some interest.
  21. I have developed a HUD based adventure game system that can be fairly easy used by anyone for their own point and click games like hunts. It is still in development, so it is not publicly available and due to RL problems, I had to stop development for the last months. But it is basically ready and if you want to give it a try, I could explain you everything. Developing your own HUD will take a lot of work. But if you want to invest that time, I can explain you the basics as well. Contact me in-world.
  22. It is not really easy for a beginner to do this operation. You will need to break up the script you have in two scripts. The menu with the texture choices on touch will go into the HUD prim (the SENDER). And the listener who "hears" the menu choice will have to go into the attachment (the RECEIVER). Then additionally to breaking it up succesfully, you will have to add/change some code as Xija pointed out. These are not operations that a beginner will succefully do without investing a lot of time and patience. There are some existing threads that might help (a bit) further: https://community.secondlife.com/t5/LSL-Scripting/Texture-changer-via-HUD-for-worn-object/td-p/1752027 https://community.secondlife.com/t5/Mesh/mesh-color-texture-changer-script-hud/td-p/2007871 With a simple Google search I have seen that a prefabricated script is available on the marketplace: https://kimmscripts.wordpress.com/2011/11/09/hud-texture-changer/ Or have a look at this tutorial that presents a pretty simple solution, but you should add some security to the scripts presented there or advanced scripters can easily make the textures of your customers change (I could). That is not what you want, is it? (I will watching out for eyes from Fleischgeiger... no just joking). http://oddy.nl/?p=824 Good luck!
  23. Thanks a lot for your reply. I was able to solve it with trial and error. Things get a bit nasty when the root doesn't have zero rotation and also the child prim has already rotated axis. I had to - amongst other stuff - to compensate for the root prim rotation of the X-axis with a -90 degrees rotation of the child at the first instance.
  24. Hi everyone, I want to use the following build for an upcoming game: a safe that opens if the player gives the correct input to a "simon game". I have bought a full perm safe including a script which is in the door child prim. integer opened = FALSE; default { touch_start(integer total_number) { if (opened == TRUE) { llTriggerSound("XXXXXX-1c68-79dd-8692-cd8f450a7213",1); llSetLinkPrimitiveParams(llGetLinkNumber(),[ PRIM_POS_LOCAL,llGetLocalPos() - <0.415,0,0.415>, PRIM_ROT_LOCAL,llGetLocalRot() / <0,1,0,1>]); opened = FALSE; } else if (opened == FALSE) { llTriggerSound("XXXXXXX-4fbf-a0a5-c975-01664fed13ea",1); llSetLinkPrimitiveParams(llGetLinkNumber(),[ PRIM_POS_LOCAL,llGetLocalPos() + <0.415,0,0.415>, PRIM_ROT_LOCAL,llGetLocalRot() * <0,1,0,1>]); opened = TRUE; } } } Then I have bought a full perm simon game and I have linked it to the safe (both door and simon game are now child prims, the script is in the door child prim). I have altered the safe door script like this: vector relativePosOffset = <-0.4657, 0.3693, 0.0>; // vector relativePosOffset2 = <0.4657, -0.3693, 0.0>; // integer simonLink; integer opened = FALSE; default { state_entry() { //Start variables for Linked Prims//////////// integer p; for (p=1;p<=llGetNumberOfPrims();p++) { if (llGetLinkName(p) == "Simon") { llOwnerSay("Found Simon"); simonLink = p; } } } //llOwnerSay("Debugging: " + (string)Gwwg); //End variables for linked prims////////////// touch_start(integer total_number) { if (opened == TRUE) { llTriggerSound("XXXXXXXX-1c68-79dd-8692-cd8f450a7213",1); llSetLinkPrimitiveParams(llGetLinkNumber(),[ PRIM_POS_LOCAL,llGetLocalPos() - <0.415,0,0.415>, PRIM_ROT_LOCAL,llGetLocalRot() / <0,1,0,1>]); opened = FALSE; llSetLinkPrimitiveParams(simonLink,[PRIM_POS_LOCAL,relativePosOffset,PRIM_ROT_LOCAL,llEuler2Rot(<0.0, 0.0, 90.0> * DEG_TO_RAD)]); } else if (opened == FALSE) { llTriggerSound("XXXXXXXX-4fbf-a0a5-c975-01664fed13ea",1); llSetLinkPrimitiveParams(llGetLinkNumber(),[ PRIM_POS_LOCAL,llGetLocalPos() + <0.415,0,0.415>, PRIM_ROT_LOCAL,llGetLocalRot() * <0,1,0,1>]); opened = TRUE; llSetLinkPrimitiveParams(simonLink,[PRIM_POS_LOCAL,relativePosOffset2, PRIM_ROT_LOCAL,llEuler2Rot(<.0, .0, 270.0> * DEG_TO_RAD)]); } } } In default position (the safe door is closed, I find the following rotation values in the "object" pannel of the "build" floater: - root prim: X:90, Y: 0, Z:0 - door child prim: X:90, Y: 0, Z:0 - Simon game child prim: X:0, Y:0, Z: 180 The expected behaviour would have been that the "simon game" prim is rotated 90 degrees counter-clockwise on the z-axis, when I click on the door and open it. BUT additionally to that it also gets rotated by 90 degrees on the X-axis (why is that?). After opening the door I have the following values: - root prim: X:90, Y: 0, Z:0 - door child prim: X:0, Y: 90, Z:90 - Simon game child prim: X:90, Y:0, Z: 270 And after closing the door by clicking the door prim again, it doesn't rotate back to the default rotation, but by only 180 degrees on the Z-axis, that's now really confusing me: - root prim: X:90, Y: 0, Z:0 - door child prim: X:90, Y: 0, Z:0 - Simon game child prim: X:90, Y:0, Z: 90 HELP?
×
×
  • Create New...