WEEK 4: Adding New Behaviors and Menu Options

FUNCTIONS (continued)

The Private Function depicted in Fig. 1.1 above (4111) is the "ComeAndSeeMe" behavior found in our chair. Remember that one?

You can get a binder later. For today, you will pull out your notebook, and write this code down under the heading of "Functions":

Function 42: Create New Object Instance

Everyone write that down? Function 42 is a nifty one which we will work with this week.

What does it do?

When a child walks up to the bathroom sink to wash his hands or brush his teeth, Function 42 comes into play right away. It produces the step stool for the child to climb onto. It produces the toothbrush and toothpaste for the child to use.

When a Sim walks up to the easel to paint, Function 42 puts a palette and paintbrush into the Sim's hands.

When a Sim reaches for a plate of food from the meal that has been served and walks away with his own plate of food in his hand — that's Function 42 in action.

Let's experiment a bit with functions. Open IFF and bring in your chair. Select BHAV, and then double click Behavior #4110 "init Very Expensive" to open it. We are only exploring, so please do not save anything we do unless I ask you.


Fig. 1.2

 

Continued on Next Page . . .