Jump to content

Estelle Pienaar

Resident
  • Posts

    143
  • Joined

  • Last visited

Everything posted by Estelle Pienaar

  1. I haven't been scripting in a long while, but got interested in making a mele combat system, in which a magic wand would "shoot" lightning bolts (as particles) against little monster NPCs (non player character). I am currently in the concept phase and would like to ask a few questions / rant about the unpractical implementation of LSL... So, in an ideal world, I could start a sensor from the prim attached to the wand that goes downward in a PI / 4 arc, scanning if the NPC is in range when it is fired. But sensor events are always along the x axis, or when attached to an avatar llSensor will use the direction the avatar is facing as their forward vector. In general it appears as a very unpractical solution to me, to always do the sensor along the x-axis of an object. When attached as here, a forward arch will miss NPC monsters that are too far below and near the agent. I will have the same problem when doing the NPC monsters. Also for them it makes no sense to scan an 1/4 Pi arc, if they can only do it around the static x axis. They will always have to do a full 1 Pi arc scan. Clumsy workarounds I see: (1) For the agent and their wand, I could make the player attach another attachment at their feet with a sensor. This sensor would detect the NPC objects correctly, but the player needs to attach another object and if they forget it, the game won't work. (2) Have a full Pi arch sensor scanning everything above and behind the avatar and then calculate the area that actually counts after that. So I would first calculate, if the detected NPC object faced by the avatar: Then I would calculate if the NPC object is close enough to the avatar: And finally I would calculate if the NPC object is really under the wand by calculating the z-position via llGetAgentSize and some math. That's a lot of clunky operations , just because the sensor can't be directed freely. Not very efficient. Even if I would apply the clunky solution (1) with an extra attached prim for the sensor, I would need to do solution (2) to determine the agent position for attacks of the NPC. There are better solutions, even in SL: For example particles are always shot by the face that was upwards when the prim was rezzed. And it will traveling in the direction that this face is facing. Why isn't it possible to implement llSensor in this way? It would make much more sense and make the script much more efficiant! Or am I missing a better solution?
  2. I think you are massively underestimating this AI. Yes, it is certainly based on statistical predicting, but saying that what it does is statistical predicting is like saying what a computer does is breaking everything down in 1 and 0. While a computer does break down everything into one and zero, there are so many layers of logical filters built on the basis of this process that a PC does do a lot of things that are far from "just 1 and 0". The AI is learning based on statistical evidence and human correction. But unlike you folks are saying, it is able to simulate a higher logic that it finds in language. And the simulation of the logic is getting better by the day and in some specific areas, the difference between the "real" logic and the "simulated" logic is already closing in on zero. Worse for humans: The AI is able to think creatively to close the gaps. It's like an autodidact who doesn't need a teacher to explain everything from the detail to the system as a whole. It can take puzzle pieces and tries to guess the logic behind it. Unfortunately past results are not accessible in ChatGPT at the moment, so I cannot post the examples right now, but ChatGPT made up function calls that don't exist in LSL. It has not found these functions anywhere and certainly not in a statistically significant number. The same is true for the example above on LLSetText, when it claimed that the second argument is an integer for the distance of the text from the object. Do you seriously believe that the AI found this information significantly more often in the internet as the correct information? If you deal with it for some time it becomes obvious that (1) the AI is working within a logic and (2) can and does creatively play wwiththe information it has. I am 100% convinced that the AI in the example LLSetText above knows that the second argument is for the alpha. There must be hundreds of websites that it was fed and these webpages do all say that the argument is for alpha. Just based on statistical results this is clear. What seems to be happening is that the AI "plays" with available information and the current state of its own logic like a child. It does take an information bit and tests what happens if it claims something completely different. How will the users react? Will they believe it, will they realise the mistake, will they correct it? And based on a statistical function applied to the reactions, the AI will refine the simulated logic until the difference between simulated logic and real logic converge close to zero. If you are laughing about the results you currently get when asking the AI about LSL, you might missundertand what is really happening. PS: The video on the mirror example is misleading because this is not ChatGPT, but other "closed" language models. In Chat GPT the wrong answers don't have to be "quickly patched" because the user can react to a wrong answer and correct it. If I would have received such an answer, I would have replied that it needs to differentiate between factuality and the believes of people. And the next time someone asks the same question, it will add that "many people believe" etc. It is learning very fast.
  3. I have made some experiments with ChatGPT and PHP and the results were fantastic. No comparison to LSL. It is quite obvious that it hasn't been sufficiently trained on LSL. It gets very creative sometimes, inventing functions that don't exist. Or it ignores basic rules like making a listen handle to avoid having a script listening all the time. However I have used ChatGPT for raw drafts of my last two scripts and despite the above mentioned problems it has saved me about 50% of my time that I would have usually needed to write the script. Even in the actual state it is a helpful tool if you can quickly identify the working parts of the code and have the patience for some debugging... But people without any scripting skills cannot use it at the moment.
  4. Hi everyone, I have just finished a neat click-and-run game that I want to share with you. It's called "the Crone" and you'll explore the dissapearance of several children and you'll get yourself in danger along the way. I really like the spookey theme for the Halloween season. http://maps.secondlife.com/secondlife/Escapades/87/191/28 Have fun!
  5. Thank you very much, for making this evident. It is rather poorly explained in the wiki. There are these integers in the example script, but not at all explained in a clear way. However when you said it, I understood it in an instant.
  6. I have a little script that should perform a function when the left mouse button is clicked. However, no matter how quickly I try to click the left mouse button, the control event is triggered at least 3 times per qulick. If I keep the left mouse button pressed down, I get an even greater amount of triggered events. How can I change my code, so that the control event will only be triggered once per mouse click? key ownerK; default { state_entry() { ownerK = llGetOwner(); } attach(key id) { if (id) { if (id != ownerK) llResetScript(); else llRequestPermissions(id, PERMISSION_TAKE_CONTROLS); } else llReleaseControls( ); } run_time_permissions(integer perm) { if(PERMISSION_TAKE_CONTROLS & perm) { llTakeControls(CONTROL_LBUTTON, TRUE, TRUE); } } control (key id, integer level, integer edge) { Detected = []; llOwnerSay("Debugging: I have been clicked"); } }
  7. I would definately support a feature request. However it would probably be more usefull if LL would fix pathfinder. Then the "fix" to raycasting your NPCs way would probably not be (as) necessary.
  8. Thanks a lot, animats. The objects didn't have physics shapes. Riddle solved!
  9. Hi everyone, I am playing around with llCastRay. Trying to script a melee system with NPC oponents. That's why animesh objects would need to be detected. But llCastRay seems not to be able to detect animesh objects? The following script is in a weapon that the avatar is holding. The ray is cast from the avatar (to the direction the avatar is facing) four meters forward. It works for all objects. But it does not detect animesh objects. key ownerK; default { state_entry() { ownerK = llGetOwner(); llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS); } attach(key id) { if (id) { if (id != ownerK) llResetScript(); else llRequestPermissions(id, PERMISSION_TAKE_CONTROLS | PERMISSION_TRIGGER_ANIMATION); } else return; } run_time_permissions(integer perm) { if(PERMISSION_TAKE_CONTROLS & perm) { llTakeControls(CONTROL_LBUTTON | 0, TRUE, FALSE); } } control (key id, integer level, integer edge) { list rotL = llGetObjectDetails( ownerK, ([OBJECT_POS, OBJECT_ROT])); vector posV = llList2Vector(rotL,0); rotation rotV = llList2Rot(rotL,1); list results = llCastRay(posV, posV+<4.0,0.0,0.0>*rotV,[RC_DETECT_PHANTOM,TRUE,RC_DATA_FLAGS,RC_GET_ROOT_KEY,RC_MAX_HITS,1]); //I a have taken all possible filters out: RC_REJECT_TYPES,RC_REJECT_PHYSICAL|RC_REJECT_LAND|RC_REJECT_AGENTS key target = llList2Key(results,0); llRegionSayTo(ownerK,0,"HIT: " + (string)target + "."); } } Am I doing something wrong or did LL forget to make animesh detectable by llRayCast? (well, I hope it is me...) You should be able to copy the above script in any attachement and then do the test yourself.
  10. A question: Do you use llEscapeURL for all data which is sent to php? If you don't use it and the data contains a letter or an expression that is forbidden or reserved in PHP or SQL, then the script will fail and the data will not be added to the database.
  11. Originally there was no force sit function with experiences. It was only added several months later by the Lab. They probably just haven't updated the permissions dialogue...
  12. Yes, I think scripters tend to forget quite quickly how hard it is for absolute beginners (especially if they have no previous experience with other scripting languages) to find really exhaustive descriptions on how to tinker with the basic LSL functions. I have bought this as an e-book and it has helped me a lot: https://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837 Even if some info is outdated, it gives a quite exhaustive introduction and not just some snippets here and there that you need to puzzle together yourself. However if you have been able to make sense of the llSetPrimitiveParams all by yourself, then maybe you'll get there without the book...
  13. EDIT: Oops, I haven't seen that Quie answered in the meantime. Too late to delete... I think what Qie wanted to communicate to you is that any talented and ill-intending scripter can do almost all the same things to you via furniture or teleporters as he/she can with experiences. So it is not very reasonable to be afraid of experiences if you are not afraid of furniture... 😉
  14. I am happy for you that you could sort things out. I still would have some open questions. Yes, it is a good thing to check the http_response by the key that was created by the llHTTPRequest. And to communicate an additional sufficient complext identifier back and forth (it can be UUID as it will work for a first unique registration process - even if the UUID of the object will change whenit is taken into inventory and rezzed again). However does that really solve the fundamental problem in your LSL-PHP communication, or haven't you just not run into another case yet? Can you specify a bit more what is happening in the steps 1-3? You are using method POST via an llHTTPRequest in order to send the SL data to a PHP script. The script then does (1) enter the data into the database and (2) SELECT the created data entries and print/echo it in the html_body. The LSL script then receives that http_response and "saves" them to global integers. Is this correct? Only if my assumptions are correct, then this is my guess to what is happening: What seems to have created your problem is that two llHTTPRequests arriving at almost the same time receive the same html_body in their http_response event. I can think of two reasons for that: (1) Your PHP script is having a bug, for example: sometimes new data is not entered into the database but the last entry is selected and so it sends the previous information a second time. This is very likely the reason behind your problem (if my assumptions are correct). (2) There is a bug in the LSL-PHP pipeline so that a second call might get the response of the first call. That is rather unlikely. So if (1) is the reason for your problem then your "solution" will only result in a new problem: A new breedable sends it's information to the database, it does (for whatever scripting reason) not registerd in the database, the php script sends the previous entry. The breedable script sees - because of UUID - that the information does not fit and discards it. Well, then this new breedable will again have a problem: no data. You need to find out why your PHP script sometimes does not save the new entry to the database. Maybe add a php confirmation to your PHP pipeline that an entry has been saved (which is checked by LSL script) and a notification if it has not been saved (and make your LSL script communicate this error).
  15. Ok, I clearly have to stop scripting for today. llClearLinkMedia is the call to reverse llSetLinkMedia... Doh!
  16. If I witch a prim face on a HUD to a media face via llSetPrimMediaParams, I can reverse the effect by calling llClearLinkMedia. But what do I need to do if I called the media face via llSetLinkMedia. Is there also a function to reverse this effect on linked prims?
  17. I was having the idea to use llSetCameraParams for a story HUD in order to get movie like shots when parts of the story are told. But as far as I can understand, the existing parameters for llSetCamerParams, only allow to create static camera positions and shots (as long as the avatar does not move) and I can't do dollie shots, zooming in and out of scenes?
  18. This is close to what you want: https://www.outworldz.com/cgi/freescripts.plx?ID=930
  19. This forum is for scripters that help each other when running into problems while scripting. If you are looking for a specific script, you can ask in the "wanted" forum. If you want to pay someone to write such a script for you, you can ask in the "Inworld Employment" forum. This is actually a very nice first project for starting scripting. If you want to use your idea to start scripting in LSL, I will give you a few hints. (1) in case that you have never learned a programming language before, read some (very) general introductions into programming, especially procedural languages. (2) look for one of the available tutorial on LSL, that resonates with you and learn the very basics. (3) Get the logics of your script right: I need a script (in an object worn by an avatar) that (a) tests if the avatar is typing and (b) then sends a message to the object which is a lantern when the avatar starts typing and sends another update when the avatar is not typing animore. You need a second script in the lantern that (c) receives the message and then (d) switches the lantern on/off accordingly. For the very first step on how to test if the avatar is typing, you can refer to the answer of Rollig in another forum thread: https://community.secondlife.com/forums/topic/383261-typing-animation-script/ . Only instead of playing an animation, you would then send the message to the other object. EDITED: And in order to understand and learn what all the events, functions and variables are actually doing, read the relevant information of the lsl wiki attentively. (If you want this in Spanish, use Deepl.com (my recommendation for best AI translation) or translate.google.com. Good luck.
  20. You cannot add a person to a group with LSL. So it is not possible to create such a script easily. You would have to combine LSL scripts with bots and servers in order to achieve such a task. It would be very complicated to create (therefore very expensive if you want to hire someone). It's certainly not worth the hassle to create a script-bot-server environment to achieve the effect that you are looking for. Better stay with paid groups in order to give gift access. If you have lots of money to spend and want to go for it, then post a request in the "Inworld Employment" forum.
  21. Ok, that seems to make sense for some cases. Now I wonder how relevant this is for me. Out of curiosity: what do you mean with "object". A prim or a linkset? It does not seem to make much sense if scripts in linked prims get active from a dataserver call in another prim, but from your statement I guess that it is the case? Anyway so far I have succesfully avoided having more than one script with a dataserver event handler or http_response event handler in a linkset as I prefer a very clear seperation of responsabilities between my scripts in objects or HUDs. It's probably my specific use case but in my HUDs the scripts (1) do read every now and then from notecards and not just one time and (2) manage several tasks in order to keep script count as low as possible. If I would create a state without a dataserver event handler, then I would therefore have to dublicate 500+ lines of code into the new state. Then the script needs much more memory (I am pretty sure that it would run out of memory too). And if I put the notecard reading in a seperate script, then there is one more script than necessary. All in all switching states seems to demand more resources than just leaving the existing (EDITED:) event handler idle until used again.
  22. Of course you can use states, but that doesn't mean that it is more conveniant. I haven't seen any convincing examples so far appart from touch_event on/off. However my statement will always stay an unfullfilled wish anyway. Because of legacy content... 😉 And at least I can chose to ignore states and maybe ignore them even more in the future thanks to your JIRA. EDIT: Do you (or anyone else) have a concrete example for this use case?
  23. I am late and maybe you found already a solution. I have seen just this weekend a really great boat ride and it was created with this coaster creator. You can make your own custom builds with it. https://marketplace.secondlife.com/p/Limited-time-Sale-Coaster-Creator-Log-Flume-Build-your-own/5779572
  24. One thing to consider is if the object should be clickable at all as long as someone else is playing. I prefer to have a floating text stating that the object is in use by another player and only make it clickable again after the turn of the previous player ended (one state with touch event and another state without the touch event). After all, if other people can click the object but nothing happens, then they might think that it is broken. Even if they get a message, they might be confused on when they should or should not click again.
×
×
  • Create New...