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
58
S
25
G
14
Posts: 793
Reputation: 13,302

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
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

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,701


Return to How do I....?

Who is online

Users browsing this forum: EuropaMin3r, maddy467, NN81, work3 and 10 guests