Creating a Behavior

Behaviors are classes that control a Unit. For example, health items have the Pickup behavior. This pickup behavior responds to the Collide function, so that it can perform an Effect when a Player touches the item.

To make the value optional instead of required, add the 4th optional argument false, followed by an optional default value. For example, if you would like move-time in the above example to be optional and default to 1000, you would do this:

m_moveTime = GetParamInt(unit, params, "move-time", false, 1000);

Functions

Further, you can implement any function you'd like from the below list in your class, and they will be called as events.