Randomly selected texts

Get help using Construct 2

Post » Fri Mar 29, 2013 11:09 am

So I'm making a loading screen, and there I have a text called "Tip: *tips*" And I have over 10 tips. How do I make it select one tip randomly for each time it loads? Kind of like WoW or CoD loading screens. So first time I load it might say "Tip: Stealth is more useful than shooting" and if I load the game some other time again it says another thing like "Tip: Right clicking will make you hold your breath".
So it picks random text files everytime I load the game?
Website Twitter Indie Developer
B
20
S
5
G
4
Posts: 201
Reputation: 2,884

Post » Fri Mar 29, 2013 11:50 am

Hi C,

Many ways to do it. One of the simplest to use the expression "choose", e.g.:

[CODE]choose("Tip 1","Tip 2","Tip 3" & newline & "which is multiline")[/CODE]

Cheers,
GregCJK2013-03-29 11:51:35
B
17
S
3
G
3
Posts: 79
Reputation: 3,698

Post » Fri Mar 29, 2013 7:52 pm

Is this a event or action you're talking about? I'm very confused
Website Twitter Indie Developer
B
20
S
5
G
4
Posts: 201
Reputation: 2,884

Post » Fri Mar 29, 2013 7:58 pm

'choose' is a system expression (see manual). In your case you would use the action "Set text" and when prompted for what text you want to display, type 'choose(A, B, C, D)'.

Every time the text is set a random string will be picked from the parameters of the expression. (A, B, C or D)Nimtrix2013-03-29 19:59:18
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Fri Mar 29, 2013 8:34 pm

Thanks!
Website Twitter Indie Developer
B
20
S
5
G
4
Posts: 201
Reputation: 2,884


Return to How do I....?

Who is online

Users browsing this forum: austinblackbelt, Yahoo [Bot] and 21 guests