Insimenator.org

Simmers' Paradise => Modding Database => Topic started by: Eric on August 28, 2005, 05:53:07 pm



Title: Constant Value vs. Literal Value
Post by: Eric on August 28, 2005, 05:53:07 pm
Constant Values are stored in BCON files.  The ID of a Constant does not always equal the value assigned to the Constant.  Global and semiglobal BCON files can be changed by Expansion Packs as they are released, and may interfere with your object's functionality if you are using the Literal Value that equals the Constant Value instead of the Constant itself.

Literal Values are assigned by the object creator within an objects script and will not change with the release of an Expansion Pack.  Literal Values (if needed) must be manually changed by a creator/modder.

-------------------------------------------------------------

At this time, both of the following 2 lines of script achieve the same result, they allow you to place an object on the mantle of a fireplace.


ex. 1: (using Literal Value)
My 0x0004 Set Flag Literal Value 0x000B


ex. 2: (using Constant Value)
My 0x0004 Set Flag Constant Value 0x0101:0x0B
0x0101 is the global BCON file that the constant is stored in.
0x0B is the Constant Value ID.


When using the Constant Value, if 0x0B equals B before an Expansion Pack is released and then equals 6 after the Expansion Pack is released, you will still be able to place your object on the mantle.  If you were using the Literal Value of 0x000B to set the flag, your object would no longer be able to sit on a Mantle because the global flag value was changed by Maxis.

-------------------------------------------------------------

When assigning flag values, that are used globally or semiglobally, to an object, it is always better to use the games Constant Values (if they exist) instead of Literal Values.



Feel free to offer your input and/or correct errors on my part.


SimplePortal 2.1.1