How do I disable platform input buttons?

Get help using Construct 2

Post » Sun Nov 09, 2014 10:41 am

I have a character object with platform behavior. Player has an attack where it jumps in the air and stays in air for a bit. I want to disable the functioning of the arrow keys (button for directional movement) while I am in the air.

I tried "Platfrom: Start Ignoring Input" and it's not disabling the arrow keys. How do I disable the keys?
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Sun Nov 09, 2014 12:14 pm

....
You do not have the required permissions to view the files attached to this post.
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Sun Nov 09, 2014 1:30 pm

@korbaach

Hi. thanks for the file, but it doesn't work on my game because I have no events that has conditions based on pressing the directions (arrows). My platform object has the default controls as "yes".

Attack:
The player (platform char) jumps up, then I press X, player stops falling down and uses attack animation, then after animation finishes, goes back down to ground.

The bug (originally explained) happens during when I press left or right arrow during the attack animation while in air, the player gets stuck there forever and never goes down to ground.
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Sun Nov 09, 2014 2:19 pm

attack animation is playing....set platform behavior Disabled
Else...set platform behavior Enabled ???
You do not have the required permissions to view the files attached to this post.
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Sun Nov 09, 2014 2:58 pm

@korbaach

thanks again. I have seen your file but I haven't tried it on my file yet.

https://www.scirra.com/manual/100/platform

I'm not sure why the "Platform: Start ignoring input" is not working as described there in the manual. That (disabling the arrow keys, while letting the platform object still able to free fall) is exactly what I needed. I tried "Platform: set disable" but it's not working like I intended.

Also, why does your file takes literally less than a second to load on preview? mine takes like 45 secs at the very least to load everytime.
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Sun Nov 09, 2014 3:31 pm

I do not know man, I'm afraid that without see your capx, I can't help you...
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Sun Nov 09, 2014 5:13 pm

@korbaach

Here is a simplified version of what I wanted to do. My original file is too complex (it has many complex systems for my game so I made this new file).

Hold pressing X in air will make the player go to attack animation. During this animation, pressing left or right won't have an effect.

In my original file, pressing left or right during attack in air gets it stuck in air forever.

In events, I use "Control" because I need it for my other systems. State and Gravity are also variables I used in my original file. They have other uses aside from how I used them in the file attached. Too many to explain and not related to the problem.

Long story short, it works perfectly here in my new file, still problems in old one. It's 1am here, I will look tomorrow again.
You do not have the required permissions to view the files attached to this post.
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Sun Nov 09, 2014 5:38 pm

Just put the player movement in a sub-event under player.attacking = 0.

Or put the movement events in a group that is disabled when the player is attacking, and enabled afterwards.
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770


Return to How do I....?

Who is online

Users browsing this forum: Cubeeo, YoHoho and 17 guests