How do I Define letters within text?

Get help using Construct 2

Post » Mon Jun 12, 2017 1:00 pm

Hi

The game I am making effectively plays like this;

The user has 8 counters they must flip (by reading the word on it correctly) before the other person (who also 8 counters).

Once the person has flipped all counters they must choose a picture card which depicts something that starts with the same letter as the last counter they flipped.

This wouldn't be too tricky, however i would like the user to be able to create their own sets.

Is their away for construct to pick out the initial to entered text so that the user may enter their own text but the game will still be able to recognize which letter it begins with.


Thanks in Advance,
All help appreciated.
B
5
S
1
Posts: 65
Reputation: 507

Post » Mon Jun 12, 2017 3:10 pm

You can keep the worlds other players enter in a Json file which you can load on start of game.

And for checking the first letter of a world you can use the system expression, one of this two will do.

left(text, count)
Return the first count characters of text.

mid(text, index, count)
Return the count characters starting from index in text.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Post » Mon Jun 12, 2017 3:30 pm

imhotep22 wrote:You can keep the worlds other players enter in a Json file which you can load on start of game.

And for checking the first letter of a world you can use the system expression, one of this two will do.

left(text, count)
Return the first count characters of text.

mid(text, index, count)
Return the count characters starting from index in text.



Cheers, Was already familiar with the ways to allow a user to save sets just wasn't sure on the expression to pick out the initial, thanks a bunch.
B
5
S
1
Posts: 65
Reputation: 507

Post » Tue Jun 13, 2017 4:19 pm

imhotep22 wrote:You can keep the worlds other players enter in a Json file which you can load on start of game.

And for checking the first letter of a world you can use the system expression, one of this two will do.

left(text, count)
Return the first count characters of text.

mid(text, index, count)
Return the count characters starting from index in text.


Have tried doing this in the following way:


Left(leaftext.Text,1)

I tested this by filling the text boxes that are going to be displayed inside the leaftext object with just the letters that were meant to be detected and it worked.

However, now I made the cards full words it doesn't seem to be able to detect the initials.

Not sure if i'm doing something wrong.
B
5
S
1
Posts: 65
Reputation: 507

Post » Tue Jun 13, 2017 4:34 pm

If you keep all the words in a single variable or an array cell it wont work. You will have to put each word in a array cell, and then call the Left system expression on each cell to get the first letter.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367


Return to How do I....?

Who is online

Users browsing this forum: blackhornet, dop2000, mihirolover, tarek2 and 8 guests