How do I create a HINT button for my game?

Get help using Construct 2

Post » Wed Nov 11, 2015 8:59 pm

Hello,

I need some smart guy to help me with something. I have a game based on images and words.
This is the .CAPX : 1Pic_1Word.capx
All I want is to create a "Hint" button... When you press this button, a random letter will appear.
I tried so many times, but I always fail.

Is there anyone who can help me please?
Thank you!
B
7
Posts: 35
Reputation: 307

Post » Wed Nov 11, 2015 10:03 pm

I don't see a hint button in your capx?
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 » Wed Nov 11, 2015 10:13 pm

All I want is to create a "Hint" button...


I want to create that button.. Is that possible?
B
7
Posts: 35
Reputation: 307

Post » Wed Nov 11, 2015 11:25 pm

Yes.. should be entirely possible..

You know what the answer should be so, creating actions to put one of the letters on the right spot shouldn't be that hard..
Should consist of something like picking a random instance in the answer creating the right letter at that spot and picking an instance of the letters at the bottom and destroy it..
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 » Wed Nov 11, 2015 11:42 pm

It's not so easy.. if it gives you let's say.. second letter... when you add the first letter... the next one should go automatically to the 3rd place... do you understand what I'm saying?

Easy to say.. hard to apply :(
I think at this for like 2 days. :|
B
7
Posts: 35
Reputation: 307

Post » Thu Nov 12, 2015 7:35 am

http://www.blackhornettechnologies.com/ ... d_BHT.capx
I've made a few changes to the game play.
1) I added a global for the TimerPeriod multiplier. I've set it to 2 for the moment, to give time to debug. Set it to 0.5 to match what you had before.
2) Two new instance variables on Letter_Holders: AnswerLetter and Done. AnswerLetter is set the the expected letter in that position. Done is when that position has been filled.
3) Hint button added. When pressed, it picks the visible Letter_Holders, then the ones where Done=0, then picks a random one of those. Configures the necessary values, then picks the the appropriate Keys that match the selected letter and hides that Keys.
4) BuildPlayerAnswer function is called when any letter is placed, and rebuilds the Player_Answer based on the consecutive Letter_Holder 'Done' flags.

There's still some cleanup, but this gets you most of the way there.
ImageImageImage
B
71
S
21
G
220
Posts: 3,648
Reputation: 123,725

Post » Thu Nov 12, 2015 8:21 am

@blackhornet, Thank you sir! Really, you make my day!

There are still 1 problem: You can place random letters because the answer is correct.

I mean let's say it.s a SHEEP picture. You can write RWIDS and it's correct. You can place letters wherever you want and is still correct.

Thank you again sir, for helping me!
B
7
Posts: 35
Reputation: 307

Post » Thu Nov 12, 2015 8:32 am

rollyzz wrote:@blackhornet, Thank you sir! Really, you make my day!

There are still 1 problem: You can place random letters because the answer is correct.

I mean let's say it.s a SHEEP picture. You can write RWIDS and it's correct. You can place letters wherever you want and is still correct.

Thank you again sir, for helping me!


Blackhornet has virtually done all this for you.

Have you tried to understand what he has done and attempted to amend it yourself?

If you don't start understanding what he's done for you then you will only encounter more problems and always be reliant on others to do the work for you.

If you try and fail, then fair enough. You can upload your failed attempt and we can then see how to guide you to better understanding, rather than just doing it for you.

If you have no interest in learning how to use C2 then fair enough. I just like to think people want to learn, but it's not always the case :)
If your vision so exceeds your ability, then look to something closer.
Moderator
B
131
S
29
G
81
Posts: 5,328
Reputation: 56,630

Post » Thu Nov 12, 2015 9:07 am

@zenox98, It's not that sir! I want to learn, but this example is just to complex for me!
I tried to understand many times, but I failed. At this moment I was trying to delete some useless objects, just to make the source more 'understandable'.
This is too complex for my knowledge, but I look forward and I will try to understand.
B
7
Posts: 35
Reputation: 307

Post » Thu Nov 12, 2015 9:22 am

I have The same Problem as you have. I have made a ''Spot the differences'' game, but i cant seem to find a valid solution to the hint button. I mean the answer is there but it's just to complex. Maybe if someone cant find a simpler solution. Oh, and thank you for this solution.
B
5
Posts: 4
Reputation: 240

Next

Return to How do I....?

Who is online

Users browsing this forum: ramyaswetha and 5 guests