Posted: Sat May 27, 2023 6:23 am Post subject:
MAPCLEAN - a script to add/remove/modify tags and sections in maps
MAPCLEAN initially started out with the goal of removing the junk added to the maps by FA2, such as the countries, and was expanded to be able to modify tags as well. The modification and removal process is controlled by the contents of mapclean.cfg which has explanations for every section. It's probably worth mentioning the maps.log it generates will not have much information regarding operation, but will nonetheless indicate that it has completed cleaning the maps.
Unlike most of the other scripts, MAPCLEAN is run by dragging and dropping a map onto the batchfile, it's not picky about the file extension, but it is picky about whether the map is a mission map or multiplayer map. The ability to remove tags or sections can be useful if the map contains unsupported additional content, such as when converting a YR map to RA2, the ability to modify is probably most useful for fixing lighting.
Also rare to the scripts in this series, is the option to specify the .cfg file and log file names, as well as optionally changing the logging behaviour to one of appending instead of overwriting. So two copies of MAPCLEAN could co-exist, with their own batchfiles and cfg files, one for cleaning new multiplayer maps, and a less aggressive one for making slight changes to mission maps. By default it will not attempt to "clean" a mission map, as the rules defined in mapclean.cfg may interfere with the code required for missions to work. To change this behaviour, you will have to change the 'allowmissions' flag in mapclean.tcl.
There is an unstated secondary feature that I know has helped some people, in cases where the map sections are jumbled (or sorted) in a way that will crash the game, MAPCLEAN will write the sections back to the map in a perfectly safe order. This includes grouping all map scripting sections together for less jumping around when manually editing or debugging, though for any serious troubleshooting you should use MISTEST to scan the map.
Strictly speaking the mapclean.tcl doesn't normally have to be edited, as it doesn't read any inis or game files, but as mentioned above there are some settings that can be worth altering in specific cases.
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