How do I randomize Text?

Get help using Construct 2

Post » Sat Dec 06, 2014 3:41 pm

I made a bunch of silly phrases that are supposed to be a different one every time, but only the first one ever shows up.How am I supposed to make it so it will be randomized.I tried using "random" but it only works with numbers.What do I do?
B
4
S
1
Posts: 9
Reputation: 483

Post » Sat Dec 06, 2014 3:43 pm

Have you tried arrays? If not, check it out here:

https://www.scirra.com/manual/108/array
B
52
S
22
G
12
Posts: 725
Reputation: 11,716

Post » Sat Dec 06, 2014 4:41 pm

depending on how long the phrases are you have you could use the choose() funtion.

Set Text to: choose("Hello string1","Hello string2","Hello string3","Hello string4")

this will pick only one of those hello strings..
B
88
S
29
G
14
Posts: 1,154
Reputation: 15,003

Post » Sat Dec 06, 2014 5:06 pm

one way i do it for alternating title screen phrases is

On start of Layout ----> Set Text --> Choose(text1,text2,text3,text4)
there are many ways to meet your goal in Construct 2
B
9
S
5
Posts: 126
Reputation: 1,295

Post » Mon Dec 08, 2014 3:55 am

How is the test stored ?
Using R243 for all examples
B
69
S
20
G
6
Posts: 379
Reputation: 9,699


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests