<

LESSON 4 - Part 2:  Randomizing Events

Creating The Randomizing Behavior (continued)

Our Line #8 should look like this, and that's about it for our Randomize behavior. Make sure yours matches mine:


Fig. 2.40

Pretty nice behavior if you ask me, eh? We done reeeeal good and sombody should take us out for ice cream.

Finally, we tie everything together, and to do this we go to our "View" behavior which is #4100.

Wrapping Things Up

Open behavior #4100 so we can examine its contents. Make sure you rewrite so we'll be looking at the same thing.


Fig. 2.41

We have our approach object instructions (lines 3 and 4), the standard entry (line 5), the "react" private call (line 7), and then our standard exit lines (8 and 9).

Thinking logically, we want the Sim to go to the object, ask for something (react), and then get rewarded for his efforts (randomize events).

We will then need to place our private call to "Randomize" immediately after the "React" call.

Add a new line to this behavior. Then, select the new line and call the "Randomize" private. Make it return 8/Error.