Difference between revisions of "42484156"
m |
|||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | = | + | {{Resource tgi |
+ | |short = BHAV | ||
+ | |long = Behavior function | ||
+ | }} | ||
+ | |||
This resource contains the [[SimAntics]] subroutines. | This resource contains the [[SimAntics]] subroutines. | ||
Line 23: | Line 27: | ||
:Number of local variables used in the subroutine | :Number of local variables used in the subroutine | ||
;Byte | ;Byte | ||
− | :Header flag ( | + | :Header flag (deprecated) |
;DWORD | ;DWORD | ||
:Tree version number (signed integer) | :Tree version number (signed integer) | ||
Line 93: | Line 97: | ||
====Notes==== | ====Notes==== | ||
− | The 1-byte Goto statements in 8001-8006 appear to use the same codes as was used in [[The Sims 1]]: *0xFD as Error | + | The 1-byte Goto statements in 8001-8006 appear to use the same codes as was used in [[The Sims 1]]: |
+ | *0xFD as Error | ||
*0xFE as True | *0xFE as True | ||
*0xFF as False. | *0xFF as False. | ||
Line 116: | Line 121: | ||
*0x8008 & 0x8009 introduced later | *0x8008 & 0x8009 introduced later | ||
− | {{ | + | {{OldWikiEntryCleaned|42484156|BHAV}} |
− | + | ||
− | [[Category:Modding]] | + | [[Category:Sims 2 Modding]] |
[[Category:InternalFormats]] | [[Category:InternalFormats]] | ||
[[Category:FormatsByTGI]] | [[Category:FormatsByTGI]] |
Latest revision as of 18:24, 17 September 2012
42484156 | |
---|---|
Short name: | BHAV |
Long name: | Behavior function |
This resource contains the SimAntics subroutines.
Contents |
[edit] Format
- 64 bytes
- File name (null terminated)
- 12 bytes
- (see Header Format below)
- for each entry
- variable
- (see Entry Format below)
[edit] Header Format
- WORD
- Signature (0x8000 through 0x8009)
- WORD
- Number of instructions in subroutine
- Byte
- tree type (deprecated)
- Byte
- Number of parameters passed to the subroutine
- Byte
- Number of local variables used in the subroutine
- Byte
- Header flag (deprecated)
- DWORD
- Tree version number (signed integer)
[edit] Entry Format
The signature defines the structure of the each instruction.
[edit] 8000, 8001 & 8002
(instruction length: 12 bytes)
- WORD
- Function/OpCode
- Byte
- Goto on true
- Byte
- Goto on false
- 8 bytes
- Operands
[edit] 8003 & 8004
(instruction length: 20 bytes)
- WORD
- Function/OpCode
- Byte
- Goto on true
- Byte
- Goto on false
- 16 bytes
- Operands
[edit] 8005 & 8006
(instruction length: 21 bytes)
- WORD
- Function/OpCode
- Byte
- Goto on True
- Byte
- Goto on False
- Byte
- Node version (Flag - 0x00 or 0x01)
- 16 bytes
- Operands
[edit] 8007 & 8008
(instruction length: 23 bytes)
- WORD
- Function/OpCode
- WORD
- Goto on true
- WORD
- Goto on false
- Byte
- Node version (Flag - 0x00 or 0x01)
- 16 bytes
- Operands
[edit] 8009
(instruction length: 24 bytes)
- WORD
- Function/OpCode
- WORD
- Goto on true
- WORD
- Goto on false
- Byte
- Node version (Flag - 0x00 or 0x01)
- 16 bytes
- Operands
- Byte
- Cache flags
[edit] Notes
The 1-byte Goto statements in 8001-8006 appear to use the same codes as was used in The Sims 1:
- 0xFD as Error
- 0xFE as True
- 0xFF as False.
The 2-byte Goto statements in 8007-8009 use these Goto codes:
- 0xFFFC as Error
- 0xFFFD as True
- 0xFFFE as False.
The 8007-8009 formats can contain more than 256 seperate instructions, thus the use of 2-byte Goto statements.
[edit] Notes
Number of each signature type (0x8000 - 0x8007) contained in (original) objects.package:
- 0x8000 - 1
- 0x8001 - 2
- 0x8002 - 25
- 0x8003 - 75
- 0x8004 - 4
- 0x8005 - 285
- 0x8006 - 1,357
- 0x8007 - 15,507
- 0x8008 & 0x8009 introduced later
This article is one of several on this topic imported from the old MTS2 wiki. It's original pages, with comments, can be found at http://old_wiki.modthesims2.com/42484156 and http://old_wiki.modthesims2.com/BHAV