secondlife / jira-archive

3 stars 0 forks source link

[BUG-202658] touch_start event takes two clicks to trigger when changing from a state that does NOT contain a touch_start event #2983

Open sl-service-account opened 6 years ago

sl-service-account commented 6 years ago

Steps to Reproduce

//Here is an example script that triggers the glitch.  Insert this into an object, then touch the object to receive a "Touched" message and a notification that the script has gone into state test2.  Then wait for it to go back to state test1.  At that point, clicking it once will not trigger anything but the second click will.

default
{
    state_entry()
    {
        state test1;
    }
}

state test1
{
    state_entry()
    {
        llOwnerSay("You are in state test1");
    }

    touch_start(integer total_number)
    {
        llSay(0, "Touched.");
        state test2;
    }
}

state test2
{
    state_entry()
    {
        llOwnerSay("You are in state test2");
        llSetTimerEvent(5);
    }

    timer()
    {
        llSetTimerEvent(0);
        state test1;
    }
} 

Actual Behavior

I was using a script with multiple states. One state had a touch_start event, the other did not. When changing from a state that did NOT to a state that DID, it took two clicks for the touch_start event to trigger.

Expected Behavior

I expected the touch_start event to trigger the first time, every time.

Other information

It seems that the glitch does not occur if both states have a touch_start event. Meaning, in the example script, if you add a touch_start event to state test2, the glitch will not trigger.

The glitch also does not occur if you are leaving the default state, regardless of whether the default state had a touch_start event or not.

Links

Duplicates

Original Jira Fields | Field | Value | | ------------- | ------------- | | Issue | BUG-202658 | | Summary | touch_start event takes two clicks to trigger when changing from a state that does NOT contain a touch_start event | | Type | Bug | | Priority | Unset | | Status | Accepted | | Resolution | Accepted | | Reporter | Erika Wemyss (erika.wemyss) | | Created at | 2017-11-26T21:36:55Z | | Updated at | 2024-01-11T20:03:09Z | ``` { 'Business Unit': ['Platform'], 'Date of First Response': '2017-11-26T17:30:26.964-0600', "Is there anything you'd like to add?": 'It seems that the glitch does not occur if both states have a touch_start event. Meaning, in the example script, if you add a touch_start event to state test2, the glitch will not trigger.\r\n\r\nThe glitch also does not occur if you are leaving the default state, regardless of whether the default state had a touch_start event or not.', 'ReOpened Count': 0.0, 'Severity': 'Unset', 'System': 'SL Simulator', 'Target Viewer Version': 'viewer-development', 'What just happened?': 'I was using a script with multiple states. One state had a touch_start event, the other did not. When changing from a state that did NOT to a state that DID, it took two clicks for the touch_start event to trigger.', 'What were you doing when it happened?': '//Here is an example script that triggers the glitch. Insert this into an object, then touch the object to receive a "Touched" message and a notification that the script has gone into state test2. Then wait for it to go back to state test1. At that point, clicking it once will not trigger anything but the second click will.\r\n\r\ndefault\r\n{\r\n state_entry()\r\n {\r\n state test1;\r\n }\r\n}\r\n\r\n\r\nstate test1\r\n{\r\n state_entry()\r\n {\r\n llOwnerSay("You are in state test1");\r\n }\r\n\r\n touch_start(integer total_number)\r\n {\r\n llSay(0, "Touched.");\r\n state test2;\r\n }\r\n}\r\n\r\nstate test2\r\n{\r\n state_entry()\r\n {\r\n llOwnerSay("You are in state test2");\r\n llSetTimerEvent(5);\r\n }\r\n\r\n timer()\r\n {\r\n llSetTimerEvent(0);\r\n state test1;\r\n }\r\n}', 'What were you expecting to happen instead?': 'I expected the touch_start event to trigger the first time, every time.', 'Where': 'http://maps.secondlife.com/secondlife/Rocket%20City/57/133/22', } ```
sl-service-account commented 6 years ago

Lucia Nightfire commented at 2017-11-26T23:30:27Z

Use a touch_end() event instead as per recommended in the example script in http://wiki.secondlife.com/wiki/State

sl-service-account commented 6 years ago

Whirly Fizzle commented at 2017-11-27T04:45:04Z

Is this a dupe of SVC-3017 ?