Condition with order

Get help using Construct 2

Post » Tue Jan 27, 2015 3:39 pm

Glad to help. The mechanism is simple - as you see every "good" action moves our progress forward, every "bad" (else) actions drops it down to 0. If we have repeatable "good" actions then we need to first check if a previous "good" action has taken place, then figure out if we are in the right order.

You just need to plan out the actions and you are good to go.
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Wed Jan 28, 2015 6:19 pm

@Hunter
I don't know if you still need updated example with family implemented from last capx I gave you, but anyway here it is:
You do not have the required permissions to view the files attached to this post.
ImageImage
B
102
S
45
G
22
Posts: 772
Reputation: 21,493

Post » Sat Jan 31, 2015 5:03 pm

@alextro Thank you very much alextro, your exemple with family is very useful i will use it in some puzzle for my game =)

@somebody i tested another condition with 4 click, it works fine, but when i try to add more clicks it doesn't work, for exemple here is my capx for 6 click, i follow the same procedure but i think i forget something

https://dl.dropboxusercontent.com/u/138507172/Puzzle_6_click.capx
B
4
S
1
Posts: 40
Reputation: 532

Post » Sat Jan 31, 2015 6:20 pm

Hey, Hunter - you should use debug to find a problem point, like this (use Debug Layout):

Image

We see that first of all, since there are both those events one after another the pp value gets set to 2 right away - you might need some kind of an extra variable there. And then it gets set to 0 on next click so there's some problem in that event.

Now that you know how to better find these problem points you should manage the rest.
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Sat Jan 31, 2015 6:37 pm

I gave your problem a shot. Take a look at my capx.
All you have to do to add more keys is add the new sprite to the Keys family and set the ID variable to the key name. Then in the events add to the array index the puzzle combination you want and increase the size of the array. Let me know if you have an issue with any of that.
If you just want to keep using the same three keys then all you have to so is change the puzzle combination in the events page. Just add to the array.
Check it out.
You do not have the required permissions to view the files attached to this post.
B
33
S
8
G
2
Posts: 100
Reputation: 2,635

Post » Sat Jan 31, 2015 6:49 pm

@thatserafimkid - nice, elegant solution. Certainly a good choice for longer puzzles or if there are many more planned.
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Sat Jan 31, 2015 6:55 pm

@Somebody
Thanks, I figured eventually he would want to do expert mode and have a whole keyboard set. LOL

@Hunter
I updated your puzzle one step further and made the puzzle text display what was in the array. So instead of changing the text to match the puzzle you create in the array it will do it for you.
Alternatively with this method you can set the puzzle to be generated randomly. Shouldn't be to hard. I'll let you figure that one out if that's something you'ld like to do
You do not have the required permissions to view the files attached to this post.
B
33
S
8
G
2
Posts: 100
Reputation: 2,635

Post » Sat Jan 31, 2015 6:58 pm

thatserafimkid wrote:@Somebody
Thanks, I figured eventually he would want to do expert mode and have a whole keyboard set. LOL


"Play this symphony to continue!" :D
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Sat Jan 31, 2015 7:27 pm

Thank you thatserafimkid and somebody for your help, but i'm afraid i have no idea how to use array ^^' for the moment i will use somebody's logic on variables, i think i understand his method, i use debug too to understand what's going on, i use the debug on 2 click in one key with 2 variables, but i didn't succeed, here is my capx :

https://dl.dropboxusercontent.com/u/138507172/puzzle_2_click.capx


if i just knew how to put 2 clicks in one key, it will be great

the puzzle is C+C =)
B
4
S
1
Posts: 40
Reputation: 532

Post » Sat Jan 31, 2015 7:43 pm

@Hunter
In my example if you want to just keep the three keys you already have all you have to change is the combination in the start of lay out event.
It'll be easier for you in the long run.

Image

just change this code.
if you only want two keys in the puzzle just have the top two. And change the value to whatever letter you want in the puzzle.

So if you wanted C+C the code would be this:
Image

Then all you have to do is select the array object and on the right properties menu you change the width of the array to equal how many keys in you puzzle.
Image
B
33
S
8
G
2
Posts: 100
Reputation: 2,635

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 3 guests

cron