Is there a really clean and easy way to split ajax.lastdata to simple numbers in a global variable so that it looks like, "0,0,1,23,4"? Currently saving ajax.lastdata into a global variable looks like this, "{"c2array":true,"size":[7,2,1],"data":[[[1286],[885]],[[1605],[693]],[[1716],[903]],[[1643],[1033]],[[1842],[1015]],[[1940],[844]],[[1989],[974]]]}"
What I'm actually trying to do:
I'm saving all enemy positions (XY coordinates) into a json file. Then i'm loading that json file into a global var and using tokenat to retrieve the numbers to create enemies using those X,Y positions during loading of the level. Reason why I have it as a separate file is that I have separate json files for each level to build tilemaps, enemies, items, etc... This way, I don't have to have 100+ layouts to load each level - I can just load them on the same layout after each level.
If there is a more efficient way to do this, please let me know!