As an example:
How tubes should be coded:
Quote:
0=147,110,4,147,117,4,4,4,4,4,4,4,-1
1=147,117,0,147,110,0,0,0,0,0,0,0,-1
2=148,110,4,148,118,4,4,4,4,4,4,4,4,-1
3=148,118,0,148,110,0,0,0,0,0,0,0,0,-1
4=149,109,4,149,118,4,4,4,4,4,4,4,4,4,-1
5=149,118,0,149,109,0,0,0,0,0,0,0,0,0,-1
1=147,117,0,147,110,0,0,0,0,0,0,0,-1
2=148,110,4,148,118,4,4,4,4,4,4,4,4,-1
3=148,118,0,148,110,0,0,0,0,0,0,0,0,-1
4=149,109,4,149,118,4,4,4,4,4,4,4,4,4,-1
5=149,118,0,149,109,0,0,0,0,0,0,0,0,0,-1
How FinalSun codes them:
Quote:
0=147,110,4,147,117,4,4,4,4,4,4,-1,-1
1=147,117,0,147,110,0,0,0,0,0,0,0,-1
2=148,110,4,148,118,4,4,4,4,4,4,4,-1,-1
3=148,118,0,148,110,0,0,0,0,0,0,0,0,-1
4=149,109,4,149,118,4,4,4,4,4,4,4,4,-1,-1
5=149,118,0,149,109,0,0,0,0,0,0,0,0,0,-1
1=147,117,0,147,110,0,0,0,0,0,0,0,-1
2=148,110,4,148,118,4,4,4,4,4,4,4,-1,-1
3=148,118,0,148,110,0,0,0,0,0,0,0,0,-1
4=149,109,4,149,118,4,4,4,4,4,4,4,4,-1,-1
5=149,118,0,149,109,0,0,0,0,0,0,0,0,0,-1
Basically, in every second tube FinalSun includes one proper value less than it should.
Another issue with FinalSun's [Tubes] code is that it includes a massive amount of useless extra -1s, cluttering the code. I removed them from the examples above; here's what a FinalSun-coded tube value actually looks like:
Quote:
0=115,101,2,124,102,2,2,3,2,2,2,2,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
Because fixing these [Tubes] sections manually takes a bit of repetitive work and it was almost as quick to make a program that does the work for me, I made one.
To use it, simply drag-and-drop your map file into the TSTunnelFixer executable, and the tool will fix the tubes in the map and replace the original map file with the fixed version. I also included the tool's source code in the ZIP.
Note that I've only tested this tool with FinalSun-made tunnels; I haven't tested its effects on custom-made tunnels or tunnels made with Q45's TS/RA2 Tunnel Drawer. The tool is meant to just ignore those tunnels though (since they don't need fixing in the first place), and it'll likely do just that.
I don't know if FinalAlert 2 supports tunnels and whether it has the same faults as FS (if it does support tunnels). But if it does have the same bug, this tool should also be able to fix FA2's tunnels.