Typing/Recognizing Cheats?

Get help using Construct 2

Post » Mon Dec 03, 2012 2:31 am

Hey people!

I was trying to make something like this:
- The player hits ENTER
- types in password (ex: opossum)(the textbox will be hidden)
- hits ENTER again to confirm
- game does something

I found this tutorial but couldn't understand it at all.
http://www.scirra.com/tutorials/356/how-to-make-cheats-into-your-game/page-1

Can anyone help me with the text box and how it works?
For example when I set:
Global Variable - Cheat (Initial value -1)
On ENTER pressed >>> set Cheat*(-1)
Cheat 1 >>> set Textbox focus
Cheat -1 >>> set Textbox Disable

When I press ENTER first, i can type in the text box, but after I press ENTER again it doesn't disable it. It works with F10 but not with ENTER for some reason.
B
6
S
1
Posts: 32
Reputation: 789

Post » Mon Dec 03, 2012 9:47 am

There's a similar way you can make a toggle switch:

+on enter pressed
     >set Cheat to 1-Cheat

This will make Cheat flip between 1 and 0 on every press

Anyway, that tutorial wasn't really clear at all.. so I made a cap, it also checks to see if the typed word matches any of the cheat words.

link
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Mon Dec 03, 2012 2:13 pm

Thank you very much keepee for the prompt and informative reply. I need to learn some of the stuff used in the eventsheet though :D
works great, thanks again!
B
6
S
1
Posts: 32
Reputation: 789

Post » Mon Dec 03, 2012 3:44 pm

no worries
you can read up about repeat loops, and token() expressions in the manual. They'll explain it better than me
B
28
S
8
G
1
Posts: 469
Reputation: 4,683


Return to How do I....?

Who is online

Users browsing this forum: spacedoubt and 2 guests