Jump to content

Bugs Larnia

Resident
  • Content Count

    51
  • Joined

  • Last visited

Community Reputation

36 Excellent

About Bugs Larnia

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. 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 } } }
  2. 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.
  3. 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.
  4. 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.
  5. Thanks! I thought about using phantom and volume detection, but it wasn't really necessary for this setup.
  6. 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.
  7. 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 {
  8. 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.
  9. 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
  10. 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?
  11. 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.
  12. 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) {
  13. 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.
  14. 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(); }
  15. 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.
×
×
  • Create New...