Why is my touch control not showing up?

Get help using Construct 2

Post » Wed Apr 17, 2013 11:11 am

I've decided to finally release my .capx because this is driving me insane.

I took the working example from here, changed the sprites to my own, ran the example with my sprites to confirm that things worked, then copied and pasted them over into my project and... the analog joystick that is supposed to appear on screen never shows up.

Can someone help me? This is the second day I have been trying to solve this and so far still no luck.



Icarus.capxExcal2013-04-17 12:57:01
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Wed Apr 17, 2013 12:51 pm

if nobody take a look before me, I'll help you on the evening.
ImageImageImageImageImageImage
B
92
S
19
G
12
Posts: 1,192
Reputation: 18,276

Post » Wed Apr 17, 2013 12:57 pm

Thank you! :)
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Wed Apr 17, 2013 2:25 pm

@Excal

Good debugging skills can go a long way.

First I wanted to make sure the stick and pad instances actually existed, so I set the debug text to show me the counts of both the "fanaPad" and "fanaStick" object. I saw that there were no instances of either object being created, even when the player touches the screen, so I added create actions upon touching the "Lefthalf" object.

Now I could see the objects created when I touched them, but the stick wasn't moving with my touch. You calculate the stick's position when player is in touch, and the LeftTouchID variable is greater than or equal to zero. So then I set the debug text to LeftTouchID, and saw that it never changed from -1. I looked at the code and saw that you have LeftTouchID as a local variable set to -1. Since the local variable wasn't set to static, it was being reset to -1 every tick, and the stick's movement calculations weren't firing. I changed the LeftTouchID local variable to static, and things seemed to work fine.

zatyka2013-04-17 15:09:21
B
44
S
13
G
7
Posts: 338
Reputation: 10,379

Post » Wed Apr 17, 2013 9:56 pm

Thank you so much. This helped immensely.
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Wed Apr 17, 2013 10:13 pm

also, I organize my projects with many eventsheets, and include them all on a Main eventsheet.

This is how I like to debug, the text here is mutated on purpose, I like to check if it's going well on Live, what layer the object is, because sometimes We do mistakes like you did, and it make easy to debug.

I was ready to make it for you, including my personal debug system on your file, to show you how it can help you in future.

Your problem is already solved?







[TUBE]http://www.youtube.com/watch?v=pJFQftlOdH0[/TUBE]
[TUBE]http://www.youtube.com/watch?v=AzlQhu9Dud4[/TUBE]TELLES08082013-04-17 22:32:46
ImageImageImageImageImageImage
B
92
S
19
G
12
Posts: 1,192
Reputation: 18,276

Post » Wed Apr 17, 2013 11:04 pm

hi. i guess this is going to be a mobile platform game, isn't it?
i'm working on a mobile platform game with joysticks too. in my case there are 4 players on the screen which are each controlled by the appropriate joystick. i chose another version of creakting touch input joysticks. (i could send you a capx tomorrow). my problem is: everything seems to work quite well until i test the game with cocoonJS launcher on my iPad. the joysticks sometimes start jiggling and shaking. i am just not confident with the result of the touch input.
have you tested yours yet? is it working fine?
B
23
S
6
G
5
Posts: 132
Reputation: 4,487

Post » Wed Apr 17, 2013 11:18 pm

Wow, this thread has exploded! Thank you everyone for your amazing help and great insight.

[QUOTE=philx]hi. i guess this is going to be a mobile platform game, isn't it?[/QUOTE]

I actually intend to port it to iOS, but I won't discard the possibility of it being playable on a browser. I'm also entering it into the Newgrounds Construct 2 Touch Game Jam, so I absolutely have to have the game working with touch controls and decent FPS on various mobile devices.

[QUOTE=philx]have you tested yours yet? is it working fine?[/QUOTE]

On CocoonJS? Not quite yet. After the game jam, I intend on turning the game into an iOS space shooter with a story (ironic statement, I know, but I'm working with some writers lol). It saddens me to see that there could be issues with touch controls when exporting through CocoonJS.

I understand Scirra develops Construct 2 as an HTML5 Game Engine, but if there are issues with porting to other platforms, that hurts the commercial viability of games created with their engine, which can turn people off if news gets around.

[QUOTE=TELLES0808]also, I organize my projects with many eventsheets, and include them all on a Main eventsheet.[/QUOTE]

I actually don't know how to include event sheets on another event sheet. I checked the manual, but maybe I'm just bad at finding where to do this.

[QUOTE=TELLES0808]I was ready to make it for you, including my personal debug system on your file, to show you how it can help you in future.[/QUOTE]

You don't need to do that, especially since I've modified the events after the changes to fix my touch control issue. I think it would be more helpful if you gave an overview of how you do it and the reasoning behind it (possibly in another post somewhere?). I've only recently begun reorganizing my event sheets. Originally, this project was around 400 for its current state - right now I've trimmed it down to 313.

[QUOTE=TELLES0808]Your problem is already solved?[/QUOTE]

Not quite, at least not multitouch.

You can try it here: http://exeneva.com/html5/Icarus

You'll notice that single touch is working fine, multitouch is having issues. So right now you can't fire and move at the same time.Excal2013-04-17 23:31:53
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Wed Apr 17, 2013 11:39 pm

To include an eventsheet, simple click on the "Add Include" button, inside the Events Menu, on the top left of your screen.
ImageImageImageImageImageImage
B
92
S
19
G
12
Posts: 1,192
Reputation: 18,276

Post » Wed Apr 17, 2013 11:41 pm

Thanks. I wonder if that's in the manual somewhere...

I've added debug counters to my gameplay link above.

Apparently if LeftTouchID = 0, when the user touches the right side of the screen, RightTouchID = 0, causing both touches to have the same ID. Is this a bug?
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Next

Return to How do I....?

Who is online

Users browsing this forum: blackhornet and 5 guests