Mouse conrol bug

Bugs will be moved here once resolved.

Post » Fri Apr 18, 2014 12:00 pm

Problem Description
____ A concise description of your problem here ____

NOT WORK THE FOLLOWING RANGE:
MOUSE - ON KEYDOWN--CLICK (ALL DIRECTION EXEPT RIGHT) - SPRITE
- 1. SIMULATE CONTROL (ALL DIRECTION EXEPT RIGHT)
- 2.SET SPEED ( ANY NUMBER).

I have long sought to this on my simulator and using object Touch ( with Simulate control,of course).

When I replaced the Touch object by Mouse and Keyboard ( both, and separately) and created a new project for testing, then i found that the second action (set speed - px. per sec., the first action - direction - right, left,ect) - set speed work only in one direction - always in right direction, and sprite move only right directhion ignoring that i click on left ( and middle) buttom of mouse.


Attach a Capx
____ Upload a Capx to this post ____
control_bug.capx


Description of Capx
____ Concise description of what this CapX does ____ sprite goes in 4 direction by control mouse or keyboard

Steps to Reproduce Bug
  • Step 1click Run
  • Step 2 click on left button of mouse first or middle button mouse
  • Step 3 etc.
sprite allways move in right direction.
Observed Result
____ What happens? ____
but sprite goes to the right direction again with some vibration.

Expected Result
____ What do you expect to happen? ____
expected result - when i click on the lef to of mouse button - sprite must move to the left direction, when i click on the middle buttonof mouse - sprite must move to the up direction
Affected Browsers
    Chrome, Mazilla
  • Chrome: (YES/NO) YES
  • FireFox: (YES/NO)YES
  • Internet Explorer: (YES/NO)
No

Operating System and Service Pack
____ Your operating system and service pack ____
Windows 7 64 SP1
Construct 2 Version ID
____ Exact version ID of Construct 2 you're using ____
163r AND 167.2r(64-bit) ( same result)
You do not have the required permissions to view the files attached to this post.
B
16
S
4
G
1
Posts: 59
Reputation: 1,129

Post » Fri Apr 18, 2014 4:44 pm

I did not look at your .capx (because I'm using a stable release) however be aware that you should not use the mouse object when you are using the touch object actively together. I've found this can cause undesired results especially when using simulate control events .

In the cases where your game requires both, do the following to avoid conflicts:

Put all of the mouse conditions and events into a "Group" and call it "Mouse Group" for example and put all of your touch conditions and events into another group named "Touch Group". Then use the system object to create a condition "On Start of Layout" and create 2 sub events,

System > Is on mobile device > set group "Mouse Group" deactivate

System > Is on mobile device (x) > set group "Touch Group" deactivate

(x) meaning invert

This is should give you other ideas on how handle this and other situations.
This also saves memory because there is no listening for conditions not being used. You can group all keyboard events into another group and deactivate that group as well when on a mobile device to improve performance.

Also when using "simulate control" set the "use default control" in properties to no.

Hope this helps.
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,273

Post » Fri Apr 18, 2014 5:43 pm

Thank you for good advice, but there are not Touch object. I did one new clear project.
My real goal is have normally accaleration work for ball game on mob device. But it work very strange ( Touch-Simul. Cont.-8Direct).
Then i made that simple project with mouse ( keyboard work is right) - it does not work too.
B
16
S
4
G
1
Posts: 59
Reputation: 1,129

Post » Fri Apr 18, 2014 5:47 pm

This is happening because you don't understand how the 8 direction is working or how the mouse triggers are working.

1. Read the manual for both again.
2. A mouse trigger will happen only once per click event, which is incompatible with input controls for 8 dir.
3. Setting speed to 50 will set speed for the direction the object is facing, hence why always to the right and then slowing to a stop. Remove the speed 50 commands and change the click trigger to mouse button down and it will work properly. If you want to command a movement on a click then you need to use custom movement and set speed rather than 8 dir movement, which expects continual player input for control.
4. This should be in the "How Do I" rather than the bug section....
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
73
S
19
G
66
Posts: 2,198
Reputation: 42,188

Post » Fri Apr 18, 2014 6:34 pm

1.I have asked

/forum/viewtopic.php?f=147&t=101499
/forum/viewtopic.php?f=178&t=101603
but i did not got the answer for a problem

2....
3. I don't see things that you told me
/manual/114/mouse
4.. Setting speed to 50 will set speed for the direction the object is facing, hence why always to the right
i don't understand why really.
B
16
S
4
G
1
Posts: 59
Reputation: 1,129

Post » Fri Apr 18, 2014 8:22 pm

No probs - it's a steep learning curve getting used to how C2 manages its events and how objects can be controlled. The forums are really helpful places to air your problems, but if the answer can be found in a tutorial or in the manual then you might not get an answer....

I recommend that the best way to become familiar with it is to go through a few tutorials and have a look at the example capxs. Looking at how other people have managed things is also a great way to give you ideas. But the bottom line is to have hands-on experience with C2.
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
73
S
19
G
66
Posts: 2,198
Reputation: 42,188

Post » Thu Apr 24, 2014 12:05 pm

Closing as won't fix. 'Simulate control' does not have immediate effect: controls are only checked at the end of the event sheet. So when it then does the "Set speed to 50", the object is not moving or being controlled, and if you set the speed of a stopped object with no inputs it moves it at 0 degrees (to the right).
Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,240


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests