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
To find linebreaks (newline) on a project file I called via the AJAX object, I had to modify the plugin this way:
Exps.prototype.LastData = function (ret)
var str = this.lastData.replace(/\r?\n|\r/g,"\n");
Dunno if I did it well enough but it seems that newline is only an alias of the js "\n"
But in windows I think linebreaks are a "\r\n" and the tokencount function gave me an extra character from the same string when I loaded it from a project file.
Hmm... I'm worried this could subtly break other things. I've implemented the fix for the next build though, we'll see how it goes.
Develop games in your browser. Powerful, performant & highly capable.
hmm I think you didn't implement it completely.
doing data.replace("\r\n","\n"); only replace the first occurence.
it seems you need the g flag for a global replacement as specified here