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
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 want to set an array with text then iterate through it - all the tutorials and posts I'm seeing about arrays are over my head or off topic. I know I can do this manually with a long slew of events but I'd rather do this with an array and an expression. I just don't know where or how.
for example - at 5 seconds:
etc - thanks!
You can use TokenAt() to retrieve part of a string so long as there is a delimiter.
For example, if you have a string "M1,M2,M3"
then tokenat(string,2,",") will give you "M2"
Develop games in your browser. Powerful, performant & highly capable.
Yeah tokenat definitely.
With array it's a pain 'cause you have to set each lines with one action
Array: set value at (0) to "good start"
Array: set value at (1) to "keep going"
With tokenat you just do a
Global text dialog = ""
System: Start of layout
-> Set dialog to [insert your tokenized text]
And then call each token as Tokensom (hehe) said
My little advide :
Build your string with newline as separator
dialog = "good start
And then you can access each of them with tokenat(dialog,[index],newline)