I am working on a project, I have been given a list of words in a txt file and want to import them into construct (already have the txt file inside the project as a project file) and put them into an array or something of that sort so I can choose random words to display.
The are all separated by a newline, but I am not allowed to edit the file to be in json format. I have been allowed to use whatever software I wish, so decided on Construct.
Is this possible?? Spent a few hours trying to figure it out.
Develop games in your browser. Powerful, performant & highly capable.
Ajax the project file, and parse through it with events. Assuming the file is formatted like this:
Events to add each word the X axis of the array would be (in pseudo-code):
On start of layout: AJAX request the project file
On Ajax request complete: Set array size to 0,1,1
Repeat tokencount(Ajax.LastData,newline): Push back tokenat(Ajax.LastData,loopindex,newline) on X Axix
Sorry for taking so long to reply here, but that is exactly what I needed, thank you so much!!! You are a legend!!