Scripts for map development


Hi everyone - I'll use this topic to publish bits and pieces of scripts that I think are nice to have and / or may be worth to use in other maps. If you encounter any bugs please do mention them in this topic.

Lua scripts

All scripts related to functionality in-game can be found at this repository. These scripts are licensed with the MIT license. Essentially you are free to do whatever you want with them.

Bash scripts

All scripts related to the development of maps can be found at this repository. These scripts are licensed with the CC BY-NC-SA 4.0 license. You are free to use them as long as you adhere to the license.


Cliff building indicators



Cliff building is a common technique where you build a factory on top of a cliff or down into a valley. It allows a player to quickly get presence in an area that would otherwise require a transport or a large detour. From a player perspective it may be hard to determine where these build locations are available. A consequence of that is frustration when a player gets it wrong.

The aim of this script is to create visual cues for both the (tech 1) engineer and the factory. If both are correct then the (tech 1) engineer should be able to build the factory after it moved towards the visual cue for the engineer.


The intent is that a tech 1 engineer can perform the cliff building. Please make sure that your map adheres to this as player will expect this in the future.

How to make it work

There are two unit groups as part of the army NEUTRAL_CIVILIAN that help assist creating the markings:

  • CLIFFBUILD: where you expect a factory to be buildable.
  • CLIFFENGINEER: where you expect an (tech 1) engineer to be to build the factory.

Use land factories for the CLIFFBUILD unit group and tech 1 power generators for the CLIFFENGINEER unit group. For a practical example you can download the map Kaali from the vault.

To use the script copy the content of CliffBuilding.lua into your %MAP_NAME%_script.lua file. Then replace %MAP_NAME% with the name of the folder of your map. Prepend it at the top of the file. Then add the following bit of code to the OnStart function in your script file:

function OnStart()
    -- -- copy this bit -- --
    -- prepare the cliff build spots
    -- --               -- --

i wonder if that could technically evolve into a UI mod


You can not analyze the heightmap on the UI side - therefore detecting these locations would not be possible.


I've updated this topic with scripts that I commonly use during the development of maps. This includes:

  • Batch resizing (drag and drop any folder / file)
  • Batch appending (drag and drop any folder / file)
  • Batch composing (drag and drop two folders: one with RGB images, another with greyscale images. Greyscale images become the alpha channel of the RGB images. Tad harder to use with drag and drop - first click greyscale folder, then click rgb folder)
  • Batch converting to DDS (drag and drop any folder / file)
  • Batch converting to TIF (drag and drop any folder / file)

See the original post for a link to the repository. You need a bash shell and Image Magick installed in order to use these scripts. More information later on how I use these scripts in my own workflow.