Re: Star Wars The Force Unleashed - PC Version .z files
Posted: Wed Dec 16, 2009 6:09 pm
i would be willing to help out with the mesh skinning and animation data. i will take a look when i get the chance.
Game Research Forum
https://forum.xentax.com/
Thank you for this info, I tried to run your maxscript with 3ds Max 2009 but it produces an error:UberBlack wrote:Chrrox and I have been working on the Unleashed model format. Here is a picture of a StormTrooper that we ripped. The ripping is not yet automated, yet if you would like the script it will be posted on my blog when complete: http://uberblack3d.blogspot.com/
Note: All the mesh formats with UV's have been discovered and is able to be imported into max via Script.
The first link is for the Storm Trooper model, and Animations. I have also included the Alpha of the 3DSMax script that we are still working on for other's to critique or improve.
Storm Trooper Mesh & Animations
http://www.sendspace.com/file/gvvi7s
Code: Select all
-- Error occurred during fileIn in <File:C:\Program Files\Autodesk\3ds Max 2009\Scripts\StarWarsUnleashed_StormTrooper.ms>
>> MAXScript FileIn Exception: -- Unable to convert: undefined to type: Integer <<
Code: Select all
-- Error occurred in i loop; filename: C:\Program Files\Autodesk\3ds Max 2009\Scripts\StarWarsUnleashed_StormTrooper.ms; position: 708
-- Frame:
-- i: 391646
-- f3: undefined
-- Error occurred during fileIn in <File:C:\Program Files\Autodesk\3ds Max 2009\Scripts\StarWarsUnleashed_StormTrooper.ms>
>> MAXScript FileIn Exception: -- No ""+"" function for undefined <<
Code: Select all
-- Error occurred in i loop; filename: C:\Program Files\Autodesk\3ds Max 2009\Scripts\StarWarsUnleashed_scrapDrone_LOD1.ms; position: 1390
-- Frame:
-- vy: undefined
-- tv: undefined
-- nz: undefined
-- boneweight5: undefined
-- boneweight2: undefined
-- tu: undefined
-- vx: undefined
-- i: 11471
-- ny: undefined
-- boneweight4: undefined
-- boneweight1: undefined
-- vz: undefined
-- nx: undefined
-- boneweight3: undefined
-- Error occurred during fileIn in <File:C:\Program Files\Autodesk\3ds Max 2009\Scripts\StarWarsUnleashed_scrapDrone_LOD1.ms>
>> MAXScript FileIn Exception: -- Unable to convert: undefined to type: Float <<
Code: Select all
-- Error occurred during fileIn in <File:C:\Program Files\Autodesk\3ds Max 2009\Scripts\StarWarsUnleashed_scrapDrone.ms>
>> MAXScript FileIn Exception: -- Unable to convert: undefined to type: Integer <<
Code: Select all
>> MAXScript FileIn Exception: -- No ""+"" function for undefined <<
-- Error occurred in i loop; filename: C:\Program Files\Autodesk\3ds Max 2009\Scripts\StarWarsUnleashed_Train_FloorA.ms; position: 635
-- Frame:
-- i: 44678
-- f3: undefined
-- Error occurred during fileIn in <File:C:\Program Files\Autodesk\3ds Max 2009\Scripts\StarWarsUnleashed_Train_FloorA.ms>
>> MAXScript FileIn Exception: -- No ""+"" function for undefined <<
Code: Select all
-- No ""+"" function for undefined
Code: Select all
/*****************************************************************************
* gto.bt - Structure definitions for Star Wars The Force Unleashed - gto file related entities.
*
* File strucutre for gto files
*
*****************************************************************************
* Revision History:
* 2009/12/16 - GWC - Original
* 2009/12/20 - GWC - Updates to format
*/
#include "common-types.bt"
SetReadOnly(true);
// #pragma displayname("gto structures")
// #pragma fileextensions(".gto")
// #pragma byteorder(little_endian)
LittleEndian();
// mark used bytes with a light green background
SetBackColor(cLtGreen);
// GTO File Structure
struct GTO_FILE
{
// #pragma lockAt(0x00000000)
// GTO File Header Structure - 0x14 (20) bytes
struct GTO_HEADER
{
// 0x00
uint32 fileTag; // GTO magic number 0x29F
uint32 stringCount;
uint32 objectCount;
uint32 fileVersion;
// 0x10
uint32 fileFlags;
} fileHeader; // file header
struct
{
struct
{
string name;
} stringTable[fileHeader.stringCount] <optimize = false>;
} stringTable;
struct
{
uint16 nameIndex <format = hex>;
uint16 protocolIndex <format = hex>;
uint16 protocolVersion <format = hex>;
uint16 componentCount <format = hex>;
} objectData[fileHeader.objectCount];
local uint32 componentCount = 0;
local uint32 objectNum = 0;
for (objectNum = 0; objectNum < fileHeader.objectCount; ++objectNum)
{
componentCount += objectData[objectNum].componentCount;
}
Printf("Component Count = 0x%02X (%d)\n", componentCount, componentCount);
struct
{
uint16 nameIndex <format = hex>;
uint16 propertyCount <format = hex>;
} componentData[componentCount];
local uint32 propertyCount = 0;
local uint32 componentNum = 0;
for (componentNum = 0; componentNum < componentCount; ++componentNum)
{
propertyCount += componentData[componentNum].propertyCount;
}
Printf("Property Count = 0x%02X (%d)\n", propertyCount, propertyCount);
struct
{
uint16 nameIndex <format = hex>;
uint16 unknown0x02 <format = hex>;
uint32 dataCount <format = hex>;
uint8 dataType <format = hex>;
uint8 dataWidth <format = hex>;
uint16 unknown0x0A <format = hex>;
} propertyInfo[propertyCount];
local uint32 propertyNum = 0;
struct
{
for (propertyNum = 0; propertyNum < propertyCount; ++propertyNum)
{
struct
{
switch (propertyInfo[propertyNum].dataType)
{
case 0: // int32
int32 data[propertyInfo[propertyNum].dataCount * propertyInfo[propertyNum].dataWidth];
break;
case 1: // float
float data[propertyInfo[propertyNum].dataCount * propertyInfo[propertyNum].dataWidth];
break;
case 2: // double
double data[propertyInfo[propertyNum].dataCount * propertyInfo[propertyNum].dataWidth];
break;
case 3: // float16
uint16 data[propertyInfo[propertyNum].dataCount * propertyInfo[propertyNum].dataWidth];
break;
case 4: // string table index
uint32 data[propertyInfo[propertyNum].dataCount * propertyInfo[propertyNum].dataWidth];
break;
case 6: // uint16
uint16 data[propertyInfo[propertyNum].dataCount * propertyInfo[propertyNum].dataWidth];
break;
case 7: // uint8
uint8 data[propertyInfo[propertyNum].dataCount * propertyInfo[propertyNum].dataWidth];
break;
case 8: // int64
int64 data[propertyInfo[propertyNum].dataCount * propertyInfo[propertyNum].dataWidth];
break;
default:
Printf("Unknown data format\n");
break;
}
} propertyData;
}
} propertyData;
};
struct GTO_FILE fileInfo;
Code: Select all
Executing template 'C:\Documents and Settings\revel8n\My Documents\SweetScape\010 Templates\games\swtfu\GTOTemplate1.bt' on 'C:\Projects\emulation\swtfu\extract\tropperStormClassic\ma_trooperStormClassic.gto'...
String Table Count = 0xAD (173)
Object Count = 0x09 (9)
Component Count = 0x20 (32)
Property Count = 0xCA (202)
--------------------------------------------------------
Object [0000] - Component Count: 1 - Identifier: ma_trooperStormClassic
Component [0000] - Property Count: 3 - Identifier: Info
Property [0000] - Identifier: Platform
Property [0001] - Identifier: PlatformVersion
Property [0002] - Identifier: MexVersion
--------------------------------------------------------
Object [0001] - Component Count: 1 - Identifier: ma_trooperStormClassic
Component [0000] - Property Count: 17 - Identifier: Model
Property [0003] - Identifier: Name
Property [0004] - Identifier: CRC
Property [0005] - Identifier: NumVertices
Property [0006] - Identifier: NumPrimitives
Property [0007] - Identifier: Breakable
Property [0008] - Identifier: TetMaxNodeCount
Property [0009] - Identifier: BBoxCenter
Property [0010] - Identifier: BBoxExtents
Property [0011] - Identifier: RawPolyVertCounts
Property [0012] - Identifier: RawVertIndices
Property [0013] - Identifier: NumMeshes
Property [0014] - Identifier: NumMaterials
Property [0015] - Identifier: locatorCount
Property [0016] - Identifier: locators
Property [0017] - Identifier: mayaAttrCount
Property [0018] - Identifier: mayaAttrNameCrcs
Property [0019] - Identifier: mayaAttrOwnerCrcs
--------------------------------------------------------
Object [0002] - Component Count: 1 - Identifier: ma_trooperStormClassic
Component [0000] - Property Count: 3 - Identifier: Material
Property [0020] - Identifier: CRC
Property [0021] - Identifier: Name
Property [0022] - Identifier: Data
--------------------------------------------------------
Object [0003] - Component Count: 1 - Identifier: ma_trooperStormClassic
Component [0000] - Property Count: 5 - Identifier: Skeleton
Property [0023] - Identifier: NumBones
Property [0024] - Identifier: BasePoseMatrices
Property [0025] - Identifier: BoneNames
Property [0026] - Identifier: BoneCRCs
Property [0027] - Identifier: BoneParents
--------------------------------------------------------
Object [0004] - Component Count: 1 - Identifier: PlaceholderMeshName_submesh
Component [0000] - Property Count: 13 - Identifier: MeshInfo
Property [0028] - Identifier: MaterialCrc
Property [0029] - Identifier: MaterialName
Property [0030] - Identifier: BBoxCenter
Property [0031] - Identifier: BBoxExtents
Property [0032] - Identifier: NumWeights
Property [0033] - Identifier: LightmapUVIndex
Property [0034] - Identifier: SubmeshNameCrc
Property [0035] - Identifier: SubmeshName
Property [0036] - Identifier: UniqueSubmeshNameCrc
Property [0037] - Identifier: UniqueSubmeshName
Property [0038] - Identifier: InteriorFaces
Property [0039] - Identifier: NumBones
Property [0040] - Identifier: BonePalette
--------------------------------------------------------
Object [0005] - Component Count: 13 - Identifier: PlaceholderMeshName_submesh
Component [0000] - Property Count: 7 - Identifier: GeometryInfo
Property [0041] - Identifier: NumVerts
Property [0042] - Identifier: PrimitiveType
Property [0043] - Identifier: NumPrimitives
Property [0044] - Identifier: ives
Property [0045] - Identifier: VertexFormat
Property [0046] - Identifier: NumVertexElements
Property [0047] - Identifier: NumVertexBuffers
Component [0001] - Property Count: 5 - Identifier: Indices
Property [0048] - Identifier: NumIndices // // 0x12C38
Property [0049] - Identifier: MinVertexIndex
Property [0050] - Identifier: NumVertexIndices
Property [0051] - Identifier: StartIndex
Property [0052] - Identifier: IndexData
Component [0002] - Property Count: 4 - Identifier: Stream0
Property [0053] - Identifier: VertexData
Property [0054] - Identifier: VertexStride
Property [0055] - Identifier: NumBufferVerts
Property [0056] - Identifier: VertexFlags
Component [0003] - Property Count: 4 - Identifier: Stream1
Property [0057] - Identifier: VertexData
Property [0058] - Identifier: VertexStride
Property [0059] - Identifier: NumBufferVerts
Property [0060] - Identifier: VertexFlags
Component [0004] - Property Count: 6 - Identifier: VertexDecl
Property [0061] - Identifier: Stream
Property [0062] - Identifier: Offset
Property [0063] - Identifier: Type
Property [0064] - Identifier: Method
Property [0065] - Identifier: Usage
Property [0066] - Identifier: UsageIndex
Component [0005] - Property Count: 6 - Identifier: VertexDecl
Property [0067] - Identifier: Stream
Property [0068] - Identifier: Offset
Property [0069] - Identifier: Type
Property [0070] - Identifier: Method
Property [0071] - Identifier: Usage
Property [0072] - Identifier: UsageIndex
Component [0006] - Property Count: 6 - Identifier: VertexDecl
Property [0073] - Identifier: Stream
Property [0074] - Identifier: Offset
Property [0075] - Identifier: Type
Property [0076] - Identifier: Method
Property [0077] - Identifier: Usage
Property [0078] - Identifier: UsageIndex
Component [0007] - Property Count: 6 - Identifier: VertexDecl
Property [0079] - Identifier: Stream
Property [0080] - Identifier: Offset
Property [0081] - Identifier: Type
Property [0082] - Identifier: Method
Property [0083] - Identifier: Usage
Property [0084] - Identifier: UsageIndex
Component [0008] - Property Count: 6 - Identifier: VertexDecl
Property [0085] - Identifier: Stream
Property [0086] - Identifier: Offset
Property [0087] - Identifier: Type
Property [0088] - Identifier: Method
Property [0089] - Identifier: Usage
Property [0090] - Identifier: UsageIndex
Component [0009] - Property Count: 6 - Identifier: VertexDecl
Property [0091] - Identifier: Stream
Property [0092] - Identifier: Offset
Property [0093] - Identifier: Type
Property [0094] - Identifier: Method
Property [0095] - Identifier: Usage
Property [0096] - Identifier: UsageIndex
Component [0010] - Property Count: 6 - Identifier: VertexDecl
Property [0097] - Identifier: Stream
Property [0098] - Identifier: Offset
Property [0099] - Identifier: Type
Property [0100] - Identifier: Method
Property [0101] - Identifier: Usage
Property [0102] - Identifier: UsageIndex
Component [0011] - Property Count: 6 - Identifier: VertexDecl
Property [0103] - Identifier: Stream
Property [0104] - Identifier: Offset
Property [0105] - Identifier: Type
Property [0106] - Identifier: Method
Property [0107] - Identifier: Usage
Property [0108] - Identifier: UsageIndex
Component [0012] - Property Count: 6 - Identifier: VertexDecl
Property [0109] - Identifier: Stream
Property [0110] - Identifier: Offset
Property [0111] - Identifier: Type
Property [0112] - Identifier: Method
Property [0113] - Identifier: Usage
Property [0114] - Identifier: UsageIndex
--------------------------------------------------------
Object [0006] - Component Count: 1 - Identifier: PlaceholderMeshName_submesh
Component [0000] - Property Count: 13 - Identifier: MeshInfo
Property [0115] - Identifier: MaterialCrc
Property [0116] - Identifier: MaterialName
Property [0117] - Identifier: BBoxCenter
Property [0118] - Identifier: BBoxExtents
Property [0119] - Identifier: NumWeights
Property [0120] - Identifier: LightmapUVIndex
Property [0121] - Identifier: SubmeshNameCrc
Property [0122] - Identifier: SubmeshName
Property [0123] - Identifier: UniqueSubmeshNameCrc
Property [0124] - Identifier: UniqueSubmeshName
Property [0125] - Identifier: InteriorFaces
Property [0126] - Identifier: NumBones
Property [0127] - Identifier: BonePalette
--------------------------------------------------------
Object [0007] - Component Count: 13 - Identifier: PlaceholderMeshName_submesh
Component [0000] - Property Count: 7 - Identifier: GeometryInfo
Property [0128] - Identifier: NumVerts
Property [0129] - Identifier: PrimitiveType
Property [0130] - Identifier: NumPrimitives
Property [0131] - Identifier: ives
Property [0132] - Identifier: VertexFormat
Property [0133] - Identifier: NumVertexElements
Property [0134] - Identifier: NumVertexBuffers
Component [0001] - Property Count: 5 - Identifier: Indices
Property [0135] - Identifier: NumIndices // 0x54DBE
Property [0136] - Identifier: MinVertexIndex
Property [0137] - Identifier: NumVertexIndices
Property [0138] - Identifier: StartIndex
Property [0139] - Identifier: IndexData
Component [0002] - Property Count: 4 - Identifier: Stream0
Property [0140] - Identifier: VertexData
Property [0141] - Identifier: VertexStride
Property [0142] - Identifier: NumBufferVerts
Property [0143] - Identifier: VertexFlags
Component [0003] - Property Count: 4 - Identifier: Stream1
Property [0144] - Identifier: VertexData
Property [0145] - Identifier: VertexStride
Property [0146] - Identifier: NumBufferVerts
Property [0147] - Identifier: VertexFlags
Component [0004] - Property Count: 6 - Identifier: VertexDecl
Property [0148] - Identifier: Stream
Property [0149] - Identifier: Offset
Property [0150] - Identifier: Type
Property [0151] - Identifier: Method
Property [0152] - Identifier: Usage
Property [0153] - Identifier: UsageIndex
Component [0005] - Property Count: 6 - Identifier: VertexDecl
Property [0154] - Identifier: Stream
Property [0155] - Identifier: Offset
Property [0156] - Identifier: Type
Property [0157] - Identifier: Method
Property [0158] - Identifier: Usage
Property [0159] - Identifier: UsageIndex
Component [0006] - Property Count: 6 - Identifier: VertexDecl
Property [0160] - Identifier: Stream
Property [0161] - Identifier: Offset
Property [0162] - Identifier: Type
Property [0163] - Identifier: Method
Property [0164] - Identifier: Usage
Property [0165] - Identifier: UsageIndex
Component [0007] - Property Count: 6 - Identifier: VertexDecl
Property [0166] - Identifier: Stream
Property [0167] - Identifier: Offset
Property [0168] - Identifier: Type
Property [0169] - Identifier: Method
Property [0170] - Identifier: Usage
Property [0171] - Identifier: UsageIndex
Component [0008] - Property Count: 6 - Identifier: VertexDecl
Property [0172] - Identifier: Stream
Property [0173] - Identifier: Offset
Property [0174] - Identifier: Type
Property [0175] - Identifier: Method
Property [0176] - Identifier: Usage
Property [0177] - Identifier: UsageIndex
Component [0009] - Property Count: 6 - Identifier: VertexDecl
Property [0178] - Identifier: Stream
Property [0179] - Identifier: Offset
Property [0180] - Identifier: Type
Property [0181] - Identifier: Method
Property [0182] - Identifier: Usage
Property [0183] - Identifier: UsageIndex
Component [0010] - Property Count: 6 - Identifier: VertexDecl
Property [0184] - Identifier: Stream
Property [0185] - Identifier: Offset
Property [0186] - Identifier: Type
Property [0187] - Identifier: Method
Property [0188] - Identifier: Usage
Property [0189] - Identifier: UsageIndex
Component [0011] - Property Count: 6 - Identifier: VertexDecl
Property [0190] - Identifier: Stream
Property [0191] - Identifier: Offset
Property [0192] - Identifier: Type
Property [0193] - Identifier: Method
Property [0194] - Identifier: Usage
Property [0195] - Identifier: UsageIndex
Component [0012] - Property Count: 6 - Identifier: VertexDecl
Property [0196] - Identifier: Stream
Property [0197] - Identifier: Offset
Property [0198] - Identifier: Type
Property [0199] - Identifier: Method
Property [0200] - Identifier: Usage
Property [0201] - Identifier: UsageIndex
--------------------------------------------------------
Object [0008] - Component Count: 0 - Identifier: ma_trooperStormClassic