LESSON 1 - Part A: Variables, Parameters, Attributes and Constants

Attributes (continued)

Now, look at this example. I took one of the stands where Sims can purchase items,and modified it so instead of the Sim walking up to the counter and buying only one of the item, the Sim could buy 20 at once.


Fig. 1.5

Notice Lines 14, 15, 17, and 18. Maxis had it so that the Sim could buy one of this and 1 of that. Then, look at line 16. I changed it so that the Sim could buy 20 of that particular item. Line 20 could be magazines, or a carrot. It doesn't matter. You can assign all carrots to be stored in Attribute 2.

Lesson 1 - Part B:  Person Type, Gender & Globals

I like to start the class somewhat slow and build momentum as we go. Therefore, the next thing I want to introduce in this class is Person Type. As you know, the game has NPC's (non-playable characters), adult females and males, child females and males, and pets which are defined simply as either male or female. We can refer to each type singularly in statements (lines within a behavior) or globally.

To learn about person types, we are going to create some doors. We could use any object, of course, but doors are easily handled, so I think it is best to start with there. Those of you who are graduates of the Entry Level class will already have a Code Book started, and also a notebook containing important notes for future use.

For those of you new to Sims college, we always work with a notebook (any kind) and pen nearby so as to be able to write down bits and pieces that are relevant to our work. Doing so will eliminate the "what was that?" factor as you flip back and forth in your object. The Code Book is a notebook or a spreadsheet in your computer where we write bits of code also to be used whenever we hack.

Alright, then. Let's get started by going into the Class Folder I earlier asked you to create. Create another folder inside it and call it "Doors". In this Doors Folder is where you will store your doors during the testing stages.