secondlife / jira-archive

2 stars 0 forks source link

[BUG-231758] llVolumeDetect + Collision + Experience + Teleport to same region = failed collision logic #9159

Open sl-service-account opened 2 years ago

sl-service-account commented 2 years ago

What just happened?

When a Phantom Object has Collision properties enabled and is has an experience enabled that teleports the user to the same region if there is not collision_end event defined in the script the next collision that occures will fail until the user leave and re-enters to initiate the collision.

What were you doing when it happened?

 


list landmark_list;
integer listener;
integer listen_channel;
string teleport;
default {
changed(integer change){ if(change & CHANGED_INVENTORY) llResetScript(); }
state_entry() {
llSetMemoryLimit(32768);
listen_channel = llHash((string)llGetOwner() + (string)llGetKey());
llVolumeDetect(TRUE);
llSetPhysicsMaterial(GRAVITY_MULTIPLIER,0.0,0.0,0.0,0.0);
if (llGetInventoryNumber(INVENTORY_LANDMARK) == 0)
{ llOwnerSay("Please place landmark(s) inside of this prim to setup the teleporter."); }
else {
integer count = llGetInventoryNumber(INVENTORY_LANDMARK);
for(--count ;count >= 0; --count)
{ landmark_list += llGetSubString( llGetInventoryName(INVENTORY_LANDMARK, count),0,21); }
} 
}
collision_start(integer number_of_avatars)
{ llListenRemove(listener); listener = llListen(listen_channel,"",llDetectedKey(0),""); llDialog(llDetectedKey(0), "Where would you like to teleport?", llList2List(landmark_list,0,10), listen_channel); }
collision_end(integer number_of_avatars)
{ /* This section is REQUIRED or you will encounter a bug Basically attempt to teleport to the same region with this event commented out the collision end will not occure (Or something?) to were the next collision does not work at all. Bascially the user must collide twice in this instance to fix it. Attempted to find work around which was to add collision_end event to the script and the problem is resolved. */ }
listen(integer channel, string name, key avatar_uuid, string message)
{ teleport = llJsonSetValue(teleport,[avatar_uuid],message); llRequestExperiencePermissions( avatar_uuid, "" ); }
experience_permissions(key agent_uuid)
{ llTeleportAgent( llGetPermissionsKey(), llJsonGetValue(teleport,[llGetPermissionsKey()]), <0.0,0.0,0.0>, <0.0,0.0,0.0>); teleport = llJsonSetValue(teleport,[llGetPermissionsKey()],JSON_DELETE); }
}

What were you expecting to happen instead?

It would be nice to not require the collision_end event as a patch for this issue.

I expect when a user collides and teleport somewhere in the same region that there is a way for the collision event to reset.

(However this may be expected behavior I am not 100% sure! someone mentioned this issue used to happen with sensor as well but has been patched)

Other information

Thank you for the help!

Links

Related

Original Jira Fields | Field | Value | | ------------- | ------------- | | Issue | BUG-231758 | | Summary | llVolumeDetect + Collision + Experience + Teleport to same region = failed collision logic | | Type | Bug | | Priority | Unset | | Status | Accepted | | Resolution | Triaged | | Created at | 2022-02-07T19:15:41Z | | Updated at | 2022-09-06T17:13:14Z | ``` { 'Build Id': 'unset', 'Business Unit': ['Platform'], 'Date of First Response': '2022-02-07T15:15:25.114-0600', "Is there anything you'd like to add?": 'Thank you for the help!', 'ReOpened Count': 0.0, 'Severity': 'Unset', 'System': 'SL Simulator', 'Target Viewer Version': 'viewer-development', 'What just happened?': 'When a Phantom Object has Collision properties enabled and is has an experience enabled that teleports the user to the same region if there is not collision_end event defined in the script the next collision that occures will fail until the user leave and re-enters to initiate the collision.\r\n\r\n', 'What were you doing when it happened?': 'list landmark_list;\r\ninteger listener;\r\ninteger listen_channel;\r\nstring teleport; \r\n\r\ndefault {\r\n changed(integer change) { if(change & CHANGED_INVENTORY) llResetScript(); }\r\n state_entry() {\r\n llSetMemoryLimit(32768);\r\n listen_channel = llHash((string)llGetOwner() + (string)llGetKey());\r\n llVolumeDetect(TRUE);\r\n llSetPhysicsMaterial(GRAVITY_MULTIPLIER,0.0,0.0,0.0,0.0);\r\n if (llGetInventoryNumber(INVENTORY_LANDMARK) == 0) {\r\n llOwnerSay("Please place landmark(s) inside of this prim to setup the teleporter.");\r\n } else {\r\n integer count = llGetInventoryNumber(INVENTORY_LANDMARK);\r\n for(--count ;count >= 0; --count) {\r\n landmark_list += llGetSubString(\r\n llGetInventoryName(INVENTORY_LANDMARK, count),0,21);\r\n }\r\n } \r\n }\r\n collision_start(integer number_of_avatars) {\r\n llListenRemove(listener);\r\n listener = llListen(listen_channel,"",llDetectedKey(0),"");\r\n llDialog(llDetectedKey(0), \r\n "Where would you like to teleport?",\r\n llList2List(landmark_list,0,10), listen_channel);\r\n }\r\n collision_end(integer number_of_avatars) {\r\n /* \r\n This section is REQUIRED \r\n or you will encounter a bug\r\n \r\n Basically attempt to teleport to the same region\r\n with this event commented out the collision end\r\n will not occure (Or something?) to were the next\r\n collision does not work at all. Bascially the user\r\n must collide twice in this instance to fix it.\r\n \r\n Attempted to find work around which was to add\r\n collision_end event to the script and the problem\r\n is resolved. \r\n */ \r\n }\r\n listen(integer channel, string name, key avatar_uuid, string message) {\r\n teleport = llJsonSetValue(teleport,[avatar_uuid],message);\r\n llRequestExperiencePermissions( avatar_uuid, "" ); \r\n }\r\n experience_permissions(key agent_uuid) {\r\n llTeleportAgent(\r\n llGetPermissionsKey(),\r\n llJsonGetValue(teleport,[llGetPermissionsKey()]), \r\n <0.0,0.0,0.0>, <0.0,0.0,0.0>);\r\n teleport = llJsonSetValue(teleport,[llGetPermissionsKey()],JSON_DELETE);\r\n }\r\n\r\n}', 'What were you expecting to happen instead?': 'It would be nice to not require the collision_end event as a patch for this issue.\r\n\r\nI expect when a user collides and teleport somewhere in the same region that there is a way for the collision event to reset.\r\n\r\n(However this may be expected behavior I am not 100% sure! someone mentioned this issue used to happen with sensor as well but has been patched)', } ```
sl-service-account commented 2 years ago

Lucia Nightfire commented at 2022-02-07T21:15:25Z, updated at 2022-02-07T21:17:47Z

I can repro this using my own test script below:

default
{
    state_entry()
    {
        llVolumeDetect(TRUE);
    }
    on_rez(integer i)
    {
        llResetScript();
    }
    collision_start(integer i)
    {
        key dk = llDetectedKey(0);
        llOwnerSay("collision_start() - llDetectedKey(0) = " + (string)dk);
        llRequestExperiencePermissions(dk,"");
    }
    collision(integer i)
    {
        llOwnerSay("collision() - llDetectedKey(0) = " + (string)llDetectedKey(0));
    }
    collision_end(integer i)
    {
        llOwnerSay("collision_end() - llDetectedKey(0) = " + (string)llDetectedKey(0));
    }
    experience_permissions(key k)
    {
        if (llGetAgentSize(k))
        {
            if (llGetInventoryNumber(INVENTORY_LANDMARK))
            {
                llOwnerSay("experience_permissions() - llTeleportAgent() Agent: " + (string)k);
                llTeleportAgent(k,llGetInventoryName(INVENTORY_LANDMARK,0),llGetPos() + <5.0,0.0,0.0>,<0.0,1.0,0.0>);
            }
            else
            {
                llOwnerSay("experience_permissions() - llTeleportAgentGlobalCoords() Agent: " + (string)k);
                llTeleportAgentGlobalCoords(k,llGetRegionCorner(),llGetPos() + <5.0,0.0,0.0>,<0.0,1.0,0.0>);
            }
        }
    }
    experience_permissions_denied(key k, integer reason)
    {
        llOwnerSay("experience_permissions_denied() - Agent: " + (string)k + " Reason: " + llGetExperienceErrorMessage(reason));
    }
} 

When a landmark is present in the test object's inventory, llTeleportAgent() is used instead of llTeleportAgentGlobalCoords().

llTeleportAgent() seems to exhibit the bug, not llTeleportAgentGlobalCoords().

When using llTeleportAgentGlobalCoords(), both collision start and end trigger:

[13:08:43] BUG-231758 (llVolumeDetect() Experience Teleport Test): collision_start() - llDetectedKey(0) = b91d12f1-4e0f-4752-8199-73d71fdeeee5 [13:08:43] BUG-231758 (llVolumeDetect() Experience Teleport Test): experience_permissions() - llTeleportAgentGlobalCoords() Agent: b91d12f1-4e0f-4752-8199-73d71fdeeee5 [13:08:43] BUG-231758 (llVolumeDetect() Experience Teleport Test): collision_end() - llDetectedKey(0) = b91d12f1-4e0f-4752-8199-73d71fdeeee5

When using llTeleportAgent(), only collision start triggers:

[13:08:58] BUG-231758 (llVolumeDetect() Experience Teleport Test): collision_start() - llDetectedKey(0) = b91d12f1-4e0f-4752-8199-73d71fdeeee5 [13:08:58] BUG-231758 (llVolumeDetect() Experience Teleport Test): experience_permissions() - llTeleportAgent() Agent: b91d12f1-4e0f-4752-8199-73d71fdeeee5

I have to walk into the volume detect prim again to trigger collision_end.

I suggest a title change to mention llVolumeDetect() instead of "phantom" for better search return.

sl-service-account commented 2 years ago

Maestro Linden commented at 2022-02-08T18:13:38Z

Thanks for the report - we can reproduce this issue as well.