ID:170144
 
I've just started incorporating the SwapMaps library into Maeva and have seen what an incredible range of options this now opens up for me. I'm thoroughly impressed. I'm just having a few problems, chiefly with converting my dmp files to swapmaps. It looks like if something has an icon_state with a comma in it, it gets separated and isn't read correctly by swapmaps. I can go in and manually remove the carriage returns and it seems to work ok, but perhaps this can be handled automatically by the library? Also, if I have two turfs on the same map square, BYOND treats the bottom turf as an underlay if I just compile the map, but the DMP converter treats it as part of the turfs contents, which crashes the map loading process. I'm sure I can find temporary work-arounds but it would help a lot if the library could be updated. Thanks a lot, and kudos or whatnot to you Lummox.
DerDragon wrote:
I've just started incorporating the SwapMaps library into Maeva and have seen what an incredible range of options this now opens up for me. I'm thoroughly impressed. I'm just having a few problems, chiefly with converting my dmp files to swapmaps. It looks like if something has an icon_state with a comma in it, it gets separated and isn't read correctly by swapmaps.

Hrm. I'll take a look.

I can go in and manually remove the carriage returns and it seems to work ok, but perhaps this can be handled automatically by the library? Also, if I have two turfs on the same map square, BYOND treats the bottom turf as an underlay if I just compile the map, but the DMP converter treats it as part of the turfs contents, which crashes the map loading process. I'm sure I can find temporary work-arounds but it would help a lot if the library could be updated. Thanks a lot, and kudos or whatnot to you Lummox.

The .dmp converter wasn't originally designed to handle underlays properly, basically because I didn't realize at the time how those were being done in the file. Now that I know, though, I can at some point fix this.

Lummox JR
In response to Lummox JR
proc/d2sm_ParseCommaList(txt)
var/list/L=new
var/i,ch
var/inquotes = 0
for(i=1,i<=length(txt),++i)
if(text2ascii(txt,i)>32) break
for(,i<=length(txt),++i)
ch=text2ascii(txt,i)
if(ch==34)
inquotes = !inquotes
if(ch==44&&!inquotes)
L+=copytext(txt,1,i)
for(++i,i<=length(txt),++i) if(text2ascii(txt,i)>32) break
txt=copytext(txt,i)
i=0;continue
if(ch==40 || ch==91 || ch==123)
i=d2sm_MatchBrace(txt,i,ch)
if(!i) return "No matching brace found for [ascii2text(ch)]"
if(i>1) L+=copytext(txt,1,i)
return L


I made a few minor changes to the parsing of commas, taking quotes into account. Now I can convert my DMPs that use pngs over 32x32 pixels in size and their icon_states will be accounted for properly. I also added an "underturf" variable to handle underlays of multi-turf tiles. I modified the SwapMaps code for that a bit, but I figured it's kind of a shoddy way to do it and people wouldn't or at least shouldn't really be interested.

Again, huge thanks to Lummox, a new era of Maeva is dawning with SwapMaps.