Text functions and operands
![mariusiancu](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
Hi!
I am making a trivia game where the player have to type the right answer, not to choose it from a list of possible answers.
I made the keyboard thanks to tshirtbooth and his video:![](https://img.youtube.com/vi/bYp0kXuL4V8/0.jpg)
Comparing the typed answer with the right answer from a table is no problem. But I want more![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
I want to be able to show random letters after a period of time. For example, if the player doesn't type anything for 10 seconds I want to show 2 letters (at random position in text) and, of course, lower his score
Then after another 10 seconds, another 1 letter and less points. And so on. I think you got the idea.
So for this I need text functions like "str", "substr" and alike. Is there anything I can use for my project? Or, is there any other way I can pick a letter from a string?
Thank you guys.
I am making a trivia game where the player have to type the right answer, not to choose it from a list of possible answers.
I made the keyboard thanks to tshirtbooth and his video:
![](https://img.youtube.com/vi/bYp0kXuL4V8/0.jpg)
Comparing the typed answer with the right answer from a table is no problem. But I want more
![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
I want to be able to show random letters after a period of time. For example, if the player doesn't type anything for 10 seconds I want to show 2 letters (at random position in text) and, of course, lower his score
![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
So for this I need text functions like "str", "substr" and alike. Is there anything I can use for my project? Or, is there any other way I can pick a letter from a string?
Thank you guys.
Best Answers
-
lukey5227 Posts: 111
Well, one of the number one things I'd suggest is having a table with the strings.
Get two tables: The first has the questions. Row 1 has question 1, row 2 has question 2, etc...
The second table should be the text. Question 1's answer will be in row 1. Each column is a different character. For example, Hello! Would be separated into H, e, l, l, o, and !.
I'd also suggest having the first table contain how many characters the answer has.
Now, since I'm not 100% sure how yours is working I'll give you an idea of how it would work this way.
1) GS picks a random number between 1 and the total number of characters of the answer (in table 1)
2) Round that number to the nearest whole number
3) Find the question #, go to that row in the second table and choose the column number of the random number that was rounded.
You now have the character. Place it in the correct position or add it to the string.
Use @luke5227 if you want to ask me more...
Hope I could help!
Answers
Thank you very much for your answer
Thank you very much!