Drag Drop Activate bug (?)

For questions about using Classic.

Post » Sun May 29, 2011 6:15 am

So I have a bunch of units (sprites) in a board-game type of setup. There are two phases. In one phase, I click on the units and give them orders. In another phase I enable drag and drop behavior (deactivated in phase 1) to issue moves.

The problem is, when I activate the drag and drop behavior, the units I clicked previously seem to enter "Being dragged" phase even though I use a Button to change between phases, and even though my mouse button is not, in fact, being held down. I can attach a cap but it's pretty confusing, so if any ideas come ot mind quickly let me know. Thanks :)
B
11
S
2
G
3
Posts: 283
Reputation: 1,968

Post » Sun May 29, 2011 12:52 pm

Confirmed, there's a bug with deactivate.
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Mon May 30, 2011 6:18 am

Another drag and drop issue (which may not be a bug)

I have this code:

[code:3dztzwo3]On Click Object1 --> Enable Group 1

===Group 1=== (Deactivate by default)
Is Var1 Equal to 1
+[Invert] Left mouse button is down --> Set Var 1 = 0

Is Var 1 Equal to 0
+On Drop Object1 --> Do stuff[/code:3dztzwo3]

It appears that the first click on Object1 (the one that activates group 1) once in a while triggers the On Drop condition. It seems like it shouldn't since the left mouse button has to not be down before we get to that subevent. And yet, once in a while it seems to do it. Any ideas why?
B
11
S
2
G
3
Posts: 283
Reputation: 1,968

Post » Mon May 30, 2011 6:42 am

And if I replace the Invert Left Mouse button is down with On Left mouse button released, then the first click always triggers the On Drop condition. If i add a delay of 150 ms prior to setting Var 1 to 0, then it seems to work, though it is possible that the delay just makes the occurance more rare. Any idea what's going on? Seems like maybe there's a timing issue with the mouse / keyboard object perhaps? Or maybe I'm doing something wrong.
B
11
S
2
G
3
Posts: 283
Reputation: 1,968

Post » Mon May 30, 2011 7:22 am

Huh, it's getting weirder now. I also have an Is Dragging condition under the Is Var1 Equal to 0, but that does not activate, only the On Drop does. Now I'm really confused since if one is activating so should the other (they're under the same conditions, and you need to be dragging before you drop).
B
11
S
2
G
3
Posts: 283
Reputation: 1,968

Post » Thu Jun 02, 2011 10:47 am

Triggers are "triggered" when they occur regardless of their position in the event sheet. That may be what's going on. I don't know if you were able to find a workaround but here is one that may be of use. The box is selected on the first attempted drag then it can be dragged with any following drags.
http://dl.dropbox.com/u/5426011/examples5/dragdrop.cap
made in cc1.2
B
79
S
24
G
54
Posts: 4,749
Reputation: 40,761


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests