How do I make the same button perform events sequentially?

Get help using Construct 2

Post » Sun Sep 06, 2015 8:51 pm

I'm trying to get my controller to perform a series of steps sequentially (move around to select __________, press X, perform the next selection, press X, etc).

Basically I'm trying to make a menu that does the following:

Step 1 - Select element in group of objects by pressing up or down. Move on by pressing X.
Step 2 - Select second element in group of objects by pressing up or down. Move on by pressing X.
and so on until all elements are selected.

The problem is that after step 1, when i press X all 5 steps are selected instantaneously. For consistency i want to make it so that X is the button the player presses to move on, and I've tried several avenues to solve this problem, but they all seem to fall flat. I also figured this would be an easily solvable problem, but for some reason (maybe the wording of my searches) I'm having trouble finding the solution.

Does anyone know how to solve this issue?
B
10
S
2
Posts: 36
Reputation: 1,274

Post » Sun Sep 06, 2015 8:59 pm

Simple and fast way to do that would be to add a global variable that will save current state.

on pressing X - add 1 to "state" variable

Then you will only need to set "states" for the selections

state = 0 - > Select element in group of objects by pressing up or down
state = 1 -> Select second element in group of objects by pressing up or down
state = 3 -> etc
ImageImageImageImage
B
157
S
66
G
42
Posts: 2,603
Reputation: 35,343

Post » Sun Sep 06, 2015 9:01 pm

Ok thank you I will try this
B
10
S
2
Posts: 36
Reputation: 1,274

Post » Sun Sep 06, 2015 9:04 pm

Or you can do it using groups instead of variables.

Group 0, Group 1, Group 2...etc (any name will work). and then after pressing X simply deactivate/activate groups with events you want to run.
ImageImageImageImage
B
157
S
66
G
42
Posts: 2,603
Reputation: 35,343

Post » Sun Sep 06, 2015 11:51 pm

Tried the first suggestion, its doing the same thing (instantly at the last group from pressing x button)
Going to try the second suggestion.
B
10
S
2
Posts: 36
Reputation: 1,274

Post » Mon Sep 07, 2015 12:01 am

Can you post a file or at least screenshot of your events?
This is actually quite easy to do, so I guess you might be doing something wrong.
ImageImageImageImage
B
157
S
66
G
42
Posts: 2,603
Reputation: 35,343

Post » Mon Sep 07, 2015 12:06 am

Very crude example.
Everytime when you press key "X" it will switch the state and same time make Sprite do different things (only once)

Image
ImageImageImageImage
B
157
S
66
G
42
Posts: 2,603
Reputation: 35,343

Post » Mon Sep 07, 2015 12:13 am

*Facepalm* I dont have the *trigger once* element in there. Ugh!

Edit*: I used it before, but it didnt work when i used it before so i messed up somewhere
B
10
S
2
Posts: 36
Reputation: 1,274

Post » Mon Sep 07, 2015 12:17 am

Ok I used it, and i'm thinking that its the way i arranged things that is messing everything up.
B
10
S
2
Posts: 36
Reputation: 1,274

Post » Mon Sep 07, 2015 12:32 am

Ok, i now know the problem. Unless I put the "Trigger once" under the pressing of the button, it registers as me continuously pressing it, causing the count to go up to 20+ in one button press. O.O
B
10
S
2
Posts: 36
Reputation: 1,274

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 25 guests