9

1206 Chapter 14: character studio
OK
Closes the dialog and implements changes.
CancelCloses the dialog and ignores changes.
Cognitive Controllers
Create panel > Helpers > Object Type rollout > Crowd >
Setup rollout > Cognitive Controllers
Select a Crowd object. > Modi fy panel > Setup rollout >
Cognitive Controllers
The Cognitive Controller editor lets you combine
behaviors into st ates. More importantly, it lets
you sequence different behaviors (page 2–1159)
and behavior combinations using state diagrams,
where conditionals written in MAXScript impose
changesinbehavior.Forexample,youcanspecify
that a character or object is to wander aimlessly
until it comes within a certain distance of another
object, whereupon it heads straight for that
object. Or you can specify that one character is to
avoid another only when the second character is
avoiding the first.
Note: The MAXScript conditionals used in the
cognitive controller typically consist of a single
line of code. You can load and save them separately
as .ms files, but they are als o stored within the .max
scene file in which they reside.
The editor int erface consists of an icon-based
toolbar above a window that contains the state
diagram. When you first open the editor, no state
diagrams exist. Begin by clicking the New button
to create a new state diagram.
Tip: If you find yourself consistently assig n ing
two or more behaviors to delegates or teams, you
cansavetimebycombiningthebehaviorsinto
a single-state cognitive controller, or "behavior
module," and assigning that instead. The only
disadvantage is that you can’t animate t he weights
of behaviors used in the cognitive controller , but
you can work around that by using transitions.
Note: Crowd doesn’t let you use mult iple cognitive
controllers with a delegate. You can assign them,
but when you solve, the software notifies you that it
will use only the first assigned cognitive controller.
See also
State Dialog (page 2–1207)
State Transition Dialog (page 2–1208)
Interfa ce
Cr e ate S t ate Lets you create new states in the
diagram. Click this button, and then click in the
state diagram area to add states. A state appears as
a rectangular b ox containing the name of the state.
The first s tate you add is, by default, the first state
in the con troller that executes when the simulation
is run. This is indicated by its red color; states
you add subsequently are colored blue. To set a
different state to execute first, u se the Set Star t
State function.
You specify a state’s name and b ehaviors by editing
the state. To edit a state, right-click it. This opens
the State dialog (page 2–1207).
Cr e ate Tr ans ition Lets you link states with
transitions. Click this button, and then drag
between two states to create the transition, star ting