The AI toolkit: brains, Ice Age's AI helpers for any creature, species brains.
Creature AI for scripts, in three levels (the guide Creature behaviour has complete
examples):
Brains.c.brain runs something else in place of a creature's AI: another species' AI (when the animations line
up: ai.compatible), one of the Ice Age-style brains "prey", "predator", "defender" (for any species of both
games), or your own function(c, dt). ai.setSpeciesBrain does it for a whole species.
The game's creature functions on the creature: c:walkTo, c:runTo, c:idle, c:sees, c:attackHunter,
c:attack, c:jump, c:roar ... (world: Creature methods).
Ice Age's AI helpers (AIGen_*, the building blocks of every Ice Age animal), here for every creature of both
games. They work on one creature's AI frame: ai.begin(c) first, then the helpers in the order an Ice Age AI calls
them (animate, pick the animation, phaseChanging, rotate, thinkSpeed). Speeds are the game's own: units per
millisecond, times the creature's scale (the Wolf walks at 0.32 and runs at 2.048).
ai.anims(c) gives a species' walk, run, idle, attack (kill), jump and roar animations and its idles, as in the species
tables on the world page.
Whether the creature can run that species' AI: its model needs at least as many animations (the species is loaded when the hunt did not), and flyers and walkers do not mix. The generic brains fit every creature.
The calm idles c:idle plays for this species (and ai.anims(...).idles, the possession's standing) instead of its AI's list. Species whose AI never stands (Dinosaur Hunter's raptors, the Allosaurus) have none; their models often have spare animations. A content pack's species uses its AI species' list unless it has its own. Undone when the scripts unload (listed in game.changes()).
Starts an AI frame: remembers its animation and time (for phaseChanging) and the distances the helpers read. Call it once per frame before the other helpers.