randomly assign the text

Discussion and feedback on Construct 2

Post » Tue Jun 19, 2012 5:24 pm

Hello people.
how says the title, can to make it ?

I have 5 text and 1 have the correct answer.

Thanks
B
4
Posts: 38
Reputation: 426

Post » Tue Jun 19, 2012 5:59 pm

You could try using: choose("One", "Two", "Three", "Four", "Five") which will return one of those pieces of text at random.Ashley2012-06-19 17:59:14
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue Jun 19, 2012 6:13 pm

This is a property of text ? because i don't see nothing similar

B
4
Posts: 38
Reputation: 426

Post » Tue Jun 19, 2012 6:37 pm

No it can be use for every kind of object so you can use a "choose" to randomly change some text but also to randomly change "all" kind of "open" value. if use on a global object having several instances ... all instances get a different value with a only one command.

Yes i think i understand your problem ... you can't put a command in the default text property of a text objet ... which only accept standard text ... it's the same for all object in Construct 2 ... so you must override all default "bad" values when your program start using the system "start of layout" event :

System => Start of Layout
    mytext: set text to choose("One", "Two", "Four", "Five")
    mynumvariable : set value to choose(1,2,4,5)
naelian2012-06-19 18:55:19
B
16
S
5
G
3
Posts: 298
Reputation: 5,240

Post » Tue Jun 19, 2012 6:40 pm

You use "Set text", then type [code]choose("One", "Two", "Three", "Four", "Five")[/code] in the content box.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Tue Jun 19, 2012 6:59 pm

@talca1991: it's a system expression.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue Jun 19, 2012 7:28 pm

Ah ok, now I understand the concept, thank you very much ... proves what I tell you.


saludos !
B
4
Posts: 38
Reputation: 426


Return to Construct 2 General

Who is online

Users browsing this forum: Unconnected and 1 guest