How do I stop controls?

Get help using Construct 2

Post » Mon Jun 15, 2015 12:52 am

I'm very new to Construct 2, and I'm running into a few problems. The biggest seems to be me trying to find a way to stop all other controls while an action is taking place. I have a rolling animation, but I want it so that you cannot change direction or jump or anything until it's over, as I can't seem to find anything that disables controls?

Thanks for taking the time to read :D
B
10
S
2
G
1
Posts: 36
Reputation: 707

Post » Mon Jun 15, 2015 1:13 am

mongoose665 wrote:I'm very new to Construct 2, and I'm running into a few problems. The biggest seems to be me trying to find a way to stop all other controls while an action is taking place. I have a rolling animation, but I want it so that you cannot change direction or jump or anything until it's over, as I can't seem to find anything that disables controls?

Thanks for taking the time to read :D


Simple mode... You can create a variable called "canMove" with value = 1... Then add to change direction controls (On press) AND (canMove=1) moves the character.

Then (On Press Key) to your animation that blocks the movement, canMove=0.

OBS: To add another condition for an event - RIGHT-CLICK it>add>add another condition>system>compare variable

You can improve this... Just an idea friend. bye! :D
B
56
S
16
G
3
Posts: 42
Reputation: 5,290

Post » Mon Jun 15, 2015 2:44 am

Simple mode... You can create a variable called "canMove" with value = 1... Then add to change direction controls (On press) AND (canMove=1) moves the character.

Then (On Press Key) to your animation that blocks the movement, canMove=0.

OBS: To add another condition for an event - RIGHT-CLICK it>add>add another condition>system>compare variable

You can improve this... Just an idea friend. bye! :D


Hey, thanks for responding! This is what I had in mind, unfortunately I can't seem to find the change direction controls for the character as seen here - [http://tinypic.com/view.php?pic=2qda7fq&s=8#.VX47UvlVhBc]
The current controls are copied from Scirra's tutorial on making a platformer, so I don't really know how to alter them into usable keyboard controls to place the CanMove variable on them?
B
10
S
2
G
1
Posts: 36
Reputation: 707

Post » Mon Jun 15, 2015 9:51 am

there is an action "set ignoring input", which might be of use here?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Jun 15, 2015 12:26 pm

Message: mongoose665 is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
LittleStain wrote:there is an action "set ignoring input", which might be of use here?


Thank you :D . I tried implementing it but it doesn't seem to work. Basically what I need it for is I'm adding acceleration via custommovement when a certain attack animation happens, this makes them fly forward. But if I happen to press in the opposite direction mid attack, the character acceleration continues even after the animation, making my character slide off in one direction.

Here's what I've got for the attack, with the implementation of set ignoring input seemingly doing nothing:
B
10
S
2
G
1
Posts: 36
Reputation: 707

Post » Mon Jun 15, 2015 9:16 pm

mongoose665 wrote:
Simple mode... You can create a variable called "canMove" with value = 1... Then add to change direction controls (On press) AND (canMove=1) moves the character.

Then (On Press Key) to your animation that blocks the movement, canMove=0.

OBS: To add another condition for an event - RIGHT-CLICK it>add>add another condition>system>compare variable

You can improve this... Just an idea friend. bye! :D


Hey, thanks for responding! This is what I had in mind, unfortunately I can't seem to find the change direction controls for the character as seen here - [http://tinypic.com/view.php?pic=2qda7fq&s=8#.VX47UvlVhBc]
The current controls are copied from Scirra's tutorial on making a platformer, so I don't really know how to alter them into usable keyboard controls to place the CanMove variable on them?


Here my friend http://i.imgur.com/YUhCXnZ.png?1 a solution for you... I've made right now and worked like a charm, maybe this can help you!

and the .capx https://mega.co.nz/#!ORkkBQQa!RC8DAzNmhIX9wHx_IHqnYMeVzRPLepZa-WhQKmqzrcw
B
56
S
16
G
3
Posts: 42
Reputation: 5,290

Post » Mon Jun 15, 2015 10:18 pm

Message: mongoose665 is not yet permitted to post plain text URLS (300 rep required). 3 URLS removed. Why?
Here my friend a solution for you... I've made right now and worked like a charm, maybe this can help you!

and the .capx


Hey, thanks for that, it has helped a bit. If you can open my project, there's a copy here- The whole reason I'm trying to do this is because if you use the A attack in game and move side to side with the arrow keys, the whole sprite continues to accelerate, even though it should come to a stand still when the animation ends... I've tried everything, setting speed to 0, acceleration to 0 at end of animation etc...
B
10
S
2
G
1
Posts: 36
Reputation: 707

Post » Mon Jun 15, 2015 11:12 pm

You can add all your control input events into a group and then disable/enable the group based on whatever conditions you want.
So you can have a group called "Controls" which will have all your control events in it, then have something like 'Ball - animation rolling playing ----- System - Set group "Controls" deactivated'. Then do the opposite to reactivate. 'Ball - animation rolling stopped ----- System - Set group "Controls" activated'.

I hope that works for you!
Be sure to check out my Metroidvania game, A Hole in the Earth
B
59
S
24
G
3
Posts: 359
Reputation: 5,683

Post » Mon Jun 15, 2015 11:40 pm

mongoose665 wrote:
Here my friend a solution for you... I've made right now and worked like a charm, maybe this can help you!

and the .capx


Hey, thanks for that, it has helped a bit. If you can open my project, there's a copy here- The whole reason I'm trying to do this is because if you use the A attack in game and move side to side with the arrow keys, the whole sprite continues to accelerate, even though it should come to a stand still when the animation ends... I've tried everything, setting speed to 0, acceleration to 0 at end of animation etc...


Hey friend, you can't put URL's in here because you're new... Try to break the link like site(.)com
B
56
S
16
G
3
Posts: 42
Reputation: 5,290

Post » Tue Jun 16, 2015 2:03 pm


Hey friend, you can't put URL's in here because you're new... Try to break the link like site(.)com


mega(dot)co(dot)nz/#!PQ0DyIpT!FtEEl8VR0-dXtLPCxmC03xTXjWEiVBMJ0aUL8tWV_Wo

Hopefully that works, thanks!
B
10
S
2
G
1
Posts: 36
Reputation: 707


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 19 guests