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.
First I worked on making a fix for invisible-to-FA2 infantry on the map, but this expanded to doing proper range checks on the infantry positions. The FA2 option of this feature reduces the valid infantry positions from 0,2,3,4 to 0,2,3, and can be toggled via a new setting in mapclean.cfg under [Options]. The FA2 limitation is made optional as other map editors don't have this bug, and in the future FA2sp might fix this.
After all the testing, this was followed up by a similar overlapped unit/aircraft check. This one is a little simpler in that it just removes whatever overlaps an earlier unit. The caveat here is that the overlap check stays within the unit class, so an infantry can still overlap with a vehicle or an aircraft, but a vehicle cannot overlap an aircraft, and they can all overlap buildings.
For a detailed analysis of the map before or after cleaning, I'll refer you to use the MISTEST script.
Another reasonably big update, this one adds two new sections to the .cfg that allows you to change the state and owner of placed units and buildings. The changes can be batched by object name or its current owner, so you can flip all civilian objects to Sleep or all the tech buildings to Neutral house.
Worth noting that the "Civilian" house is "Neutral" for the purposes of placed objects.
PS. If you have matching rules to change the owner of something, one by owner, the other by object name, the match by name will take precedence, ie. the specific rule overrides the broad rule.
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