9

1208 Chapter 14: character studio
List—
Displays the names of all behaviors
associated with the state.
Toremoveabehaviororchangeitsweight,clickthe
behavior’s name, and then make the appropriate
changes using the controls below the list.
Note: The order of behaviors in this list is
immaterial; all behaviors execute simultaneously.
Add—Opens the Select B ehavior dialog , which
displays the names of all behaviors (page 2–1211)
inthecurrentCrowdobjectthatarenotassociated
w ith the cur rent state. Select a behavior (use
Shi f t
and/or Ctrl to choose multiple behaviors), and
then click OK.
Remove—Eliminates the highlighted behavior
from the state.
Weigh tSpecifies the selected behavior’s relative
influence in the state. Default=1.0.
The higher the weight in relation to other
behaviors’weights,themoreevidenttheresultsof
the behavior in the state. In mo st cases, you should
keep Weight within a range of 0.0 to 1.0. Higher
settings are available but shouldn’t be used unless
absolutely necessary.
OK Closes the dialog a nd implements changes.
CancelCloses the dialog and ignores changes.
State Transition Dialog
Create panel > Helpers > Object Type rollout > Crowd
> Setup rollout > Cognitive Controllers > R ight-click a
transition line.
Select a Crowd object. > Modi fy panel > Setup rollout >
Cognitive Controllers > Right-click a tra nsition line.
These settings control how the software effects a
transition from one state to another when using
a cognitive controller (page 2–1206).Formore
detailed information, see To s et u p and u s e a
cognitive controller (page 2–1170).
The Transition S cr ipt
The most important ele m ent of the transition is
the MAXScript conditional script. This is a script
associated with the con troller that is executed once
per f rame, and can test any aspec t or aspects of the
sceneandcauseatransitionornot,dependingon
whether the result of the test is successful (true, or
1) or unsuccessful (false, or 0).
The softw are executes s cripts once per fra me per
assigned delegate, so objects and effects can be
animated and st i ll let delegates react with accuracy.
All scripts used in t ransitions use the following
structure:
fn [FunctionName] delt=(
[MAXScript code]
if [MAXScript conditional]
then 1
else 0 )
The opening section contains "fn" (function)
followed by the function name, which also must
appear in the State Transition dialog, and then
the input para meters "del t", and lastly "= (".
Following this there can be any MAX Scr ipt code,
or none.
The closing section cont ains a necessary
MAXScript conditional, and then "then 1 else
0". This means: If the result of the conditional is
true,thenreturn1(thatis,thetransitionistotake
place), or if the result of the conditional is false,
then return 0 (that is, the transition is not to take
place). You could reverse the order of the numbers
1and0("then0else1")sothattheconditional
beingtruewouldcausenotransitiontotakeplace,
and vice-versa. Lastly, the function must end with
a close parenthesis: ")".
Following are s ome examples of scripts t hat can
be used in cognitive controllers, along with brief