-
Notifications
You must be signed in to change notification settings - Fork 23
How towers are defined
This page explains how towers are defined in youtd2.
Each tower is assigned a unique id.
All towers have properties. Properties are values which are stored in a CSV file called tower_properties.csv
and loaded when the game runs.
When you add a new line to the tower CSV, the game will attempt to load that tower. It will fail until you define all of the other required files.
Tower scripts are known as tower behaviors. Tower behaviors implement abilities, spells and other effects. They also define the tooltip text.
Only one script is created per tower family because scripts for towers of same family essentially do the same thing but with different values for each tier. This means that one script can be defined, avoiding code duplication.
Tower sprites define what the tower looks like. It is simply a picture which will be attached to the tower node.
Note that tower sprites need to include some adjustments on top of the original image:
- Position of the sprite, to center it
- Scale of the sprite, to adjust in game size and sometimes to reuse same image for different tiers.
Tower tooltips are created by the tower script and cached in a csv. There's a config option to run the tooltip generator.
Same thing as tower tooltips, but with a different generator.