Giving the Player Attributes

Everything the player has or uses in a level must be predefined as an attribute before it is available to the player. This includes such things as health, stamina and ammunition for weapons. If these items are not predefined then you cannot acquire them from an Attribute entity. In the PlayerSetup entity there is an entry called AttributeInfoFile. This is the name of the file that contains all the predefined player attributes. The default Reality Factory AttributeInfoFile is called player.ini, although you can change it to any file you wish.

The AttributeInfoFile is a text file that can be edited with any text editor, such as NotePad. It is laid out very much like a standard Windows INI file, with each attribute having its own section. The name of the attribute is enclosed in square brackets such as [health] or [light]. Each line after the attribute name, up to the next section, contains the values used for that attribute. Every attribute requires a low value, which is the minimum amount this attribute can decrease to, a high value, which is the maximum amount of this attribute you can acquire, and the initial value, which is the amount of this attribute that the player starts the game with. These values are assigned in the form:

initial =
low =
high =

Leading and trailing spaces are ignored. The initial value is used to start the player off with such things as health or a limited amount of ammunition.

Some attributes are required if you wish to make use of all the features built-in to Reality Factory. The player automatically receives a health attribute but the high value is only 1. This keeps the player alive if no AttributeInfoFile is specified. Therefore, a health attribute is required if any fighting is to take place. Also, the player can acquire a light from an Attribute entity (attribute name is light) so a light attribute must be predefined in order to use it. If you are using the default melee weapons they require stamina in order to inflict damage so a stamina attribute must also be predefined. Stamina can automatically increase over time (see PlayerSetup entity). If there is an oxygen attribute defined it will be set at maximum when ever the player is not submerged in a liquid. All weapons require ammunition so these attributes must be predefined in order to use them. The default player.ini file contains these predefines for the standard Reality Factory setup, although you may wish to change the values.