< Lua in SpringRTS

Callouts

Spring resources are the ones that are going to provide communication between your Lua code and the Spring engine.

The engine provides a plethora of built-in functions that you can call. These functions are called callouts.

Callins

Event handlers are also provided and are called callins. Callins are just functions inside your Lua code that get invoked from the engine when certain events take place. For example if a unit gets created or destroyed.

Variables

Variables are containers that keep values inside them. As their name suggest, their value is variable. Practically that means that you are freely to change the value of a variable in opposition to constants.

Constants

Constants are containers as well with only difference that their value NEVER changes. Constants are used for things that never change. Practically a constant will be used to keep the number Pi from math, the name of a player etc.

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.