Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
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?
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?
Develop games in your browser. Powerful, performant & highly capable.
Okay, thanks to Carnage I managed to do it with
int(tokenat(Object.StringVar, floor(random(tokencount(Object.StringVar, ","))), ","))