Jump to content

Rolig Loon

  • Content Count

  • Joined

  • Last visited

Community Reputation

19,014 Excellent

About Rolig Loon

  • Rank
    Flagrantly Humble

Recent Profile Visitors

6,232 profile views
  1. You can certainly add a notecard reading function without much trouble but frankly that's overkill. It would be much simpler to just read the price from the object's description field. I would write a simple bit of code for you now but I am out of town and can't script on my cell phone. It's basically a one or two line change, though, so anyone else here can write it for you.
  2. I don't have time now to go back through notes that I took several years ago, but you can start down your own trail by looking at the discussion on llGetAgentSize in the LSL wiki at http://wiki.secondlife.com/wiki/Talk:LlGetAgentSize . IIRC, that's where I started when I was curious about the same thing. I just don't recall right now where the trail went from there.
  3. That's almost certainly true, since I am capturing vSpinAxis with touch_start and there is no other action in the script until you release the mouse button and trigger touch_end. Notice, by the way, that llTargetOmega isn't spinning 100% reliably around that axis. If you click the same face several times, you get slightly different results from llDetectedTouchNormal. The axis is wobbling, or precessing, or something. Still, the curious thing is that it's defined at all. As I said, there are times that it would be very handy to be able to click on an animated object like this and know where your viewer thinks it is and which way it's pointed -- as opposed to where the servers know that it is.
  4. Yeah, that's what it looks like to me too, but I didn't think that was possible. You have to feed llTargetOmega a real vector to rotate around, but I can't think of a reliable way --- or even an unreliable way -- to grab a vector from an object that you only know about client-side. It looks like that's just what this script does, though. This could be handy to know about in some applications.
  5. Dancing in a friend's island hideaway. The view from here, partway up the slope, is fantastic. I'm not a tropical person, but I could enjoy this for a while.
  6. One of my favorites is Norse Auk. 😊
  7. This would seem to have an obvious answer, and I thought I knew, but now I'm not sure. Here's a test script: vector vSpinAxis; float fHoldTime; default { touch_start(integer total_number) { vSpinAxis = llDetectedTouchNormal(0); // Vector perpendicular to touched face llSay(0, (string)vSpinAxis); float now = llGetTime(); if (now - fHoldTime < 0.3) // User has double-clicked the test object { llResetScript(); //Returns object to its initial orientation } else // User has single clicked the test object { llSetTimerEvent(0.32); } fHoldTime = now; } touch_end(integer num) { llTargetOmega(ZERO_VECTOR,0.0,0.0); // Stop spinning } timer() { llSetTimerEvent(0.0); if (llGetTime()-fHoldTime > 0.3) { llTargetOmega(vSpinAxis,0.5,0.1); // Start llTargetOmega } } } Drop it into a brand new cube prim and click/hold. As long as you keep holding, it will keep spinning around the vector that is perpendicular to the face you are touching. When you let go, it stops. Double click and the cube will pop back to its initial orientation. So, here's the thing..... llTargetOmega is supposed to be spinning the cube client side, so its real orientation doesn't change as far as the LL servers are concerned. That's why resetting the script pops it back to the original orientation. It never left there, really. So.... if that's the case, why does vSpinAxis change if you try spinning the cube around one axis after another? That is, If my cube is in its default orientation (face 1 pointed east, face 0 pointed up), then I would expect that when I click on face 0, it will always tell me that vSpinAxis is <0.0,0.0,1.0>. But if click on another face and then on face 0 again, it doesn't. llDetectedTouchNormal() seems to be returning the perpendicular to the face as we see it. Why? What am I missing?
  8. Whew. Saved by the belle.
  9. Awww... the gods (and goddesses) would be unpleased. Ondine (also spelled Undine) was a nymph, a mythological spirit of the waters. Now that LL has changed the name of her region, she's homeless. Who knows what curses she may cast on Bellisseria mariners now?
  10. That's not quite the right lesson to take away from this, but I am glad that you got the script to work. Now, let me show you an example of the sort of script that will do what you intended, even if it's not exactly what you had in mind ..... integer iChan; // This is a global variable to store the channel number in integer iLsn; // This is a global variable assigned to hold the listen handler's id default { state_entry() { iChan = 4; iLsn = llListen(iChan,"","",""); // Here's a listen handler, initially assigned to iChan = 4 } listen (integer channel, string name, key id, string message) { llSay(0, "This message was received on channel " + (string) iChan); iChan = (integer)llGetSubString(message,0,1); // Grab the first two characters of the message, convert them to an integer, and assign to iChan message = llDeleteSubString(message,0,1); llSay(0,message); // Say only the real text part of the message that was received. llListenRemove(iLsn); // Remove the current listen handler so that the script won't listen on the old value of iChan iLsn = llListen(iChan,"","",""); } } Put this simple script into the Contents of a brand new prim and play with it. Send a message on channel 4 to start. Your message should look something like: 35Here is my first message. When the script hears that message, it should say: "This message was received on channel 4." and then "Here is my first message." Then send another message like the first, but this time on channel 35. Each time you send a new message, the script will grab the first two characters of it and turn them into the number of a new channel. (Edit: A single digit channel should have a leading blank or zero, as in 06.) Now, if you want to learn to write scripts, play with this one and ask yourself questions like "What would happen if I typed something other than a number at the start of the message? And how could I prevent that from happening?"
  11. Kenny, you know better than to post something like this. Submit an Abuse Report with all of the information. And then remove all trace of the person's name and your photo from here before the moderators catch you. You know that's against the forum rules.
  12. Coding in notecards? That seems unnecessarily slow. You should at least be using the LSL editor built into your viewer and coding in a "New Script" in an object somewhere. Even that's a bit awkward, considering the minimal level of debugging messages that it offers. You'll find a good starting list of external editors in the LSL wiki at http://wiki.secondlife.com/wiki/LSL_Alternate_Editors . Personally, I use Sublime Text 3, but every time this question comes up in the forum we get suggestions about the other editors that people prefer. All LSL scripts have a .lsl file extension.
  13. Because you have never opened the channel or, if you have, it's in parts of the script that you are not showing here. You always need to provide an llListen handler to open a new channel. If you don't want to run out of available channels, it's also good form to close a channel that you are no longer using. Again, I suggest reading the examples in the LSL wiki.
  • Create New...