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.
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.
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 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.
There are two unit groups as part of the army NEUTRAL_CIVILIAN that help assist creating the markings:
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:
-- -- 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:
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.