Jump to content

Summoning a prim


Swimmie Chaffe
 Share

You are about to reply to a thread that has been inactive for 4135 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

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

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

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

  • 2 weeks later...

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

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

You are about to reply to a thread that has been inactive for 4135 days.

Please take a moment to consider if this thread is worth bumping.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...