Swimmie Chaffe Posted May 19, 2011 Share Posted May 19, 2011 Hi,I am wondering if it is possible to script a prim so that it would locate and move to the owner when the owner calls it using llRegionSay. I'd appreciate if anyone could advise if it is do-able, and if it is, what would be an efficient way to script it.Thanks!Swimmie Link to comment Share on other sites More sharing options...
Darkie Minotaur Posted May 19, 2011 Share Posted May 19, 2011 It shouldn't be to difficult (RegionSay would have to be used by a prim, not by the ava - right?). prim1 call prim2 using region say prim2 does a llGetObjectDetails to get the position of it's owner on the same sim prim2 uses warpPos or a similar function to get to the position retrieved from llGetObjectDetails Just a first idea. Link to comment Share on other sites More sharing options...
Swimmie Chaffe Posted May 19, 2011 Author Share Posted May 19, 2011 Thanks Darkie! Getting the owner's location is the part I was not sure how to do. I am thinking to use a HUD for a "caller" prim. Can a distant prim (prim 2) get the owner's position (who wear's the HUD) by requesting llGetObjectDetails of the HUD? Link to comment Share on other sites More sharing options...
Darkie Minotaur Posted May 19, 2011 Share Posted May 19, 2011 The function works region wide Link to comment Share on other sites More sharing options...
Cerise Sorbet Posted May 19, 2011 Share Posted May 19, 2011 Here is the basic to start with. //sending object (like your HUD)integer channel = -383838;default{ touch_start(integer total_number) { if (llDetectedKey(0) == llGetOwner()) llRegionSay(channel, "Here primmy primmy!"); }} // moving objectinteger channel = -383838;safe_posJump(vector target_pos){/* An alternative to the warpPos trick without all the overhead. Trickery discovered by Uchi Desmoulins and Gonta Maltz. More exact value provided by Fake Fitzgerald. Safe movement modification provided by Alias Turbo. */ vector start_pos = llGetPos(); llSetLinkPrimitiveParamsFast(!!llGetLinkNumber(), [PRIM_POSITION, <1.304382E+19, 1.304382E+19, 0.0>, PRIM_POSITION, target_pos, PRIM_POSITION, start_pos, PRIM_POSITION, target_pos]);}default{ state_entry() { llListen(channel, "", "", "Here primmy primmy!"); } listen(integer channel, string name, key id, string message) { key o = llGetOwner(); if (llGetOwnerKey(id) == o) { list details = (llGetObjectDetails(o, [OBJECT_POS, OBJECT_ROT])); vector where = llList2Vector(details, 0); rotation rot = llList2Rot(details, 1); // put it 1 m in front of owner & 1 m higher than pelvis safe_posJump(where + (<1, 0, 0> * rot) + <0., 0., 1.>); llSetRot(rot); } }} Link to comment Share on other sites More sharing options...
Swimmie Chaffe Posted May 29, 2011 Author Share Posted May 29, 2011 Thank you very much!!! Link to comment Share on other sites More sharing options...
Marcin Pang Posted May 30, 2011 Share Posted May 30, 2011 Hi, is it possible to send message to the specified obcjet (determined by key) ? hmmm... Let me start from the beginning. I got a few key objects (I used llSensor and llDetectedKey). Now I want to send message to the selected object (for example, the nearest object). Objects have the same name (copies). How is the easiest way to do this? Link to comment Share on other sites More sharing options...
Innula Zenovka Posted May 30, 2011 Share Posted May 30, 2011 https://wiki.secondlife.com/wiki/LlRegionSayTo It's a very new function, but if you know the key of the object, it's ideal, I would think. Link to comment Share on other sites More sharing options...
Marcin Pang Posted June 1, 2011 Share Posted June 1, 2011 Yeah.. It would be very useful, but it's new function and I'm using OpenSim server Some other ideas ? Link to comment Share on other sites More sharing options...
Innula Zenovka Posted June 1, 2011 Share Posted June 1, 2011 I don't know what open sim does and doesn't support... you could try having the objects all listen on different channels generated from their uuids -- something like this: integer my_channel = ((integer)("0x"+llGetSubString((string)llGetKey(),-8,-1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF; -- and have sensor prim calculate what channel to use from that? I think that's reasonably safe from collisions unless, perhaps, you've drag copied them. Or maybe tell them to respond only to messages prefixed by their uuid? Link to comment Share on other sites More sharing options...
Marcin Pang Posted June 1, 2011 Share Posted June 1, 2011 Sorry, it sounded rude. I should have written earlier that I use OpenSim Anyway, thanks. I will try your idea. This should help (unless there are more problems...). Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now