9
Cognitive Controllers 1171
3.
Open the Cognitive Controller editor (page
2–1206).
4. Click the New button to create a cognitive
controller.
character studio gives the controller the
defaultnameof“CognitiveController.”It’s
recommendedthatyougivemoredescriptive
names to cognitive controllers, such as
"Seek/Wander". Do this by clicking on the
name in the text box and editing it from the
keyboard.
Creating a new cognitive controller
automatically places you in Create State mode.
5. Click in the editor window to create and place
a state. Continue clicking in different places to
addasmanystatesasnecessary.
6. Right-click a state to open the State dialog (page
2–1207).
7. Again, it’s recommended that you g ive more
descriptive names to states, which you can
dointheStatedialog.Clickthename(State
or State#) in the text box and edit it from the
keyboard.
Next, define a behavior or behaviors for each
state.
8. Click the Add button.
9. In the Select Behaviors dialog, choose one or
more behaviors.
Ifyouchoosemultiplebehaviors,youcan
specify different weights for each in the State
editor. For example, you can combine a Seek
behavior at full weight w ith a Wander behavior
at half weight, so that t he delegate will meander
slightly as it seeks the target.
10. Close the Select Behaviors dialog, and then
closetheStateeditor.
11. Repeat steps 6–10 as necessar y to define
behaviors for the other states in the controller.
Next, u se Create Transition to define the
sequence of states during the simulation.
12. Decide on the sequence in which the states are
to occur.
13. Click the Create Transition button.
14. Drag a line from one state to the next in the
order that they a re to execute. Click a state to
createatransitionfromitselftoitself.
A transition arrow appears, pointing from the
"source" state to the "destination" state.
Each state can have any number of incoming
and outgoing transitions. Specify different
transition conditions for each to create as
complex a state diagram as necessary.
Next, use the Sta te Transition dialog to define a
conditional for each transition.
15. Rig ht-click a transition line.
16. In the State Transition dialog (page 2–1208),
enter the name of the transition condition, and
then click the Edit MAXScript button.
17. Use the MAXScript editor window to enter
or load a script that defines the condition or
conditions under which the transition is to
occur.
Ty pically, this is a function that tests a condition
and returns 1 (if t rue) or 0 (if false).
Note: See this topic in the online User Reference
for sample MAXScript code for this function.
18. UsetheStateTransitiondialogtosetother
parameters such as priority and duration.
19. Use the Behavior Assignments and Teams dialog
(page 2–1200) to assign the cognitive controller
to delegates or teams.
Note: Crowd doe sn’t let you use multiple
cognitiv e controllers with a delegate. You can
assign them, but when you solve, the software
notifiesyouthatitwilluseonlythefirst
assigned cognitive controller.