Jump to content

Bugs Larnia

Resident
  • Content Count

    52
  • Joined

  • Last visited

Everything posted by Bugs Larnia

  1. You? Mistakes? In scripts?!? Is nothing sacred???!??? 😲🙃
  2. Instead of llVecMag, you can also use llVecDist, like below (http://wiki.secondlife.com/wiki/LlVecDist). Do note that the distance from the prim is measured from the prim's center, so if your prim is large, then you will need to account for that. integer IsWithinRange(float pfMaxRange, vector pvAvatarPos) { return (llVecDist(llGetPos(), pvAvatarPos) <= pfMaxRange); } default { touch_start(integer total_number) { if (IsWithinRange(2.0, llDetectedPos(0))) { //Do stuff } else { //Do other stuff } } }
  3. Hi Yich! If it's about vista's, you can try to force mouselook on sit (http://wiki.secondlife.com/wiki/LlForceMouselook) or use the solution Quistessa stated above.
  4. In addition to either using textures in the prim's inventory or reading from a notecard, you can also create a list with texture keys directly in the script; this is faster than reading from a notecard, which can indeed be somewhat slow, as @Quistessarightly noted. However, this is only recommended if the textures are a fixed set, since you'd need to edit the script each time you'd want to add, remove, or otherwise change a texture.
  5. Well, you can use both, but it's not strictly necessary. I was more referring to the status of the prim, which is influenced by the settings of llVolumeDetect, but your point is well taken.
  6. Thanks! I thought about using phantom and volume detection, but it wasn't really necessary for this setup.
  7. I use it as well. Very handy. You do need to keep in mind that when reading data from Google there can be a slight latency between the actual data update and the time it's visible in the data pull.
  8. I don't know why it works, but it works! I do often get a double triggering of collision_start, with the second one directly contradicting the first, but I can work around that with a list of recent collision keys. Thanks Wulfie! Sample code triggering the double collision follows here default { collision_start(integer piNum) { vector vAvatarDirection = llVecNorm(llDetectedPos(0) - llGetPos()) / llGetRot(); if (vAvatarDirection.y < 0) { llOwnerSay("Moving forward"); } else {
  9. True, it is. I suspect it's a function of prim rotation vs. avatar rotation, combined with avatar velocity. I am just uncertain how the three factors play with each other.
  10. Hi! I am decent at scripting, but have a blind spot the size of Jupiter when it comes to rotations. I have a scenario where I have a flat prim on the ground (basically an invisible doormat), where a collision triggers a bit of chat to the agent. No biggie. However, I need it to respond differently depending on whether an avatar is moving in line with or contrary to the prim's local "forward" axis (x-axis in my test prim). After some testing, I figured I could theoretically do this with the rotation difference between the prim and the avatar. Depending on the global quadrant the prim is f
  11. I'm not entirely certain about what you need with the inventory giver either, but I have a library giver (numbered buttons, legend in bluenote) here. Maybe that's a starting point?
  12. If you want a linked controller, you can use llSetLinkTexture to change the textures. Ideally, like Rollig said, you would want to create a list of texture UUIDs, so you don't have to store the actual textures in the prim inventory. You can then loop through the list on touch and use llSetLinkTexture to change the texture and face of your linked texture prim. I have something not unlike what you want. I put it on my pastebin. You might need to make some changes, but it's a good starting point.
  13. I think@Rolig Loon is correct and the lack of actual action is the issue. Perhaps something like this? integer giCount; integer giStartCount = 120; ResetTimer() { giCount = giStartCount; llSetTimerEvent(1.0); } default { state_entry() { ResetTimer(); } touch_start(integer piNum) { ResetTimer(); } on_rez(integer num) { llResetScript(); } timer() { llSetText("Countdown in: "+ (string)giCount + "s\n \n \n ", <1.0, 1.0, 1.0>, 1.0); --giCount; if (giCount == 0) {
  14. The only thing I can really think of is using llDetectedVel(0) in the collision event to get the colliding agent's velocity (vector) and then checking whether the X and/or Y are unequal to zero or higher than some arbitrary minimum value you set after lots of experimentation.
  15. llGetAgentInfo would be the way to go, but you'd need it on a timer. Below is a very rough idea, but check llGetAgentInfo for more details integer CheckAgentSitting() { integer iAgentSitting = llGetAgentInfo(llGetOwner()); return (iAgentSitting & AGENT_SITTING); } timer() { integer iAgentSitting = CheckAgentSitting(); }
  16. It might be related (and might not), but a few months ago, I had similar issues, but without scripts.... I'd resize a prim manually and it would just revert. This could happen several times and sometimes also happened when I moved a prim using Edit; I'm guessing there might have been an issue in the server processing the change. That might be what occurred here. The script, as Rolig said, looks ok.
  17. I think I recall a discussion about this a few years ago, but I don't think a solution was found. The aforementioned setting seems to be limited for viewing to LL. I checked the functions, the public profiles and the viewer URI and I haven't found a way, but I'd definitely support such a ticket if you submitted it.
  18. Would it not be much easier to periodically check whether the current date matches the one you need (which I think is what @DoteDote Edison is referring to). This is a script I made in 2015 for a quick and easy notecard-based rezday calendar.... it's a bit rough around the edges, but I was in a hurry and never got back to it. list lstRezdays; list lstCelebrants; list lstDayToCheck; list lstMonthDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; integer intLine; string strNote; string strText; PerformChecks() { strText = ""; string strDate = llGetDate(); integer
  19. Bots are the way to go if you want to keep the information inworld. If it's simply storage, you can also use Google Drive, though it takes some setting up. I made a notecard for this once (and yes, I see the irony of that in relation to this post) (Please note that IDs in this example have been randomly generated and are non-functional and Ema Nymton's name is fictional and any relation to a real Ema Nymton is unintentional yet epically cool ) Of course, this example was made for logging something like an avatar, but you can set up your own form as you see fit.
  20. If you really want to be fancy (not that scripters would *ever* do that 😁), you can also address people with their first names only: default { touch_start(integer start_param) { key avatar = llDetectedKey(0); string name = llDetectedName(0); string firstName = llList2String(llParseString2List(name, [" "], []), 0); llSay(0,"Hello, " + firstName + "! Your display name is " + llGetDisplayName(avatar) + " and your user name is " + name + "."); llSay(0, llGetDisplayName(avatar) + " touched the box."); llSay(0, firstName + " touched the box.");
  21. Another snippet (which may be a bit faster in big inventories) is to create the list as per @Tattooshop and @Innula Zenovka's suggestions, but instead of the check in the loop, add a deletion clause after. This prevents the check for the item to be excluded running for every item in prim inventory. With small prim inventories this makes no difference, but if your prim has a large inventory, this might impact performance. I often use this to exclude the giver script as below list glInventoryToGive; CreateInventoryList() { glInventoryToGive = []; integer iInvCount = llGetInvent
  22. Are you sure it's complaining about string length and not the number of buttons (which also has a max of 12)?
  23. There are two other options you could consider: 1. Creating two lists: one with full names (for giving) and one for the buttons (truncated) - e.g.: list glInventory; list glButtons; CreateLists() { glInventory = []; glButtons = []; integer i; integer iInventoryCount = llGetInventoryNumber(INVENTORY_ALL); if (iInventoryCount == 1) //Only this script present { return; } for (i = 0; i < iInventoryCount; ++i) { string sName = llGetInventoryName(INVENTORY_ALL, i); glInventory += sName; glButtons += llGetSubString(sName, 0, 11); }
  24. You basically can use the script above, but instead of the llSetTexture(message, side); you can use llRegionSayTo like @Innula Zenovka suggested, but instead of the name, you can use llGetInventoryKey to send the texture UUID directly to the eye prim. This way, you can keep the textures in the HUD and not move them to the eye prim. It would look something like this: llRegionSayTo(llGetOwner(), -12345, (string)llGetInventoryKey(message)); Where -12345 is the channel you use to communicate with the eyes and message the name of the texture as per your original script. This is presumin
  25. Hi @Brett Linden! Will this be soonish, or did you guys send them to Help Island Public as a hazing ritual? 😜
×
×
  • Create New...