|
|
|
[
Permlink
| « Hide
]
Saskia McLaglen added a comment - 06/Sep/08 03:15 PM
That reproduces for me, on server version 1.24.4.95600
I can repro this with LSL but Mono complied it works as expected.
Great find!
Please see VWR-9023 Appears newest server code fixed this one.
This issue was corrected in server version 1.24.6.97433.
This issue has returned in server version 1.24.7.98039. The last comment under https://jira.secondlife.com/browse/VWR-9023 I reproduced this on Second Life Server 1.24.9.98659. Based on my own tests, in order to reproduce the issue:
I'm using "touch*" to mean any of touch, touch_start, or touch_end. I have found 2 work-arounds for this issue:
P.S. Here's my own code to reproduce the problem. It demonstrates that it doesn't have to be the same state again. ------------- default touch_start( integer n ) { state B; }} state B timer() { state C; }} state C touch_start( integer n ) { llSay(0, "If you had to click an extra time just now, the SVC-3017 bug is still alive."); llSay(0, "Going back to A so you can try it again."); state default; }} Second Life 1.21.5 (98701) Oct 6 2008 10:27:21 (Second Life Release Candidate)
Just came across this in the following situation: state A state B state C then back to state A, where the next touch event is not registered Putting a touch event in state C does not help. Interestingly (or not?) this doesn't seem to affect scripts that I compiled before Server 1.24 ... only those scripts I am currently writing since the last upgrade.
The work-around (add an empty touch handler to the other state) does seem to work ... but is cumbersome. I'm able reproduce this. My vendor script is behaving this way.
Second Life 1.21.6 (99587) Oct 15 2008 09:48:17 (Second Life Release) You are at 158482.4, 253350.6, 630.1 in ASI Maupiti located at sim5021.agni.lindenlab.com (8.2.32.22:13001) Hey, vek, can you repro this, or assign it for repro?
Not sure if it is solely a server issue. Second Life 1.21.6 (98973) Oct 8 2008 18:07:30 (Second Life Public Nightly)
You are at 255731.6, 255323.3, 20.9 in Sandbox Goguen located at sim3001.aditi.lindenlab.com (8.2.33.227:12035) Second Life Beta Server 1.25.0.100573 ======= This bug seems fixed on Second Life Beta Server 1.25.0.100573 It also appears to be the same as SVC-3207 Unable to repro in 1.25.1.102792
Second Life Server 1.24.10.106829 AND 1.25.4.108489
The bug is intermittent in Haven Shire 1.24.10.106829 On returning via a Timer Event to the Default State, the first touch_start event is lost. Tested with the following code: default touch_start(integer total_number) { llSay(0, "Touched in Default State"); state state_2; }} //////////////////////////////////// state state_2 timer() { state default; }} Could this regression be related to the fix for VWR-9023 ? This bug still persists on 1.25.4 : /
Please, fix it ! : ) Hi Phil,
You're right, it's back ... The server drops the first touch after leaving a state without touch-event. ======= Second Life 1.22.6 (108361) Jan 20 2009 13:28:18 (Second Life Release Candidate) @panacea - For you, is this consistent whether right-click menu touch and left click touch are used? This would help isolate which code to look at.
Moon, we're going to try to repro this. There were also some viewer changes to touch behavior, so to isolate this to a viewer or server issue the best way to test is to see if touching (left click) and right click select Touch from pie behave identically. If the bug repros on right click then we know it's server side.
It does not repro on right-click.
Second Life 1.22.6 (108361) Jan 20 2009 13:28:18 (Second Life Release Candidate) I'm getting a partial repro on right-click>Touch - I think the following is what I'm seeing:
Left-click (with state change and return via timer), loses the subsequent left-click every time. Left-click (with state change and return via timer) followed by right-click>Touch - loses that right-click>Touch right-click>Touch (with state change and return via timer) followed by right-click>Touch - no problem right-click>Touch (with state change and return via timer) followed by left-click - also no problem This has been reproduced internally, and I have reopened this bug. It has been assigned to a dev who is familiar with it, and should be addressed asap.
Still there at Second Life 1.22.8 (109366) Feb 1 2009 13:13:47 (Second Life Release Candidate)
but Vektor says its been assigned so just wait for asap to occur little workaround
add an empty touch_start to the state that currently does not have one - this somehow makes the other touch_start respond to the first touch............. I have also discovered that the "dropped" touch is occasionally sent to the root prim if the touch originates from a child. This seems to be random, but is still quite common. To test this I set up to two coloured boxes; One green (the child) and the other blue (root). The green box has the script that produces the bug, and the blue has a touch event that will produce a message when touched. I am able to trigger the touch event on the blue box when encountering the bug in the green box.
For the record, everything works properly on MacOSX.
Second Life 1.21.6 (99587) For the record, it does NOT work properly on MacOSX
My doors and window controllers all require 2 touches to act. I am facing the task of replacing scripts in every door and window controller of every house with scripts which have an empty touch_start in other states. It's actually NOT a bug!
The VM registers a click on touch but it actually has to solve to events, not just one. The second event that will becomes triggered when a touch is applied is "touch_end() {;}". So there is a simple way to solve this by using the correct sequence of events: default { state_entry() { llSay(0, "This is the state <default>."); state default; } touch_start(integer cnt) { //something we want to do when a touch is starting } touch_end(integer cnt) { llSay(0, "starting state transition"); state another_state; // here we may change state without any risk ! } } state another_state { state_entry() { llSay(0, "This is the state <another_state>."); state default; } } This is NOT a workaround, this seems to be intended behaviour from the way the VM solves triggered chains of events! I see what you are saying Jord and what you have said does work and it is probably a lot tidier (and more logical) than having a dummy touch start - however, that said, note the OP 'This issue seems to have been introduced in server 1.24.4.95600' - therefore it seems that the touch_end (which effectively catches the mouse button being released) was not necessary before that server version.
So was the original way it worked the 'bug'? I think the majority of people would be quite happy to see the mouse release blackholed as it was before server 1.24.4.95600 I don't buy this as "not being a bug" as collision events don't behave the way Jord describes as normal. You don't have to have fake or unneeded event calls (collision_end) for them to work "correctly".
Also as someone else stated, this was introduced and breaks in world content, many of them are no mod and can't be fixed without replacement. IDK who downgraded this to "nice to have" but this IS a bug, not a feature request! I'm setting it back to normal. Yes, I see why it is hard to believe that this is not a bug. But actually this topic is a very old one. And when you follow this through all related issues you will find that this has become mixed from the ideas about a newer bug about the VM not resetting correctly when llResetScript(){;} takes place. Sometimes it is hard to separate the behaviour that comes from the way event chains are solved from what we have with the issue of llResetScript(){;} preserving already triggered events and from this not working correctly.
It seems pretty easy to mix this with observations from making state transitions within the most commonly used touch_start() {;} instead of touch_end() {;}. Of course one can say that this is not correct as many do believe that preservation of timers when changing states is a bug; but in fact it's not, it's intended for some reason as it seems. Right now many write scripts in a way where touch_start(){;} is mostly used, because this is what the default script gives you at hand in the first place. The LSL-Wiki should tell more clearly about this, the concept of event chains and how to make use of it to get the expected results! Counclusion: If this is getting fixed the way it is requested by the original poster, one of touch_start(){;} and touch_end(){;} events could also be removed, since to have both of of those events becomes almost pointless then! And hopefully llResetScript(){;} preserving triggered events becomes fixed soon, since this is a bug of course and in many scripts also hard to distinguish from the behaviour of event chains and preserved event triggers for them. Then explain: if this is "normal", why collision_start doesn't behave the way you describe? It's the same type "chain event" yet it doesn't require a collision_end call to allow another collision start when state is changed back. I do this to keep from getting multiple triggers in single player sports games, simple example below.
string name; default collision_start(integer total_number) { name=llDetectedName(0); state check; }} } I never believed a timer should reset in a state change but this one IS a bug as this was introduced on a server code update and breaks in world content. One more time THIS WAS NOT THE WAY THIS WORKED PRIOR TO SEVER VERSION 1.24.4.956000!! There was no "major changes to the VM and LSL language concept" when this started happening. If the above is a "bug" as you seem to believe, when they "fix" this, that too will break a lot of in-world content!! As far as using touch_end instead of touch_start, touch_end is triggered when you STOP touching an object, not when you first click it so these are NOT the same action and the object wouldn't behave the same way. If you hold down the mouse key, the touch event would never be triggered with touch_end. Maybe you could show a useful example of WHY you would want a touch_end event triggered in the next state instead of black holed on state change as it was before this server update? I've tried to think on any valid use for that behavior and can't come up with anything. I can come up with many valid uses for having both a touch start and touch end event, such as touch_start(integer n) { llLoopSound("Blow_Horn",1.0); }touch_end(integer n) { llStopSound(); }To combine these touch events into a "on_touch()" event as you suggest, would make a simple horn button that blows as long as you hold down the button impossible to make. If you want something to happen in the next state when you release the touch, simply have the state change in the touch_end event and have the action in state_entry of the next state. The fact the lindens assigned someone to this bug should also show this is not "resolved" and is a bug they introduced. Well, of course there are good reasons to collect touch data in another state. And there are of course many good examples for that, like when starting HTTP transport to external internet storage that is driven by user interaction. At this point you might want to stop some of the events in on_exit(){;} of the original state and still get the data from the user interaction in the next state where the actual HTTP transport is initiated and solved. Of course we can start copying all data to lots of global variables and process them later from the next state, which is not the very best choice along with the script limitations as well as from getting all the messy coding style this way.
The concept of having no blocking calls on asynchronous calls on HTTP transport, XML-RPC and so on and getting all responses by events makes it very useful to have states with it, so we do not turn on and off event registering all the time. So what we have as a language concept is quite good. What is not so good in the LSL language concept right now is, that some events are registered implicit/silently to become fired and some explicit by registering for them by API calls. This turns out to be a pitfall for many believing they can write code in a way just as if they had all of API just as blocking calls at hand. In fact some registered events are atm not preserved with state transitions, which is somewhat breaking with the very own concept of LSL and creating confusion how to benefit from states and state changes to make good use of LSL and how to better do not perhaps. I do realize some of the LSL does not work as intended right now, but to remove more and more of state preserved events from LSL makes things even worse, since we all will have to start collecting lots of data before changing states, creating additional load on the servers / VMs. This is not a good choice. To solve your example in the first place it is very simple to either use touch_end(){;} for the state transition or to write a touch_end(){;} within the next state to make you get exactly what you wanted and expected. And if you had understood what and how event chains work you might have already tried the code below and already found out how to do. /// example /// default { state_entry() { // some initialization code } touch_start(integer cnt) { llOwnerSay("mouse button clicked"); state running; } } state running { state_entry() { // some initialization code } touch_end(integer cnt) { llOwnerSay("Mouse button released."); state default; } } /// END /// I just checked the example above and it works as intended. What else to say about that? Well, with a silently event consuming modell there would not have be a touch_end(){;} in state "running", since every time there is some event handler missing, the VM would replace it with a default handler that does nothing, but consuming the unhandled event silently. In fact our by hand defined event handlers at this point would be just kind of overloading the silent ones of the VM. But we do not have that as it seems and it's not clear for all cases if it would be a good idea. I am not absolutely sure about this, but perhaps this might even cause some issues with slow asynchronous calls that would not allow state transitions any more because of this as long as a HTTP request or XML-RPC is not completed within the same state it has been started? I couldn't tell, since as long as it is not part of the VM, there is no way to test that. And I agree with you, it's of course not a good idea to have just one on_touch(){;}, but not to preserve touch events across states is almost the same thing, apart from still being able to have trivial stuff like blowing horns until the mouse button is released again. It seems that the question is being bypassed here. Could the touch_end be used? Yes, it could. However, as pointed out above, there is the difficulty of what happens when someone holds the mouse button (similar to the difficulty of using the touch event). It does make sense to trigger an action when an avatar first clicks on the button/object, not when they stop doing so. Thus, without getting side-tracked with questions of touch events being carried across states, it is perfectly acceptable to expect that the touch_start event would be triggered when an avatar starts touching. Isn't that what the name "touch_start" implies?
So if the script drops the first touch, then touch_start is not working properly. It's that simple. Whether or not I COULD choose to use touch_end instead is beside the point. That would be a possible work-around for the issue, but does not answer why touch_start couldn't be used in the way desired. Simply stated: If I use a touch_start, and if the script happens to transfer to another state (as a result of that event or another), and subsequently returns to the state in which touches are detected, then the script should detect a touch when it occurs. The touch_start event is not working properly in that regard, because it fails to be triggered on the first touch. That is a bug. @Jord: I can see what you're saying, but as far as I know, there is no publically-visible documentation from LL indicating that either the old behavior or this new behavior is the correct or intended one. In the absence of that documentation, the only standard is past behavior. And a sudden, unannounced change from past behavior almost always indicates a bug.
So, while the new behavior could be argued to be cleaner or more logical, it's not the correct (i.e. established and expected) behavior for LSL. Most likely it was a simple oversight during the transition to Mono, but no one can know for certain without seeing the source or LL's documentation. This is what Peri said, yesterday at the office hour:
[2009/03/20 15:09] Periapse Linden: The problem is that we had never really defined how touch events and scrripts are supposed to interact. [2009/03/20 15:17] Periapse Linden: 1. Mouse down on an object creates a touch_start and a touch event. Jord, you still never explained: if this is how an X_start chain event should work, why does collision_start not require a collision_end to clear it? And why did the behavior of touch_start change from it's previous behavior after a server update if this isn't a bug? As moons post states, they need to fix this to "preserve existing content".
I also fail to see how any 'large about of data' would have to be stored as a global if this was reverted back to it's past behavior, which matches collision_start behavior. You didn't supply any code or examples that would back up this claim of data issues across states. What could you possibly save or gather in the next states touch_end? A detected_name or key? My example shows that yes a detected_name or key has to be global but that is ONE variable! I just don't see where this "make many start coping even more data by hand across states" comes from. Especially the "start" part as it never worked like this until recently! Using touch_end does NOT give the same response as touch_start and they can't be used interchangeably. And sorry if you feel my example is "trivial" but try to remember this is a game! I applaud LL for making LSL simple enough to understand that normal "players" can write scripts without needing a degree in computer science. If the above isn't how other languages work, it really doesn't matter to me. RE: Jord Aeghin, "...It's actually NOT a bug!"
I would say that it is [a bug]. silly.lslborderStyle=solid default { touch_start ( integer num ) { llOwnerSay( "hello!" ); } } ... will happily say "hello!" every time its touched. (Shhh. It's not a game.) @Jord: In one of your posts above you said:
"...since one might explicitly want to perform state transition from touch_start(){;} and solve the touch_end(){;} in another state, which is also the only reason to have those two of touch events at all!" "If this is getting fixed the way it is requested by the original poster, one of touch_start(){;} and touch_end(){;} events could also be removed, since to have both of of those events becomes almost pointless then!" "So, this is NOT a bug as long as we have those two events the way they are working right now and any else would be a bug instead or at least useless overhead in the VM and could be entirely replaced by some "on_touch(){;}" event." That always used to work if touch_start triggers state change and the new state has both a touch and a touch_end event. I know there would be ways to improve how LSL works but when we begin to change the language to the extent you suggest we will break content and that is a no no. So the only way to deal with this is to restore the old functionality since it is expected behavior and doesn't break anythign since it has always been working like that. [edit for spelling] I want to echo Jord's comments, that (paraphrasing) purging the event queue on a state transition is inconsistent with the state machine concept. This issue has been discussed in SVC-2297 and others.
State machines are an excellent way to model real-time event-driven systems like SL, and in the real world, they are used extensively (in one form or another) to develop these types of systems. Clearing the event queue between states discourages designs from using more than one state, which ironically undermines LSL as a state-based programming language. It really leads script writers down the wrong path, creating monolithic scripts with many global variables and "if" statements, as well as creating kludgy implementations trying to work around inconsistent treatments of events across state changes (e.g., timers). Of course at this stage backwards compatibility is essential, so some sort of option setting or function call should be available to not clear the event queue. I strongly feel LL should really re-examine this issue going forward. Neither of you have show an example of how leaving this as is was saves "many global variables" or less "if statements". If you don't want the touch cue cleared (or listens removed etc) don't change states.
Also, as far as inconsistent treatment of events across states, collision_start still behaves the same way as touch_start used to. I see no reason to have a script ignore a touch_start event, like is happening, just waiting for a touch_end CALL (that may or may not be there) for the script to respond to the next touch_start. The fact this doesn't happen UNLESS you change states is showing that something is clearly broken. I don't get what purpose that serves other than forcing people to make a useless touch_end call just to work around this new problem. If they wanted to implement that touch_end could respond in the next state, that at least wouldn't break in world content. BTW Biff, the "problem" you pointed to has 3 votes, this one has 30! There's a LOT of content that worked perfectly before this bug surfaced, and that now is erratic in processing various events. I have seen this on the touch_start event, where code has been working perfectly for a year or more, and is now broken by this bug. I have also seen it on the moving_end() event, where with no pattern at all, the event may or may not trigger.
If a touch_start, or a touch_end, or a moving_start, or a moving_end is what you are trying to detect, you should NOT have to add dummy code for the opposing state to make the code work! moving_end (and moving_start) is almost certainly an unrelated issue, and is just plain, unpredictably broken and has been so forever: SVC-1004
I'm getting this too, to solve it just use touch_end till LL will make it work with touch_start.
no issue, you must use touch_end along with touch_start
default touch_start(integer A) { llSay(0, "Moving to another state."); state another; }touch_end(integer A) } state another touch_start(integer A) { llSay(0, "Moving to another state."); state default; }touch_end(integer A) state_exit() { llOwnerSay("Going to default"); }} no issue, you must use touch_end along with touch_start
If there's again confusion about this being expected behavior, please see the related SVR-1039 (linked above) for just how deeply screwed-up this is: even after llResetScript() called from within a state without a touch handler, the first touch_start event is suppressed in the default state.
Can people PLEASE stop trying to claim this is "expected behavior" when the other event handlers don't behave this way and this problem STARTED happening after a server update. This has broken a BUNCH of in world content as a result.
Here's another case, this time without the use of state-changes:
-Create a cube, take it, wear it, and add this script: default
{
state_entry()
{
llRequestPermissions(llGetOwner(), PERMISSION_ATTACH);
}
touch_start(integer dummy)
{
llDetachFromAvatar();
}
}
-Touch the cube by left-clicking. Observe: The server drops a touch, for the same reason as with state-changes: If you left-click very short, this bug does not occur |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||