Posted: Fri May 27, 2016 4:52 pm Post subject:
FinalSun Tunnel Fixer
FinalSun has a very annoying bug that breaks all tunnels that you draw in the map editor. The tunnels usually work fine with vehicles, but infantry get stuck. This happens because every second tunnel tube that FinalSun generates into the [Tubes] section in the map has a wrong value in them.
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:
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.
FA2 supports tunnels and has the same problem as finalsun, so this should work for RA2 maps as well.
It doesn't change Q45's tool generated entries, so no problem there.
Few observation:
- If a tunnel entry has no direction entry, this tool duplicates the last coordinate entry (Pros and cons, Tiberium
Filteration user maps)
- If some map or entries are skipped without correction, a log could be generated with the map filename.
If only both of our tools could be added to the map editor itself in some form. _________________
Twisted Insurrection's Lead Campaign Developer QUICK_EDIT
- If some map or entries are skipped without correction, a log could be generated with the map filename.
If some entries are skipped without correction, the tool does tell it in the console window. ("Nothing to fix in tube X")
E1 Elite wrote:
Edit: Attached skipped case examples.
The tool expects that the tube indexes start from 0 and are always increased by 1. Which is currently intentional, since that's how FinalSun writes its tunnels. The tool will stop once it finds a tube index that doesn't exist, so in Tiber River's case the tool already stops after checking if tube #0 exists.
Skipping some indexes would be easy to implement though; instead of looking for tubes index-by-index it could look at all the INI keys in the [Tubes] section and apply the fix for the keys.
Q45 wrote:
If only both of our tools could be added to the map editor itself in some form.
Had run the tool from a batch file on several user maps, so didn't see the console output.
Tool changes of the no direction entry cases in the aforementioned maps:
0=102,207,4,102,208,-1 -> 0=102,207,4,102,208,208,-1
4=33,97,6,32,97,-1 -> 4=33,97,6,32,97,97,-1
FinalSun 0.98 shows the tunnel lines which can be used for viewing. QUICK_EDIT
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum