I use an obscure language called DM to code my game. The engine has it’s own map format “DMM” which is just a CSV.
I have written a script in DM to convert a Tiled CSV to a DMM and it works, but only for 1 layer. The only thing I’ve come up with to add multiple layers have to loop 10,000 times to add the second layer. That’s obviously not ideal.
So let’s say the Tiled CSV exports like this:
layer1:
0,0,0,0,0
0,1,0,2,1
layer2:
-1,-1,4,3,-1
-1,3,2,-1,-1
I need it to export like this for two layers:
0(2)-1),0(2)-1),0(2)4),0(2)3),0(2)-1)
0(2)-1),0(2)3),0(2)2),0(2)-1),0(2)-1)
Three layers?:
0(2)-1)(3)-1),0(2)-1)(3)-1),0(2)4)(3)-1),0(2)3)(3)-1),0(2)-1)(3)-1)
0(2)-1)(3)-1),0(2)3)(3)-1),0(2)2)(3)-1),0(2)-1)(3)-1),0(2)-1)(3)-1)
It doesn’t have to format like that specifically. Each layer just needs an identifier that I can separate from one another using regex. If I can get Tiled to export a CSV in a format like this my script can convert it to a DMM file.
I’ve done some looking, and maybe I don’t know exactly what to search for, but I can’t seem to find any example of editing the script for the CSV export. I’ve never used Javascript or Python, so this will definitely been a learning experience all around. I’m hoping someone can give me some resources to push me in the right direction.