Insimenator.org
March 29, 2024, 04:28:05 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home   Forum   Help Search Calendar Login Register  
Pages: [1]
  Print  
Author Topic: Constant Value vs. Literal Value  (Read 4460 times)
0 Members and 1 Chinese Bot are viewing this topic.
Eric
BANNED
Member

Posts: 1404


View Profile
« 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.
Logged
Pages: [1]
  Print  
 
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.032 seconds with 31 queries.
SimplePortal 2.1.1