Difference between revisions of "Sims 3:Catalog Resource"

From SimsWiki
Jump to: navigation, search
m
(Fix up Material Block description)
Line 62: Line 62:
 
  DWORD tgi offset // see [[Sims 3:Key table]]
 
  DWORD tgi offset // see [[Sims 3:Key table]]
 
  DWORD tgi size // see [[Sims 3:Key table]]
 
  DWORD tgi size // see [[Sims 3:Key table]]
  --insert MaterialBlock
+
  --insert [[#Material Block|Material Block]]
 
  --insert TGI Block List // see [[Sims 3:Key table]]
 
  --insert TGI Block List // see [[Sims 3:Key table]]
 
  DWORD
 
  DWORD
Line 70: Line 70:
 
  DWORD
 
  DWORD
 
====Material Block====
 
====Material Block====
This block holds the variables used in the complate to render a texture, equivalent to the preset XML used for CAS parts.
+
This block holds the variables used in the complate to render a texture, equivalent to the preset XML used for CAS parts.  [[Sims 3:Key table|TGI Block List]] indexes refer to the TGI Block List following this Material Block.
<pre>
+
BYTE index // [[Sims 3:Key table|TGI Block List]] entry for Complate XML to which these variables should be applied
BYTE index //Points to the complate XML in the TGI index where the variables should be applied
+
--insert data for typecode 0x01 // see [[#Typecodes|below]]
--insert data for typecode 0x01 // see below
+
--insert data for typecode 0x01 // see [[#Typecodes|below]]
--insert data for typecode 0x01 // see below
+
DWORD count1
DWORD count1
+
--repetition count1 Type Code List:
--repetition count1 Type Code List:
+
BYTE controlCode
--insert data for typecode 0x01 ComplateVariable
+
--if controlCode is 0x40:
BYTE typecode
+
BYTE[] // padding with 0x40 bytes, does not count as a list entry
--insert data for typecode // see below
+
--else if controlCode is 0x2F:
}
+
--insert data for typecode 0x2F // see [[#Typecodes|below]]
DWORD count2
+
--else
--repeat(count2)
+
BYTE
Material Block // sub-blocks used for pattern definitions
+
BYTE typecode
</pre>
+
--insert data for typecode // see [[#Typecodes|below]]
 +
DWORD count2
 +
--repeat(count2)
 +
Material Block // sub-blocks used for pattern definitions
  
 
=====Complate Variables=====
 
=====Complate Variables=====
Complate variables are referenced by the same strings as they are in the [[Sims 3:0x044AE110|complate XML]].  All the standard complate elements are indexed in the [[/StringTable|string table]] so are not typically included as a literal string. <!--Here are a few samples of what the values are, f-->For a full list see the [[/StringTable|string table]].
+
Complate variables are referenced by the same strings as they are in the [[Sims 3:0x044AE110|complate XML]].  All the standard complate elements are indexed via the [[/StringTable|string table]] so are not typically included as a literal string.
<!--I've commented all this out as it's duplication of what's on /StringTable.  Best (IMO ;)) to keep maintenance down by having the information appear only once. -- PLJ -->
+
<!--
+
For main material block:
+
DaeFileName = 0x5,
+
BackgroundImage = 0x0b,
+
RGBMask = 0x13,
+
Multiplier = 0x14,
+
Specular = 0x17,
+
Overlay = 0x18,
+
StencilA = 0x20,
+
StencilB = 0x21,
+
StencilC = 0x22,
+
StencilD = 0x23,
+
StencilAEnabled = 0x24,
+
StencilBEnabled = 0x25,
+
StencilCEnabled = 0x26,
+
StencilDEnabled = 0x27,
+
StencilATiling = 0x28,
+
StencilBTiling = 0x29,
+
StencilCTiling = 0x2a,
+
StencilDTiling = 0x2b,
+
StencilARotation = 0x2c,
+
StencilBRotation = 0x2d,
+
StencilCRotation = 0x2e,
+
StencilDRotation = 0x2f,
+
PatternA = 0x30,
+
PatternB = 0x31,
+
PatternC = 0x32,
+
PatternAEnabled = 0x33,
+
PatternBEnabled = 0x34,
+
PatternCEnabled = 0x35,
+
PatternALinked = 0x36,
+
PatternBLinked = 0x37,
+
PatternCLinked = 0x38,
+
PatternARotation = 0x39,
+
PatternBRotation = 0x3a,
+
PatternCRotation = 0x3b,
+
PatternATiling = 0x3c,
+
PatternBTiling = 0x3d,
+
PatternCTiling = 0x3e,
+
 
+
The variables in the sub material section (used for pattern variables) have their own types:
+
BackgroundImageName = 0x1,
+
DDS1 = 0x04,
+
Color = 0x07,
+
RgbMask = 0x09,
+
SpecMap = 0x0a,
+
BackgroundImageIndex = 0x0b,
+
HSVShiftBg = 0x0c,
+
HBg = 0x0d,
+
VBg = 0x0e,
+
SBg = 0x0f,
+
BaseHBg = 0x10,
+
BaseSBg = 0x11,
+
BaseVBg = 0x12,
+
DDS2 = 0x15,
+
DDS3 = 0x16,
+
 
+
These lists are not complete and for the pattern section there are some inconsistencies between complates
+
-->
+
 
+
 
=====Typecodes=====
 
=====Typecodes=====
 
{| border="1"
 
{| border="1"
Line 169: Line 111:
 
| 0x03
 
| 0x03
 
| (BYTE)
 
| (BYTE)
| Index to TGI table below
+
| [[Sims 3:Key table|TGI Block List]] entry
 
|-
 
|-
 
| 0x04
 
| 0x04

Revision as of 12:07, 17 February 2010

Tutorials:TS3 Advanced Coding Tutorials


Contents

Overview

The following resource types are used for catalog entries.

Type ID Tag Name
0x0418FE2A CFEN Catalog Fence
0x049CA4CD CSTR Catalog Stairs
0x04AC5D93 CPRX Catalog Proxy Product
0x04B30669 CTTL Catalog Terrain Geometry Brush
0x04C58103 CRAL Catalog Railing
0x04ED4BB2 CTPT Catalog Terrain Paint Brush
0x04F3CC01 CFIR Catalog Fireplace
0x060B390C CWAT Catalog Terrain Water Brush
0x316C78F2 CFND Catalog Foundation
0x319E4F1D OBJD Catalog Object
0x515CA4CD CWAL Catalog Wall/Floor Pattern
0x9151E6BC CWST Catalog Wall Style
0x91EDBD3E CRST Catalog Roof Style
0xF1EDBD86 CRMT Catalog Roof Pattern

Format

Common

This block appears in all Catalog Resources. The name and description GUIDs can be looked up in the STBL.

DWORD Version // 0x0000000c except for a few 0x0000000d in EP1
QWORD Name GUID //from STBL
QWORD Desc GUID //from STBL
7BITSTR // Catalog Name entry
7BITSTR // Catalog Desc entry
FLOAT price
FLOAT //always 1.0
4BYTE //binary zeros
BYTE
QWORD I64 of PNG icon //usually 0
--if Version >= 0x0000000D
	BYTE

Material List

This section is only present in Objects and Wall/Floor Patterns; it differs slightly between the two, as annotated.

DWORD Count1
--repetition Count1 Material:
	BYTE type
	if (type != 1) DWORD
	DWORD offset		// from here to after TGI Block List
	WORD
	DWORD tgi offset	// see Sims 3:Key table
	DWORD tgi size		// see Sims 3:Key table
	--insert Material Block
	--insert TGI Block List	// see Sims 3:Key table
	DWORD
	--if Wall/Floor Style:
		DWORD
		DWORD
		DWORD

Material Block

This block holds the variables used in the complate to render a texture, equivalent to the preset XML used for CAS parts. TGI Block List indexes refer to the TGI Block List following this Material Block.

BYTE index			// TGI Block List entry for Complate XML to which these variables should be applied
--insert data for typecode 0x01 // see below
--insert data for typecode 0x01 // see below
DWORD count1
--repetition count1 Type Code List:
	BYTE controlCode
	--if controlCode is 0x40:
		BYTE[]		// padding with 0x40 bytes, does not count as a list entry
	--else if controlCode is 0x2F:
		--insert data for typecode 0x2F	// see below
	--else
		BYTE
		BYTE typecode
		--insert data for typecode	// see below
DWORD count2
--repeat(count2)
	Material Block		// sub-blocks used for pattern definitions
Complate Variables

Complate variables are referenced by the same strings as they are in the complate XML. All the standard complate elements are indexed via the string table so are not typically included as a literal string.

Typecodes
Typecode Data Comments
0x01 BYTE flags
If (flags & 0x40 set) - read a byte; else use (flags & 0x3F); call this "index"
If (flags & 0x80 set) - a string, length is "index"
If (flags & 0x80 clear) - a string from the string table, identified by "index"
0x02 (BYTE)(BYTE)(BYTE)(BYTE) RGBA color
0x03 (BYTE) TGI Block List entry
0x04 (FLOAT)
0x05 (FLOAT)(FLOAT)
0x06 (FLOAT)(FLOAT)(FLOAT)
0x07 (BYTE) Boolean

Tutorials:TS3 Advanced Coding Tutorials

Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox