How do I create a word database?

Get help using Construct 2

Post » Fri Aug 15, 2014 11:13 am

Hello fellow Construct 2 users, I've recently run into a couple of problems with an app I'm trying to make. The basic idea is that users can type text into a text-box and submit an answer. I'd like to know how to limit their text options down to a selection of words that I provide, like a word database. The idea is that they can only type the words that exist in the database. Any other words they may type that aren't in the database turn back to a blank text-box and aren't submitted.

Aside from this dilemma, I'd also like to know how to create a generator for 2 word databases once I've overcome the first problem stated. Basically, users can click a button and a random word from the database will appear on the screen for the player to view. This text doesn't have to be editable, it is read-only.

I'd really appreciate some help on this guys, it's driving me half-insane. Thank you.

Posts: 7
Reputation: 189

Post » Fri Aug 15, 2014 11:24 am

I think you should read up on how to use arrays..

After the person has pushed submit, loop through the array to see if the word exists..
filling the array could be done with the csv2array plugin..

This also answers your second question, for it would be easy to select a "random" word from the array and display it..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
Posts: 6,160
Reputation: 19,775

Post » Fri Aug 15, 2014 2:51 pm

Perfect, thanks for the advice friend. It's working beautifully.
Posts: 7
Reputation: 189

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 18 guests