Star Wars The Force Unleashed - PC Version .z files

The Original Forum. Game archives, full of resources. How to open them? Get help here.
revelation
mega-veteran
mega-veteran
Posts: 183
Joined: Mon May 12, 2008 5:15 pm
Has thanked: 5 times
Been thanked: 85 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by revelation » 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.

User avatar
Acewell
VIP member
VIP member
Posts: 1240
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2385 times
Been thanked: 717 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by Acewell » Wed Dec 16, 2009 8:55 pm

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
Thank you for this info, I tried to run your maxscript with 3ds Max 2009 but it produces an error:
>> MAXScript FileIn Exception: -- Unable to convert: undefined to type: Integer <<

I have also been looking into the gto format since using PantheraKing's bms script to extract all the files from the lp containers, GameZelda's script didn't seem to work with the large lp files.
Although you can use 3d Ripper DX to extract the models and textures from SWTFU I prefer to have the characters already in their T-pose to make editing them much easier upon import.

My gto search led me to this site:
http://www.tweaksoftware.com/products/o ... tware/gto/
The source can be downloaded from here:
http://sourceforge.net/projects/gto/
The example cube.gto and plane.gto included in the source looks very similar to the gto files extracted from the SWTFU lp containers.

There is a gto2obj utility as well as others included in the source:
http://gto.tweakadmin.com/3_4_docs/gto_60.html#SEC62

Apparently you need Cygwin environment and gcc 3.x to compile this for Windows but I have no experience with these things.
http://gto.tweakadmin.com/3_4_docs/gto_5.html#SEC7
If someone here already has the required software set up on their machine and would be willing to compile and test the utilities that would be great since Wavefront obj is more common and can be imported into many different 3d programs and not just 3ds Max.

http://gto.tweakadmin.com/3_4_docs/gto_ ... C_Contents

revelation
mega-veteran
mega-veteran
Posts: 183
Joined: Mon May 12, 2008 5:15 pm
Has thanked: 5 times
Been thanked: 85 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by revelation » Thu Dec 17, 2009 3:40 am

Good find on the format information. The data does in deed appear to follow the format in the documentation. But it appears to be a modified version of the file format as some things they list as being uint32 are uint16 values in this format. i am still going through the documentation . i had gotten the string table information and the data sizes of the first sections before i checked back here, but now with this i have easier access to determining what things should be, at least initially anyways. will have to see how it goes.

UberBlack
advanced
Posts: 43
Joined: Thu Oct 22, 2009 8:54 pm
Has thanked: 3 times
Been thanked: 5 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by UberBlack » Fri Dec 18, 2009 1:39 am

I have only tested it with 3DSMax 2010. Make sure to change the path in the first line (of course). All meshes work but they have to be done by hand at this point. I will post the full 3DSMax script on this board for someone to improve the script if they wish. Animation and Bones with weighting would be most ideal.

>>>> SCRIPT

fname = "C:\\TEMP\\ma_trooperStormClassic.gto"  --file name
f = fopen fname "rb"   --open file in read only format
Vert_array = #()    --define arrays for verts, normals, UV and Faces
Normal_array = #()
UV_array = #()
Face_array = #()
--fseek f 0x12C38 #seek_cur
fseek f 0x54DBE #seek_cur

FCount = readlong f
Null1 = readlong f
VCount = readlong f
Null2 = readlong f

FaceDirection = -1
f1 = (readshort f) + 1   --read face indices, games are start form 0, but Max start from 1
f2 = (readshort f) + 1   --so we add 1 to each index
for i = 3 to (Fcount) do ( --already readf 2 verts, so start from 3
f3 = (readshort f) + 1
FaceDirection *= -1
if (f3 != f1) AND (f3 != f2) then ( --if not idential verts, create face
if FaceDirection > 0 then append Face_array [f1,f2,f3] --base on face direction to create face
else append Face_array [f1,f3,f2]
)
f1 = f2 --shift the verts
f2 = f3
)
--for i = 1 to (Fcount / 3) do (
--f1 = (readshort f) + 1   --read face indices, games are start form 0, but Max start from 1
--f2 = (readshort f) + 1   --so we add 1 to each index
--f3 = (readshort f) + 1
--append Face_array [f1,f2,f3] --save faces to Face_array
--)


for i = 1 to VCount do (   --* number of verts count
vx = readfloat f     --read xyz coordinates
vy = readfloat f
vz = readfloat f
append Vert_array [vx,vy,vz] --save verts to Vert_array
        --since UV in Max are in point3 format, so we add 0 for z value
nx = readlong f    --read Normal ??
ny = readlong f
nz = readlong f
append Normal_array [nx,ny,nz] --save normals to Normal_array

tu = readfloat f     --read UV float value
tv = (readfloat f) * -1
append UV_array [tu,tv,0]  --save UVs to UV_array
boneweight1 = readlong f
boneweight2 = readlong f
boneweight3 = readlong f
boneweight4 = readlong f
boneweight5 = readlong f
)
for i = 1 to Bcount do (
Bnum = readlong f
)


fclose f     --close file
msh = mesh vertices:Vert_array faces:Face_array   --build mesh
msh.numTVerts = UV_array.count
buildTVFaces msh
for j = 1 to UV_array.count     do setTVert  msh j UV_array[j]
for j = 1 to Face_array.count   do setTVFace msh j Face_array[j]
for j = 1 to Normal_array.count do setNormal msh j Normal_array[j]

User avatar
Acewell
VIP member
VIP member
Posts: 1240
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2385 times
Been thanked: 717 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by Acewell » Fri Dec 18, 2009 10:10 am

Ok I fixed the script error that I previously posted about, I didn't realize the file paths were case sensitive so I had to change TEMP to temp to reflect the lower case letters of my folder's name.

The ma_trooperStormClassic.gto included in your download produced this error:

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 <<
I ran the max script on mb_darkFelucianWarrior.gto and it looked liked it was finally going to work but another error crept up 3 seconds into it:

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 << 
dh_scrapDrone_LOD1.gto produced this error:

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 <<
dh_scrapDrone.gto produced this error:

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 <<


Train_FloorA.gto produced this error:

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 <<
Needless to say, none of my attempts to convert these gto files with your max script have been successful but i'll continue to try more gto files to see if anything changes.
Has anyone else here had any luck with this max script?

User avatar
Tosyk
double-veteran
double-veteran
Posts: 936
Joined: Thu Oct 22, 2009 10:24 am
Location: Russia, Siberia
Has thanked: 226 times
Been thanked: 107 times
Contact:

Re: Star Wars The Force Unleashed - PC Version .z files

Post by Tosyk » Fri Dec 18, 2009 7:53 pm

First, I want to say, guys, what you are doing is just great!! :D
I tested the Max script for 2008 version, with any file gto he gives the same error:

Code: Select all

-- No ""+"" function for undefined
Also I noticed mention of the bones in the xml-files.
Thank you for all you do here
my blog | my forum

UberBlack
advanced
Posts: 43
Joined: Thu Oct 22, 2009 8:54 pm
Has thanked: 3 times
Been thanked: 5 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by UberBlack » Sat Dec 19, 2009 9:53 pm

The file only works with Storm Trooper (Classic). The script is not automatic, because we haven't yet discovered the offsets so it will only work with every file automatically. If you want other models, you will have to use a hex editor and extract the pieces by hand for example the Storm Trooper (Classic) model has 2 pieces. They are @:

0x12C38
0x54DBE

But that's for the Storm Trooper (Classic) model. This will change depending on the model, and there may be more or less pieces. Also we don't know the offset that says how many pieces there are in the file and where to start looking. This is important to create an automatic script in Max. Any help would be helpful. Like I said we can extract any model from this game by finding the offset by hand which is a pain :(

User avatar
Acewell
VIP member
VIP member
Posts: 1240
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2385 times
Been thanked: 717 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by Acewell » Sun Dec 20, 2009 4:05 am

Ok that makes sense, thanks for the heads-up I guess I misunderstood when you said "All meshes work but they have to be done by hand at this point".

I downloaded the 3ds Max 2010 trial(32 bit if it makes any difference) and tested the max script on the Storm Trooper (Classic) included in your download and it didn't work either, it produced the same error with 2009 as well.

Just to make sure we're on the same page; i'm trying to work with the PC version gto files extracted from SWTFU, whether or not that changes anything I have no idea.

I think revelation was on to something as well so i'm patiently awaiting his return with more information, he said TFU gto files(although they are a modified version) follow the same format as the gto source that I linked to previously.
Hopefully a complete gto utility can come about from the information collected from all this.

PantheraKing said he was writing a SWTFU Tool similar to KotOR Tool so I look forward to this and I hope he succeeds as well.

revelation
mega-veteran
mega-veteran
Posts: 183
Joined: Mon May 12, 2008 5:15 pm
Has thanked: 5 times
Been thanked: 85 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by revelation » Sun Dec 20, 2009 6:04 am

Unfortunately this gto format does not use file offsets to tell where data is stored. It relies on keeping a running count from the various data sections present after the string table found at the beginning of the file. After the table there are lists of objects, components, and properties. Object data lists the number of components for each object, components list the number of properties for each component, and a running index needs to be kept in each case to tell where the component or property starts based on the number processed so far from prior data in the file. Once the differences in the format are mapped out, should be easy to get the initial offsets from a file, as the objects, components, properties, etc. have indices into the string table that tell the purpose of the relevant data as well as the intended data type and format. Haven't determined yet how much this format follows the spec yet. Hopefully i should have this mapped out soon.

revelation
mega-veteran
mega-veteran
Posts: 183
Joined: Mon May 12, 2008 5:15 pm
Has thanked: 5 times
Been thanked: 85 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by revelation » Sun Dec 20, 2009 8:14 am

Ok, well the little break away from the format helped. i haven't determined everything yet, but the data does seem to match up with the max script after the data has been parsed. i don't know enough about max script to make changes at the moment, but i will see what i can do if no one else is able to make sense of this script first. i only had the one file from this thread to test with so far, so anyone with 010 Editor or that can otherwise verify the information would be helpful. Once i am able to compare some more files i should be able to determine if the ordering of the data is always the same, otherwise it is actually more reliable (and correct) to use the type strings associated with the property info to determine the usage of the information. Some of the data is assumed to follow the official spec; the parts i am using work for the information found so far, but some of the unused poortions may have another interpretation give some of the data types have been truncated.

The various indices in the structure are used to access data in the string table, which list the various data types and interpretation values. i am currently unsure whether this information is accessible in some form other than strings at the moment, so currently string comparisons would be necessary to verify the type of data accessed by each property. From that it would also be necessary to take the type, count, and width information into account to handle things properly for composite type for things like position vectors (i.e. a 3d vector would have a type of 1 (= float), variable count, and width of 3). There are some other composite structure as well i believe.

i haven't checked how the official gto reader code works, but with the information below i would think it would be easy to modify it to work as needed. i will continue to look into things.

Hope this helps.

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;

revelation
mega-veteran
mega-veteran
Posts: 183
Joined: Mon May 12, 2008 5:15 pm
Has thanked: 5 times
Been thanked: 85 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by revelation » Sun Dec 20, 2009 10:05 am

Ok, after comparing against a few more files, and adding a printout of the property interpretation string values, i have abit more information on the format layout. It appears to be a quite literal export of the original Maya model information directly into compatible structures for use with Direct3D rendering. Given this i doubt this format would be the same for platforms that are not structured in this way, but i cannot be sure without comparing against the console version of the files. Unfortunately with this structuring i believe it would be difficult to interpret the format during import without having to do comparisons against the values in the string table. Modification of a gto importer, or a manual scan of the object, component, and property interpretation strings to find the start of the relevant structures would be necessary. i am still looking to see of the component and property ordering is the same for the various sub-"structure" information.

Below is the output of the properties listed in the ma_trooperStormClassic.gto file. For those of you familiar with the rendering methods of Direct3D you will probablt notice the data relevant to Vertex Declarations, Vertex and Index Buffers, etc. There does appear to be a somewhat consistent ordering but i cannot say for sure it will hold for all cases. With it appearing the data came from Maya i am guessing that is why certain files start with either ma_ or mb_, etc. I have also noted the values that signal the start of the 2 offsets that were being used in the original max script for clarification (indices 48 and 135). This may aid you in updating your script faster since you can verify what you are currently interpreting the data as against this list. Note the ordering of the values, so it may be possible to come up with some suitable structures for this data if they always hold to this layout. i will make some comparisons of the component names and see what the order of the associated properties is and how it could possibly relate give the objects the components are assigned to.

EDIT:
Modified output information below to be a little more structured in my script. A lot more evident what is going on in the file now and the repeating structures are more visible. After comparing again some models, a somewhat general method of loading parts of these files may be possible using the sub-structure layouts that don't change from file to file.

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

UberBlack
advanced
Posts: 43
Joined: Thu Oct 22, 2009 8:54 pm
Has thanked: 3 times
Been thanked: 5 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by UberBlack » Mon Dec 21, 2009 10:49 pm

I have posted a video that may help those who have had difficulty getting the script to work. You can find it on my blog: http://uberblack3d.blogspot.com/search/ ... .UberBlack

please post a message if this was helpful.

..|Ultra911|..

User avatar
Acewell
VIP member
VIP member
Posts: 1240
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2385 times
Been thanked: 717 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by Acewell » Tue Dec 22, 2009 12:29 pm

The contents of this post was deleted because of possible forum rules violation.

UberBlack
advanced
Posts: 43
Joined: Thu Oct 22, 2009 8:54 pm
Has thanked: 3 times
Been thanked: 5 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by UberBlack » Tue Dec 22, 2009 7:29 pm

As I mentioned in the video, some models have more or less bones. this would effect the script. What I need is someone to step up and fix this script so it can be automated. for the Felucian Warrior to work, you must comment out:

--boneweight4 = readlong f
--boneweight5 = readlong f

Then it will import correctly. All meshes seem to work with this method. I don't know enough about Max to make these offsets automatic. Also the bones and Animation seem very straightforward to implement and I would like someone to help finish off support.

..|Ultra911|..

revelation
mega-veteran
mega-veteran
Posts: 183
Joined: Mon May 12, 2008 5:15 pm
Has thanked: 5 times
Been thanked: 85 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by revelation » Tue Dec 22, 2009 8:22 pm

i will attempt to look into some max script references when i get the chance and see if i can update the script accordingly. i am a programmer, not an artist so i don't usually have a direct need for importers, but i will see what i can do if no one else beats me to it. if there are any others more accustomed to max script than i currently am, the information i posted above should be enough to read the entire format correctly. i am still looking into the unknown values, but so far i have not needed them to interpret the data, will have to see if that holds true.

Post Reply