Random Texte

Get help using Construct 2

Post » Wed Feb 10, 2016 8:32 am

Good Morning!
I'm new here, and I'm trying to make a random text, someone could help me
B
4
Posts: 16
Reputation: 236

Post » Wed Feb 10, 2016 9:07 am

Random as in?

Technically you could have a For loop to get through a certain amount of iterations, and use Choose("Option1","Option2","Option3") to create a ''random'' string of words. But whether or not it will make sense is an entirely different story.
B
5
Posts: 43
Reputation: 311

Post » Wed Feb 10, 2016 9:20 am

is to add questions to a (array) and use random numbers to get a text?
B
4
Posts: 16
Reputation: 236

Post » Wed Feb 10, 2016 9:28 am

I think I understand what you mean now. And yes that is definitely a possibility, have an array of questions and answers, then use a random number to pick a question (along with the relevant answer(s)!).
B
5
Posts: 43
Reputation: 311

Post » Wed Feb 10, 2016 9:46 am

now complicates me even more lol
so I want you so wish he would pick a random text equal numbers
B
4
Posts: 16
Reputation: 236

Post » Wed Feb 10, 2016 10:08 am

Basically, what you want is as follows (Pseudocode, mind you)?

Code: Select all
New Array (
    Contents:
    1 - What is the sum of 1 + 1?
    2 - How do you pet a Platypus?
    3 - What is love?
)
Display : Array[Choose(1,2,3)]


EDIT: The following *.capx basically contains the above: https://www.dropbox.com/s/47r131fbuxajv ... .capx?dl=1
B
5
Posts: 43
Reputation: 311

Post » Wed Feb 10, 2016 12:20 pm

Thank you saved my life
THX
B
4
Posts: 16
Reputation: 236

Post » Wed Feb 10, 2016 1:17 pm

Quick note: I set the Array Width property to 0 before adding stuff to it, by default this was set to 10 causing Array.Width to return 13 when the three options were added, this was not the desired result as there's only 3 strings in the array. Make sure to keep this in mind and change the base Width of a new array!
B
5
Posts: 43
Reputation: 311


Return to How do I....?

Who is online

Users browsing this forum: dandeliongames, QuantumMMX and 8 guests