AI object

The main ai object that modules hang off of. The AI object can be accessed anywhere, and passes events to any modules that have been registered and created. Modules can be accessed as member variables, e.g. ai.attackhandler.

It’s tempting to place other things on this object, such as config tables, commonly used functions, etc. Do not do this. If you need somewhere to put things, create a module and put them there instead.

The AI object is also responsible for doing the initial setup, and ai.lua will load the API and trigger the loading of modules