Jump to content

Attempting to figure out a function...


Phiona Mercy
 Share

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

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

Recommended Posts

I saw a scripted object that did something pretty amazing that I was surprised about -- even when my privacy settings are set to 0, it is aware of who I am camming.

In a roleplaying sim, if I am targeting a player (even with my LookAtTarget turned off) -- it is aware of who my camera is focused on when doing "versus" dice rolls~ automatically rolling the dice appropriate to their stats. While I am aware (via LookAt's existance) -- that SL is able to decipher this, I thought turning off LookAtTargets spoiled this~

At first I thought it was rezzing an object at my look-at vector that was doing some kind of shout-call back to my meter on a hidden or dynamic channel then deleting itself-- but looking inside both the worn titler that functions with the meter, and the HUD object-- there is only one prim each with no linked parts, and neither of them have objects inside them that they could be rezzing.

I am very much interested in figuring out how to get the UUID of an avatar my camera is locked on via the 'People' radar~

Link to comment
Share on other sites

So--- I think.. I may have found a solution, but my code isn't picking up avatars for some reason. I'm trying to single out Agents~

 

/*default{    touch_start(integer total_number)    {vector c_pos = llGetCameraPos(); //Get Users Camera Positionrotation c_rot = llGetCameraRot(); //Get Users Camera Rotation//llOwnerSay("Scan from "+(string)c_pos+" to "+(string)(llRot2Fwd(c_rot)*100+c_pos));list results=llCastRay(c_pos,llRot2Fwd(c_rot)*100+c_pos,[RC_REJECT_TYPES,RC_REJECT_PHYSICAL|RC_REJECT_NONPHYSICAL|RC_REJECT_LAND,RC_DATA_FLAGS,0,RC_MAX_HITS,2,RC_DETECT_PHANTOM,FALSE]);integer status=llList2Integer(results,-1);integer hitNum = 0;*/  default{    state_entry()    {        string ownerName = llKey2Name(llGetOwner());        llOwnerSay("Hello, " + ownerName + "!");    }     touch_start(integer total_number)    {        vector start = llGetCameraPos();        vector end = llRot2Fwd(llGetCameraRot())*100 + start;//start - <0.0, -25.0, 0.0>;//start+<60.0,0.0,0.0>*llGetCameraRot();          list results = llCastRay(start, end,[RC_REJECT_TYPES,RC_REJECT_PHYSICAL|RC_REJECT_NONPHYSICAL|RC_REJECT_LAND,RC_DATA_FLAGS,0,RC_MAX_HITS,2,RC_DETECT_PHANTOM,FALSE]);//llCastRay(start, end, [RC_REJECT_TYPES, filter, RC_MAX_HITS, 4] );        integer length = llGetListLength(results);        integer hitNum = 0;        llOwnerSay("We Got to Step 1.");        // Handle error conditions here by checking llList2Integer(results, -1) >= 0        while (hitNum < length+1)        {            // Stride is 2 because we didn't request normals or link numbers            key uuid = llList2Key(results, 2*hitNum);             string name = "Land"; // if (uuid == NULL_KEY)             if (uuid != NULL_KEY)                name = llKey2Name(uuid);            llOwnerSay("We Got to Step 2." + (string)hitNum + "/" + (string)length);             llOwnerSay("Hit " + name + ".");             ++hitNum;                /*        list my_list = results;        integer i = 0;        integer end = llGetListLength(my_list);        //Debug to see contents of List not firing.        for (; i<end; ++i)        {            llOwnerSay("string=" + llList2String(my_list,i)                        + "\n   integer=" + (string)llList2Integer(my_list,i) + " OR " +(string)((integer)llList2String(my_list,i))                        + "\n   float=" + (string)llList2Float(my_list,i) + " OR " +(string)((float)llList2String(my_list,i))                        + "\n   vector=" + (string)llList2Vector(my_list,i) + " OR " +(string)((vector)llList2String(my_list,i))                        + "\n   rot=" + (string)llList2Rot(my_list,i) + " OR " +(string)((rotation)llList2String(my_list,i))                        + "\n   key=" + (string)llList2Key(my_list,i) + " OR " +(string)((key)llList2String(my_list,i)) );        }        */                    }    }}

And I do not know enough about ray-casts to know if it's because my raycast is not projecting, or if it is aiming in the wrong direction from my camera, or if I am accidently filtering agents from the results... or maybe I am not allow-- I think I figured it out. I don't think I am granting it camera permissions and should "never assume it's granted automatically" -- give me a second!

Link to comment
Share on other sites

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

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
 Share

×
×
  • Create New...