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 believe it's a trivial problem but I really can't find the answer anywhere by google nor this forum, so I'm making a post (sorry if this is redundant but couldn't find it).
I'm loading data from server (PHP) to an array in C2. Data goes encoded with JSON as 2d array with looks more or less like that:
{"c2array":true,"size":[5,3,null],"data":[["1","One-1","One-2"],["2","Oj","a"],["3","Mawy","a"],["4","Dake sw","a"],["5","Rowa","ezao celtah, myce, grah"]]}[/code:11jubse7] I tried also with size [5,3,1] and [5,3,0]. My problem here is that when I do foreach (XY) loop then for the indexes where I would expect a string as a value, I recieve a single character. For example myArray.at(0,1) returns "O" instead of whole string "One-1". Same thing happens when I use CurValue just to debug data. Any help please?
Develop games in your browser. Powerful, performant & highly capable.
Hi,
I think it sould be :
{"c2array":true,"size":[5,3,1],"data":[[["1"],["One-1"],["One-2"]],[["2"],["Oj"],["a"]],[["3"],["Mawy"],["a"]],[["4"],["Dake sw"],["a"]],[["5"],["Rowa"],["ezao celtah"],["myce"], ["grah"]]]}
I think it sould be : {"c2array":true,"size":[5,3,1],"data":[[["1"],["One-1"],["One-2"]],[["2"],["Oj"],["a"]],[["3"],["Mawy"],["a"]],[["4"],["Dake sw"],["a"]],[["5"],["Rowa"],["ezao celtah"],["myce"], ["grah"]]]}
Hi beufreecasse!
That's the charm I was looking for! Thank you very much I stucked with this second day already and you saved me!
Glad to help