A brain for use with the BrainManager that overrides its owner Entity’s visual settings.


Usually an entity plays the animation associated with its state, if available.  For instance, while in the Walk state, the walk animation in the Entity’s visual profile would be played.

What this does

This Brain allows you to force a specific animation to be played, regardless of what is going on with the AI.

Currently this only supports setting a single animation by name, but later it should allow you to set animation “sets” (to handle different directions) and animations from different visual profiles.

Parameters it understands

force_animForces this animation to be played and causes the AI system to stop changing it.
force_setForces this visual set to be played.  One of the C_VISUAL_STATE defines from setup_constants.lua.


this:GetBrainManager():Add("ForceVisual", "force_anim=climb"); //look like we're climbing, using the "climb" anim in our visual profile.
this:GetBrainManager():Add("ForceVisual", "force_set=" .. C_VISUAL_STATE_JUMP ); //look like we're jumping, supporting different anims for each direction
All Entity objects can use their BrainManager to add brains to control behavior and functions.
The Entity object.
A state that causes an entity to play his walk animation and move in the direction he’s current facing at the speed set in Entity::SetDesiredSpeed.