secondlife / jira-archive

3 stars 0 forks source link

[BUG-9142] llSay / llWhisper stop to communicate between attachments while sitting on an object #16675

Open sl-service-account opened 9 years ago

sl-service-account commented 9 years ago

Actual Behavior

Let's say you have 2 attachments, you wear them. They communicate between each other freely via llWhisper/llSay until you sit on an object which moves you (as a linked prim) quite far from its root.

It breaks attachment communication while they are still attached to you and the distance between them is equal to 0m.

Steps to Reproduce

Steps to reproduce:

Create 2 attachment objects with the same script inside:


integer CHANNEL = -7915790;

string cmns_roundFloat(float floatNumber,integer digitsAfterDot){
    float f = llPow(10.0,digitsAfterDot);
    integer i = llRound((floatNumber * f));
    string s = ((string)(((integer)i) / f));
    return llGetSubString(s,0,(llSubStringIndex(s,".") + digitsAfterDot));
}

string cmns_getDistanceStr(key objectKey,integer roundToDigits){
    float distance = llVecDist(llGetPos(),llList2Vector(llGetObjectDetails(objectKey,[OBJECT_POS]),0));
    return cmns_roundFloat(distance,roundToDigits);
}

default {

  state_entry() {
        llListen(CHANNEL,"",NULL_KEY,"");
    }

  attach(key id) {
        if ((id != NULL_KEY)) {
            llSetObjectName(((("@" + ((string)llGetAttached())) + "- Attach ") + ((string)llGetUnixTime())));
        }
    }

  touch_start(integer num_detected) {
        llWhisper(CHANNEL,((string)llGetUnixTime()));
    }

  listen(integer channel,string name,key id,string message) {
        llWhisper(0,(((((((((("owned by \"" + llKey2Name(llGetOwner())) + "\"\nreceived \"") + message) + "\"\nfrom \"") + name) + "\" owned by \"") + llKey2Name(llGetOwnerKey(id))) + "\"") + "\n distance: ") + cmns_getDistanceStr(id,1)));
    }
}

Wear them so both are clickable (you may attach them as 2 HUD objects)

Now create a prim on which you gonna sit with the following script inside:


integer getNumberOfAgents() {
  return llGetNumberOfPrims() - getNumberOfPrims();
}

integer getNumberOfPrims(){
  integer cache=llGetObjectPrimCount(llGetKey());
  if (!cache) return llGetNumberOfPrims();
  return cache;
}

updateSitters(vector distance) {
  integer primsCount=getNumberOfPrims();
  integer linkNum = llGetNumberOfPrims();
  vector size;
  key user;
  while (linkNum>primsCount) {
    user=llGetLinkKey(linkNum);
    size =  llGetAgentSize(user);
    if (size!=ZERO_VECTOR) {
      llSetLinkPrimitiveParamsFast(linkNum,
               [PRIM_POSITION, distance]);
    }
    linkNum--;
  } 
}

vector distance=<0,0,10.1>;

status(key id) {
  if (id==NULL_KEY) {
    llSay(0, "Current distance: "+(string)distance);
  } else {
    llRegionSayTo(id, 0, "Current distance: "+(string)distance);
  } 
}

default {
  state_entry() {
    llSitTarget(<0,0,1>, ZERO_ROTATION);
    status(NULL_KEY);
    llSay(0, "Sit on me, click me to change the sit distance");
  }

  changed(integer change) {
    if (change & CHANGED_LINK) {
      updateSitters(distance);
    }
  }

  touch_start(integer num_detected) {
    if (distance==<0,0,10>) distance=<0,0,10.1>; else distance=<0,0,10>;
    status(llDetectedKey(0));
    updateSitters(distance);
  }

}

Now check that your attachments communicate by clicking them and watching nearby chat

Now sit on the object created and try to click your attachments, they should now cease to communicate. Try clicking the object you are sitting on to switch your distance from 10.1 to 10 meters. Now attachments should again communicate

Expected Behavior

Attachments should continue talking despite where avatar wearing them sits upon

Original Jira Fields | Field | Value | | ------------- | ------------- | | Issue | BUG-9142 | | Summary | llSay / llWhisper stop to communicate between attachments while sitting on an object | | Type | Bug | | Priority | Unset | | Status | Accepted | | Resolution | Accepted | | Reporter | Ray Silent (ray.silent) | | Created at | 2015-04-27T06:04:27Z | | Updated at | 2019-06-11T16:09:17Z | ``` { 'Business Unit': ['Platform'], 'Date of First Response': '2015-04-27T12:44:38.076-0500', 'Severity': 'Unset', 'System': 'SL Simulator', 'Target Viewer Version': 'viewer-development', 'What just happened?': "Let's say you have 2 attachments, you wear them. They communicate between each other freely via llWhisper/llSay until you sit on an object which moves you (as a linked prim) quite far from its root.\r\n\r\nIt breaks attachment communication while they are still attached to you and the distance between them is equal to 0m.", 'What were you doing when it happened?': 'Steps to reproduce:\r\n\r\nCreate 2 attachment objects with the same script inside:\r\n\r\ninteger CHANNEL = -7915790;\r\n\r\nstring cmns_roundFloat(float floatNumber,integer digitsAfterDot){\r\n float f = llPow(10.0,digitsAfterDot);\r\n integer i = llRound((floatNumber * f));\r\n string s = ((string)(((integer)i) / f));\r\n return llGetSubString(s,0,(llSubStringIndex(s,".") + digitsAfterDot));\r\n}\r\n\r\nstring cmns_getDistanceStr(key objectKey,integer roundToDigits){\r\n float distance = llVecDist(llGetPos(),llList2Vector(llGetObjectDetails(objectKey,[OBJECT_POS]),0));\r\n return cmns_roundFloat(distance,roundToDigits);\r\n}\r\n\r\ndefault {\r\n\r\n state_entry() {\r\n llListen(CHANNEL,"",NULL_KEY,"");\r\n }\r\n\r\n \r\n attach(key id) {\r\n if ((id != NULL_KEY)) {\r\n llSetObjectName(((("@" + ((string)llGetAttached())) + "- Attach ") + ((string)llGetUnixTime())));\r\n }\r\n }\r\n\r\n \r\n touch_start(integer num_detected) {\r\n llWhisper(CHANNEL,((string)llGetUnixTime()));\r\n }\r\n\r\n \r\n listen(integer channel,string name,key id,string message) {\r\n llWhisper(0,(((((((((("owned by \\"" + llKey2Name(llGetOwner())) + "\\"\\nreceived \\"") + message) + "\\"\\nfrom \\"") + name) + "\\" owned by \\"") + llKey2Name(llGetOwnerKey(id))) + "\\"") + "\\n distance: ") + cmns_getDistanceStr(id,1)));\r\n }\r\n}\r\n\r\n\r\nWear them so both are clickable (you may attach them as 2 HUD objects)\r\n\r\n\r\n\r\nNow create a prim on which you gonna sit with the following script inside:\r\n\r\n\r\ninteger getNumberOfAgents() {\r\n return llGetNumberOfPrims() - getNumberOfPrims();\r\n}\r\n\r\ninteger getNumberOfPrims(){\r\n integer cache=llGetObjectPrimCount(llGetKey());\r\n if (!cache) return llGetNumberOfPrims();\r\n return cache;\r\n}\r\n\r\nupdateSitters(vector distance) {\r\n integer primsCount=getNumberOfPrims();\r\n integer linkNum = llGetNumberOfPrims();\r\n vector size;\r\n key user;\r\n while (linkNum>primsCount) {\r\n user=llGetLinkKey(linkNum);\r\n size = llGetAgentSize(user);\r\n if (size!=ZERO_VECTOR) {\r\n llSetLinkPrimitiveParamsFast(linkNum,\r\n [PRIM_POSITION, distance]);\r\n }\r\n linkNum--;\r\n }\t\r\n}\r\n\r\nvector distance=<0,0,10.1>;\r\n\r\nstatus(key id) {\r\n if (id==NULL_KEY) {\r\n \tllSay(0, "Current distance: "+(string)distance);\r\n } else {\r\n llRegionSayTo(id, 0, "Current distance: "+(string)distance);\r\n }\t\r\n}\r\n\r\ndefault {\r\n state_entry() {\r\n llSitTarget(<0,0,1>, ZERO_ROTATION);\r\n status(NULL_KEY);\r\n llSay(0, "Sit on me, click me to change the sit distance");\r\n }\r\n \r\n changed(integer change) {\r\n \tif (change & CHANGED_LINK) {\r\n \t updateSitters(distance);\r\n \t}\r\n }\r\n \r\n touch_start(integer num_detected) {\r\n \tif (distance==<0,0,10>) distance=<0,0,10.1>; else distance=<0,0,10>;\r\n \tstatus(llDetectedKey(0));\r\n \tupdateSitters(distance);\r\n }\r\n \r\n}\r\n\r\n\r\nNow check that your attachments communicate by clicking them and watching nearby chat\r\n\r\nNow sit on the object created and try to click your attachments, they should now cease to communicate. Try clicking the object you are sitting on to switch your distance from 10.1 to 10 meters. Now attachments should again communicate\r\n', 'What were you expecting to happen instead?': 'Attachments should continue talking despite where avatar wearing them sits upon\r\n', } ```
sl-service-account commented 9 years ago

Whirly Fizzle commented at 2015-04-27T17:44:38Z

Is this SVC-6909 ?

sl-service-account commented 9 years ago

Lucia Nightfire commented at 2015-04-27T18:16:57Z

You can alternatively use llRegionSayTo() and target yourself and all attachments listening to the target channel can detect the chat.

sl-service-account commented 9 years ago

Ray Silent commented at 2015-04-28T01:38:11Z

Seems it's the same as SVC-6909, I just couldn't locate it