Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

WHeader file in Wrecks.zfx

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Close Combat Series >> Close Combat - Cross of Iron >> Cross of Iron Modding >> WHeader file in Wrecks.zfx Page: [1]
Login
Message << Older Topic   Newer Topic >>
WHeader file in Wrecks.zfx - 2/18/2018 12:16:57 AM   
SchnelleMeyer

 

Posts: 152
Joined: 3/26/2014
Status: offline
I am looking to add more wreck graphics to COI.
Is there a way to add a wreck graphic for each vehicle in the game?

In Wrecks.zfx there is a WHeader file that I think connects each vehicle sprite to one of the 11 wreck graphics.

Can the developers please share the format of this WHeader file ?
Post #: 1
RE: WHeader file in Wrecks.zfx - 2/20/2018 4:04:09 PM   
Steve McClaire

 

Posts: 3883
Joined: 11/19/2007
Status: offline
Hi SchnelleMeyer,

I have not worked in the CC3 code base for a long time, but from a quick look it appears things work like this:

The file header is:
4 byte signed int - count of array entries used.
Array of 100 x 13 char string - texture name.
Array of 100 x 4 byte signed int - source id (Should usually be -1)
Array of 100 x 4 byte signed int - vehicle class (appears contents in the file do not matter)

So there is a hard coded limit of 100 entries in the file. From a quick look at the code it appears you must have the wreck textures in the same order the vehicles are in vehicles.txt or you will probably get the wrong wreck.

The source id field looks like it was intended to allow multiple vehicles share the same wreck image. If the value of source id is >= 0 this indicates that the vehicle gets the wreck texture at that array index instead of its own.

The contents of the vehicle class field in the file looks like it is overwritten in memory and ignored.

Steve






(in reply to SchnelleMeyer)
Post #: 2
RE: WHeader file in Wrecks.zfx - 2/20/2018 7:10:10 PM   
SchnelleMeyer

 

Posts: 152
Joined: 3/26/2014
Status: offline
Excellent, thank you very much! - I was thinking this might be asking too much, especially now with crunch time for TBG, so I am very pleasantly surprised at your answer.
First of all good to know the hard code limit.

quote:

ORIGINAL: Steve McClaire

The file header is:
4 byte signed int - count of array entries used.
Array of 100 x 13 char string - texture name.
Array of 100 x 4 byte signed int - source id (Should usually be -1)
Array of 100 x 4 byte signed int - vehicle class (appears contents in the file do not matter)

So there is a hard coded limit of 100 entries in the file. From a quick look at the code it appears you must have the wreck textures in the same order the vehicles are in vehicles.txt or you will probably get the wrong wreck.

The source id field looks like it was intended to allow multiple vehicles share the same wreck image. If the value of source id is >= 0 this indicates that the vehicle gets the wreck texture at that array index instead of its own.

The contents of the vehicle class field in the file looks like it is overwritten in memory and ignored.

Steve


I appreciate you took a quick look and its probably years since last time, so I supply some info based on my tests as well:
- Im sure that wreck textures follow the index number of its texture name string in WHeader - not that of the vehicles.txt.
- Source ID field - this works exactly as you say, based on index number from texture name string.
- Vehicle class field gets ignored - Yes, and I never understood anything from this part of the file so did not adjust anything in it. I think its not needed as the texture name list is working as an index.

Thanks again Steve. - Now I have to import some nice wrecks to this old game

(in reply to Steve McClaire)
Post #: 3
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Close Combat Series >> Close Combat - Cross of Iron >> Cross of Iron Modding >> WHeader file in Wrecks.zfx Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.125