Gamedev:UnitDefs

From Spring
Revision as of 18:31, 11 June 2011 by Flozi (talk | contribs) (base outline of new UnitDef tag documentation - no tags in it yet!)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Location

UnitDef files are .lua files stored in the Units/ directory of a Spring Game.

Purpose

UnitDef files have one purpose; to define the properties of units. They are the main description file for what attributes your unit should have and how it should behave.

Source

The engine source code which loads the tags from these files is viewable here:

https://github.com/spring/spring/blob/master/rts/Sim/Units/UnitDef.cpp

Data Types

Tags may be one of the following data types:

  • int - An integer number
  • float - A number with decimals.
  • bool - A value which can be true or false.
  • string - Text, or more precisely a string of alphanumeric characters.
  • float[3] - A vector, with three float components, representing x, y and z axes.

Details

There follows a comprehensive list of the tags available, their data type, default value and a brief description of what they do. Bear in mind that the source code linked above is the ultimate reference when dealing with these tags.

General

Resources

Sensors

Commands

Builder

Movement

Flanking

Aircraft

Transports

Categories

Decals

Collision Volumes

Weapons

Other

Custom Params