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

Constants

Constants:  Constants are numerical values stored in the .iff file itself. They're read only, so they aren't quite like the other variables. Constants are stored in the BCON section of an object. We can add to the Constants already found in the object, we can modify the existing ones, or we can delete them; and indeed, Constants are the easiest to work with.


Fig. 1.3

Attributes

Attributes:  Unlike Temporary Storage above, where the information stored is deleted upon exiting the game, the values stored in Attributes will remain. Each attribute stores one numerical value, and the value can represent just about anything. An example is when you go into a Community Lot to purchase something... say, a dog collar. You walk up to the collar stand and you "Buy a blue dog collar". The attribute was set by Maxis to 1. But you could easily go in and fix it so a player can buy more than one item at a time.

You will see Attributes in one of two ways:  My Attribute and Stack Obj's Attribute.

An example would be the Trash Can. If you open the Trash Can, go to BHAV, and then open #4104 "functional dispose", you would see the Stack Obj's Attribute lines:


Fig. 1.4