How do I amend The choose expression

Get help using Construct 2

Post » Thu Aug 17, 2017 11:54 am

I dont know if there is a way to do this but lets say i have the command

Choose(2,5,7,9) and i want to add 15 on the end

is there a way to amend the choose command and just add the 15 to the end the number 15 could be any anumber depending on what item the number relates
this is why i need to amend and not just change the string thanks for any info i get
i
B
8
S
2
Posts: 21
Reputation: 1,327

Post » Thu Aug 17, 2017 12:11 pm

Not that i know.
But why not use an array?
Choose a random index floor(random(0,array.width))
Have the values on the X-index.
Add values with Array > push
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Fri Aug 18, 2017 1:13 am

Yes Mate thanks for response , I am Using arrays with push at the moment but amending the choose command would be a whole lot less time consuming for what i am doing. (if theirs an easier quicker way il take it :) ..)
B
8
S
2
Posts: 21
Reputation: 1,327

Post » Fri Aug 18, 2017 3:17 am

Choose is limited to a fixed set of numbers. If you need a flexible set, an array is the best choice.
Mistakes were made.
B
51
S
25
G
107
Posts: 1,581
Reputation: 60,458

Post » Fri Aug 18, 2017 5:05 pm

oosyrag wrote:Choose is limited to a fixed set of numbers. If you need a flexible set, an array is the best choice.


Yes mate I gathered that I was just hoping choose was more flexible Never Mind Thanks anyway
B
8
S
2
Posts: 21
Reputation: 1,327


Return to How do I....?

Who is online

Users browsing this forum: Fradno and 16 guests