<SOLVED> Force player to type correct text

Get help using Construct 2

Post » Mon Dec 16, 2013 11:55 am

Reverse engineering a capx with one event, while someone told you how to create the event above?

You are right, that's not being lazy..
There are other words for it though..

While typing in the event as shown above you'd have noticed after typing the dot behind textbox a menu pops up showing all the different things you can put behind the dot. This is actually true for every object you type the name in for. So if you ever need the height of an object in a "formula" object.height will do it for you.

Reverse engineering, while possibly usefull, isn't the same as programming. Programming is solving issues while building something. reverse engineering just shows the one possible solution to an issue someone decided to use. It could be very possible there are easier ways to solve the issue, but by reverse engineering you'll never learn those.

But if it works for you to ask people to do unnessecary work for you, that's fine..
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 Dec 16, 2013 12:06 pm

Like my Art-teacher once said:

You will never learn to paint like Van Gogh by reverse engineering his brush-strokes..

:)
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 Dec 16, 2013 12:07 pm

Valid points thanks for sharing
B
35
S
10
G
4
Posts: 250
Reputation: 7,908

Post » Mon Dec 16, 2013 6:18 pm

Honestly I think the one your using isn't very future ready. It's very locked to a set of words and requires additional Event for each word.

Instead you should use an Array and do a

====
Array.hasValue( trim( inputbox.text ) )
--> Do actions
====

However that would require either initiating an array on the game start by
Array.setX(0, word)

or using a dictionary and taking advantage of tokenate
so create a file with
happy, smile, sun, good, mom, dad, green,......

then use AJAX
===
On StartUp(do this for game start)
- ajax.load(dictionaryfile)

On AJAX LOAD
- repeat (tokenatecount(ajax.lastdata), ",")
-- array.push to back on X with value trim(ajax.lastdata(tokenate, loopindex, ","))

and there you go. An easy way to add LOTS of words without adding in any more events.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,013

Post » Mon Dec 16, 2013 10:57 pm

@jayderyu

Thanks for that idea, I haven't yet delved into Arrays but I will try now.
B
35
S
10
G
4
Posts: 250
Reputation: 7,908

Previous

Return to How do I....?

Who is online

Users browsing this forum: Clark Thy Lord and 2 guests