Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
I'd like to store numbers to choose from randomly in a text variable. The numbers would be separated by commas, and this would allow me to have as many or as little choices to choose from. Is there a way of passing a text variable to choose()? If not, can multiple values separated by commas in an instance text variable have the numbers randomised and passed on?
Develop games in your browser. Powerful, performant & highly capable.
I don't understand the need for the text, you would just set choose(a,b,c,d,e,f) right? Or are you saying the values are unknown or change during the game?
Okay, thanks to Carnage I managed to do it with
int(tokenat(Object.StringVar, floor(random(tokencount(Object.StringVar, ","))), ","))