Jump to content

Basement Desade

Resident
  • Posts

    22
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

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

  1. What unit of measurement is the vector this returns? For example, when it says I am moving at a velocity of 17, it is 17 what? Meters per second, miles per hour, feet per second, what?
  2. I am trying to trigger an animation from an attached item. I know the HUD script is sending because a similar script in my item is being triggered, I just can't seem to get this one to run the anim. I suspect it has to do with the permissions call I added for the animation. This script compiles and "runs," it just doesn't do anything: integer handle; integer mychannel; integer Key2Number(key objKey) { return ((integer)("0x"+llGetSubString((string)objKey,-8,-1)) & 0x3FFFFFFF) ^ 0x3FFFFFFF; } key owner; default { on_rez(integer start_param) { llResetScript(); llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); } state_entry() { } attach(key attached) { if(attached){ llListenRemove(handle); owner = attached; mychannel = Key2Number(owner); handle =llListen(mychannel,"","",""); } else{ llListenRemove(handle); } } listen(integer channel, string name, key id, string message) { if (message == "on") { llStartAnimation("animation"); } else if (message == "off") { llStopAnimation("animation"); } } } I further suspect it is just a dumb little something I am missing. Any and all help much appreciated. :)
  3. Ah, sorry, my bad, I had neglected to change the llAvatarOnLinkSetTarget ():as well as the llLinkSetTarget calls. Got it sorted now, thanks so much
  4. That targets the specified avatar with a private message, thanks so much. Is there an easy way to determine the link number of the seated avatars? I know the script requests it, but don't know how to get it to tell me so I can set it in the llLinkSitTarget call
  5. I found global variables and bit vectors on the wiki, and I'm sorry, implementing these is way beyond my limited scripting skills. I am mostly a builder, and am at the point with scripts where I am pretty comfortable with the ones that go something like "If THIS happens, do THAT." I have no idea what you mean when you say "loop backwards through the linkset until you get to a link that isn't an avatar," at least in terms of how to go about doing it. I hate to ask, as my intent was not to come here to have my work done for me, but could you perhaps provide an example? I am really floundering on this one.
  6. Yes, thanks. I may not be understanding this properly, but the problem seems to be with the change event trigger, rather than with the specific call. I tried substituting those for the original llAvatarOnSitTarget, with the same spammy result. Or am I simply being dense and missing something obvious?
  7. Thanks, that worked too. But, I neglected to realize something that impacts the usefulness of this script approach for this application. Namely, it uses if (change & CHANGED_LINK) for a trigger. Which is a problem in this case because I need to have two avies be able to sit on this linkset. So, of course it spams one sitter each time another gets on or off. Can someone please point me in the direction I should be going as far as the proper way to accomplish what I want to do? Specifically it is this: I need to have two prims with sits in the linkset. I want the person sitting on either of them to be messaged privately, with no spam in local chat, and no indication to the other sitter that a message has been sent.
  8. btw, is there any way to get the original behavior of the script with llInstantMessage ? The original's call was llSay(0, "Hello " + llKey2Name(av) + ", thank you for sitting down"); I think calling them by name is a nice touch
  9. That was it, thanks to you both. :matte-motes-big-grin-wink:
  10. I am trying to adapt the llAvatarOnSitTarget example from the wiki so it will not be so spammy with multiple sitters in the same area by using llInstantMessage. This is what I have tried, but it gives me an invalid key error. default { state_entry() { // set sit target, otherwise this will not work llSitTarget(<0.0, 0.0, 0.1>, ZERO_ROTATION); } changed(integer change) { if (change & CHANGED_LINK) { key av = llAvatarOnSitTarget(); if (av) // evaluated as true if key is valid and not NULL_KEY { llInstantMessage(llKey2Name(av),"Thank you for sitting down"); } } } } What key point have I missed? :)
  11. Thanks for your efforts. My friend's internet connection is actually pretty good. Scrjpt time for the train is pretty minimal; I am not going to mess with a bunch of sits and rotations to diminish script time by .003 or so. But thanks anyway.
  12. The seats on the train have sit scripts in them, that is why I was reluctant to put the sit target call in the rotation script. Does it have any bearing on my issue? Some function in the script that I'm not understanding? I would really rather not deal with it if I don't have to. The train seats four, for one thing, and I have no idea how to set all the offsets and rotations to suit the four seats from that one call. One seat I could grudgingly deal with. Regarding her connection, I haven't asked, but I am sure it is no worse than that of many. I do Phoenix/Firestorm support, so perforce am aware of connection issues. So anyone who has an iffy connection may experience this problem with rotating prims? I have no doubt you know what you are talking about, but it just seems odd that I have not encountered this as a viewer support issue, but instead only with my little train.
  13. Thanks for the suggestion, Rolig. I had the same friend test it, and it kept moving the first time she sat on it. After that, it was the same old story, but not being anywhere near an expert scripter, it may have been something I did wrong. At first I left out the link sit target call, thinking it at best irrelevent, at worst disruptive. As I said, she sat the first time without it stopping, thereafter it stopped every time but one. Then, thinking the sit target call might have had a use after all, I added it, with about the same result regarding motion, but with the added effect that though on her screen she was properly seated on a seat, on my screen she was embedded in the locomotive. Here is the script I was using at that point: default{ state_entry() { llLinkSitTarget(2,<0.3,0.0,0.6>,ZERO_ROTATION); llListen(3, "", "","train on"); llListen(3, "", "","train off"); } listen(integer channel, string name, key id, string m) { if (m == "train on") { llTargetOmega(<0,0,1>,-PI/20,1.0); llSetTimerEvent(1.0); } if (m == "train off") { llTargetOmega(<0,0,0>,-PI/20,1.0); llSetTimerEvent(0.0); } } timer() { llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_ROTATION,llEuler2Rot(<0.0,0.0,-PI/4>)*llGetRot()]); }} Can you see anything I messed up? And if not, do you have another suggestion, perhaps?
  14. Some time ago I built a train for our sim, which is animated very simply regarding movement. It circles a round track, and is tethered to a root prim in the center with a simple chat triggered rotation script. It has always worked fine, until recently. Lately I've been getting IM's from people apologizing for "breaking" my train. I have TP'd over to look, and on my screen the train is still moving in its endless circle, but on theirs it is stopped. I stop and restart the train, and they report that it is moving. This does not seem to be related to any particular viewer, and I am unable to reproduce it with any of my test alts in any viewer I have tried. They can sit on it and it keeps going just fine. I have tried various solutions, using a friend as a "test dummy" so I will know what works and what doesn't. I tried installing a script to give the "on" command when an avatar sits, with the "if (change & CHANGED_LINK)" call. I have tried just putting a constant rotation script in with no option to turn it on and off. I have even, in frustration, put out a prim that simply repeats the "on" command over and over. Nothing helps. When some people sit on the train, it stops on their screen, but not on mine. But not everyone. Just some. Rotation script is as follows: default { state_entry() { llListen(3, "", "","train on"); llListen(3, "", "","train off"); } listen(integer channel, string name, key id, string m) { if (m == "train on") { llTargetOmega(<0,0,1>,-PI/20,1.0); } if (m == "train off") { llTargetOmega(<0,0,0>,PI/3,1.0); } } } I don't see how it can get much simpler than that. If any of the things I had tried had actually worked, it would have felt like a baling wire and duct tape fix to me anyway. I would rather find out what the problem is and fix that. Can anyone tell me why the train stops for some people when they sit on it, and perhaps suggest a better way to do the rotation so it will not?
×
×
  • Create New...