Hex-editing capes [Solved]

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
Deviss
Master of the Force
Master of the Force
Posts: 3772
Joined: Tue Aug 12, 2008 7:59 pm
Projects :: Clone Wars Extended
Games I'm Playing :: BF2

Hex-editing capes [Solved]

Post by Deviss »

well i receive help of fiodis and 666rulerofclones, and i added the sniper's cape without problems but i tryed add the clonecommander's cape and heavytrooper's cape and have problems with these, could anyone help me please ?? i don't if i got problems with these because these capes have SKL2 and CL1L, and i don't understand if is for this than appear on repsharpshoooter's tutorial:
Hidden/Spoiler:
######ADDENDUM######
Also, a tip for hex editors, when writing the HEDR and MSH2 long ints, simply put your cursor on the 'C' of CL1L and read the index (decimal) at the bottom left of the window. That is what the HEDR size is. Also, put your cursor on the 'S' of SKL2 and read the index (decimal) at the bottom left of the window, and subtract 16. (IF There is no SKL2, put the cursor at CL1L and still subtract 16). This is the MSH2 size. This makes it so you can just throw in a bunch of modl chunks, then easily write the correct size. This also means you can disregard any of the steps that involve recording the size of the modl chunk and adding it to the HEDR.

Make sure not to forget the c_ meshes, a list is in the COLL chunk (search for COLL, then look for MODL's with c_). Copy them as you would copy the cloth modl chunk. Same thing.

i get these numers for sniper's cape:
HEDR zise = 170176 + 3116 + 7 + 1
MSH2 zise = 167124 + 3116 + 7 + 1

if anyone could help me, please help using screenshots taken of each step since the steps for get the cape MODL chunk untill getting the HEDR and MSH2 zise, so sorry for this request but i have very time trying of learn this and i didn't can alone
Last edited by Deviss on Thu May 28, 2009 9:00 am, edited 1 time in total.
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Re: Hex-editing capes

Post by RepSharpshooter »

The capes themselves do not have SKL2 (skeleton) and CL1L (end of file) chunks.

The msh file in brief is like this

> ENTIRE FILE
  • HEDR
    • MSH2
      • MODL
      • MODL
      • MODL
    • SKL2
    • CL1L
And it's also good to remember that each chunk is like this:
[NAME][SIZE]content.......

Name- 4 bytes
Size- 4 bytes - describes size of the content (size = x ) only, not of name and size
content - x bytes (is a multiple of 4 though)

So the entire chunk itself would be: entire = 4 + 4 + x (entire = 8 + x)

So if you look at just the hedr chunk:
[HEDR][size]entire file.......................
You can determine the overall filesize by scrolling to the way bottem and reading the address (then add 1 to that)

Therefore, the number you put in to [size] would be: x = entire - 8



Ok then look back up at the diagram, for MSH2, if you know where it starts in the file, and where it ends, you can find it's size (ex. if something starts at 3 and ends at 7, it's size is 7 - 3 = 4). You can do the same with MSH2 and any other chunk. Find the address of where it's content starts (after the name and size) and then find where it ends (usually SKL2), then subtract them to get the actual size.

And it's impossible to help exactly, because I don't know what unit you are adding it to.
Deviss
Master of the Force
Master of the Force
Posts: 3772
Joined: Tue Aug 12, 2008 7:59 pm
Projects :: Clone Wars Extended
Games I'm Playing :: BF2

Re: Hex-editing capes

Post by Deviss »

RepSharpshooter wrote:
Hidden/Spoiler:
The capes themselves do not have SKL2 (skeleton) and CL1L (end of file) chunks.

The msh file in brief is like this

> ENTIRE FILE
[list][*]HEDR
[list]
[*]MSH2
[list]
[*]MODL
[*]MODL
[*]MODL[/list][*]SKL2[*]CL1L[/list][/list]

And it's also good to remember that each chunk is like this:
[NAME][SIZE]content.......

Name- 4 bytes
Size- 4 bytes - describes size of the content (size = x ) only, not of name and size
content - x bytes (is a multiple of 4 though)

So the entire chunk itself would be: entire = 4 + 4 + x (entire = 8 + x)

So if you look at just the hedr chunk:
[HEDR][size]entire file.......................
You can determine the overall filesize by scrolling to the way bottem and reading the address (then add 1 to that)

Therefore, the number you put in to [size] would be: x = entire - 8



Ok then look back up at the diagram, for MSH2, if you know where it starts in the file, and where it ends, you can find it's size (ex. if something starts at 3 and ends at 7, it's size is 7 - 3 = 4). You can do the same with MSH2 and any other chunk. Find the address of where it's content starts (after the name and size) and then find where it ends (usually SKL2), then subtract them to get the actual size.

And it's impossible to help exactly, because I don't know what unit you are adding it to.
i am trying add the heavytrooper's cape to the ep3trooper and how do i get the ADRESS exactly ?? for this reason i request screenshots of each step of the process in this is more easy look the example, numbers and how get these numbers and adress, if you could i will be very thanks you :D
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Re: Hex-editing capes

Post by RepSharpshooter »

The address is at the bottom left of the hex editor (I assume you are using XVI32)

Also make sure you are reading the decimal address on the ASCII side (not hex).
Deviss
Master of the Force
Master of the Force
Posts: 3772
Joined: Tue Aug 12, 2008 7:59 pm
Projects :: Clone Wars Extended
Games I'm Playing :: BF2

Re: Hex-editing capes

Post by Deviss »

RepSharpshooter wrote:The address is at the bottom left of the hex editor (I assume you are using XVI32)

Also make sure you are reading the decimal address on the ASCII side (not hex).
so sorry, i got the correct adress just but when i add the cloth to my unit's odf the game crashing :(
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Hex-editing capes

Post by Fiodis »

Me and Deviss have had a little back-and-forth with PM's discussing this, and I still don't know what it is: c_meshes. And COLL chunks. I've been trying to add Dooku's cape to the Stormtrooper Luke model, and I can't say it's been working. Deviss suggested that these c_meshes might be the problem. So now I'm asking for both of us, what are c_meshes and COLL chunks?
User avatar
666rulerofclones
Command Sergeant Major
Command Sergeant Major
Posts: 281
Joined: Fri Aug 08, 2008 1:30 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: The Badger State!

Re: Hex-editing capes

Post by 666rulerofclones »

Fiodis wrote:Me and Deviss have had a little back-and-forth with PM's discussing this, and I still don't know what it is: c_meshes. And COLL chunks. I've been trying to add Dooku's cape to the Stormtrooper Luke model, and I can't say it's been working. Deviss suggested that these c_meshes might be the problem. So now I'm asking for both of us, what are c_meshes and COLL chunks?
im not sure, but dookus cape isnt part of the troopers model, its an addon, isnt it? I also dont know what C_meshes and COLL chunks are, but i got this to work after a while not even bothering with these. also, about the HEDR and MSH2, i usually dont adjust those, as the file grows 3 KB bigger after i add in the cape for some reason :D
im trying to add the heavy troopers cape to the episode 3 trooper. how do you get the address?
i usually search for "cape" then go to the second result. it should say between NAME and PRNT: "rep_inf_ep3_heavytrooper_cape". once ive found that, then what i do is search for the next MODL Chunk. then i put my cursor right in front of it, then i press shift + the UP arrow. then go upward until you reach the beginning of the capes MODL chunk. then copy and paste into the SECOND MODL chunk of the episode 3 trooper. that is how i do it and it works just fine for me.

OFF-TOPIC: nice avatar, rep.
Deviss
Master of the Force
Master of the Force
Posts: 3772
Joined: Tue Aug 12, 2008 7:59 pm
Projects :: Clone Wars Extended
Games I'm Playing :: BF2

Re: Hex-editing capes

Post by Deviss »

666rulerofclones wrote:i usually search for "cape" then go to the second result. it should say between NAME and PRNT: "rep_inf_ep3_heavytrooper_cape". once ive found that, then what i do is search for the next MODL Chunk. then i put my cursor right in front of it, then i press shift + the UP arrow. then go upward until you reach the beginning of the capes MODL chunk. then copy and paste into the SECOND MODL chunk of the episode 3 trooper. that is how i do it and it works just fine for me.
i also search cape and i found rep_inf_ep3heavytrooper_cape y after of this is rep_inf_ep3heavytrooper i the same used this MODL chunk but ingame never appear the cape
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Re: Hex-editing capes

Post by RepSharpshooter »

I get 3680 for the heavy trooper's cape modl size (+8 = 3688 overall). Therefore you need to add 3688 to both the HEDR and MSH2 size long ints.
Hidden/Spoiler:
[quote="666rulerofclones"][quote="Fiodis"]Me and Deviss have had a little back-and-forth with PM's discussing this, and I still don't know what it is: c_meshes. And COLL chunks. I've been trying to add Dooku's cape to the Stormtrooper Luke model, and I can't say it's been working. Deviss suggested that these c_meshes might be the problem. So now I'm asking for both of us, what are c_meshes and COLL chunks?[/quote]
im not sure, but dookus cape isnt part of the troopers model, its an addon, isnt it? I also dont know what C_meshes and COLL chunks are, but i got this to work after a while not even bothering with these. also, about the HEDR and MSH2, i usually dont adjust those, as the file grows 3 KB bigger after i add in the cape for some reason :D

[quote]im trying to add the heavy troopers cape to the episode 3 trooper. how do you get the address?[/quote]

i usually search for "cape" then go to the second result. it should say between NAME and PRNT: "rep_inf_ep3_heavytrooper_cape". once ive found that, then what i do is search for the next MODL Chunk. then i put my cursor right in front of it, then i press shift + the UP arrow. then go upward until you reach the beginning of the capes MODL chunk. then copy and paste into the SECOND MODL chunk of the episode 3 trooper. that is how i do it and it works just fine for me.

OFF-TOPIC: nice avatar, rep.[/quote]
Dooku's cape is NOT an addon, in BF2 it is a cloth modl.
If you don't adjust HEDR and MSH2 you're file won't munge right and will usually crash.
Coll = collision. It is in the cape and tells what c_ modl's the cape needs. c_ = collision. If they cape appears stretched ingame, you need to add all of the c_ meshes that COLL calls for.
Deviss
Master of the Force
Master of the Force
Posts: 3772
Joined: Tue Aug 12, 2008 7:59 pm
Projects :: Clone Wars Extended
Games I'm Playing :: BF2

Re: Hex-editing capes

Post by Deviss »

RepSharpshooter wrote:I get 3680 for the heavy trooper's cape modl size (+8 = 3688 overall). Therefore you need to add 3688 to both the HEDR and MSH2 size long ints.
Hidden/Spoiler:
[quote="666rulerofclones"][quote="Fiodis"]Me and Deviss have had a little back-and-forth with PM's discussing this, and I still don't know what it is: c_meshes. And COLL chunks. I've been trying to add Dooku's cape to the Stormtrooper Luke model, and I can't say it's been working. Deviss suggested that these c_meshes might be the problem. So now I'm asking for both of us, what are c_meshes and COLL chunks?
im not sure, but dookus cape isnt part of the troopers model, its an addon, isnt it? I also dont know what C_meshes and COLL chunks are, but i got this to work after a while not even bothering with these. also, about the HEDR and MSH2, i usually dont adjust those, as the file grows 3 KB bigger after i add in the cape for some reason :D
im trying to add the heavy troopers cape to the episode 3 trooper. how do you get the address?
i usually search for "cape" then go to the second result. it should say between NAME and PRNT: "rep_inf_ep3_heavytrooper_cape". once ive found that, then what i do is search for the next MODL Chunk. then i put my cursor right in front of it, then i press shift + the UP arrow. then go upward until you reach the beginning of the capes MODL chunk. then copy and paste into the SECOND MODL chunk of the episode 3 trooper. that is how i do it and it works just fine for me.

OFF-TOPIC: nice avatar, rep.[/quote][/hide]

Dooku's cape is NOT an addon, in BF2 it is a cloth modl.
If you don't adjust HEDR and MSH2 you're file won't munge right and will usually crash.
Coll = collision. It is in the cape and tells what c_ modl's the cape needs. c_ = collision. If they cape appears stretched ingame, you need to add all of the c_ meshes that COLL calls for.[/quote]
so the SKL2 is for example i want add the snow's backpack MODL Chunk ??
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Re: Hex-editing capes

Post by RepSharpshooter »

The SKL2 doesn't matter. It just happens to be where the MSH2 usually ends, so you can find size of it (end - begin = size). If it doesn't have a SKL2, MSH2 will usualy end on the CL1L.
Deviss
Master of the Force
Master of the Force
Posts: 3772
Joined: Tue Aug 12, 2008 7:59 pm
Projects :: Clone Wars Extended
Games I'm Playing :: BF2

Re: Hex-editing capes

Post by Deviss »

RepSharpshooter wrote:The SKL2 doesn't matter. It just happens to be where the MSH2 usually ends, so you can find size of it (end - begin = size). If it doesn't have a SKL2, MSH2 will usualy end on the CL1L.
wow now i understand very thanks, but i have a new and final problem , i did can add the gogs visor from andeweget's clone to the ep3trooper but i don't know how add the material of this and i don't know how put the correct position of the visor, DarthD.U.C.K. said i can put the correct position using BConstructor so those are the unics problems, how add the material and how using the BConstructor put the correct position of the gogs for example move the position down or up :D
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Re: Hex-editing capes

Post by RepSharpshooter »

You can't add a material easily, not without taking the MATD (material) chunk from one mesh to the other, then resizing MATL, and there's a number after MATL's size that is the number of MATD's which you need to add 1 to. Then you still need to make HEDR and MSH2 larger. Then after that you need to change the MATI in all of the visor's SEGM's to reference the new material (the first MATD is 0, the second MATD is 1, etc).

Here is a visual representation of the msh file http://personal.riley-man.com/swbf/edit ... f-msh.html

To position it correctly, you need to modify values in the TRAN chunk. The last 3 values are the ones you want, X Z and Y (in that order). They are float-type values, you need to change them just a little probably.
Deviss
Master of the Force
Master of the Force
Posts: 3772
Joined: Tue Aug 12, 2008 7:59 pm
Projects :: Clone Wars Extended
Games I'm Playing :: BF2

Re: Hex-editing capes

Post by Deviss »

RepSharpshooter wrote:You can't add a material easily, not without taking the MATD (material) chunk from one mesh to the other, then resizing MATL, and there's a number after MATL's size that is the number of MATD's which you need to add 1 to. Then you still need to make HEDR and MSH2 larger. Then after that you need to change the MATI in all of the visor's SEGM's to reference the new material (the first MATD is 0, the second MATD is 1, etc).

Here is a visual representation of the msh file http://personal.riley-man.com/swbf/edit ... f-msh.html

To position it correctly, you need to modify values in the TRAN chunk. The last 3 values are the ones you want, X Z and Y (in that order). They are float-type values, you need to change them just a little probably.
wow a few difficult i try to make this so much thanks :bowdown:
EDIT: i got the recon visor with texture :eek: ohh my god
Image

EDIT2: OUH my god!!!, i got the perfect position alone :D
Image
i am learning to add MODL chunks gogs, kamas and andeweget's backpack for now
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Re: Hex-editing capes

Post by RepSharpshooter »

Sweet work :D
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Hex-editing capes

Post by DarthD.U.C.K. »

halfontopic: i made holsters for my dc17-pistol, do you want to add them too? :wink:
User avatar
666rulerofclones
Command Sergeant Major
Command Sergeant Major
Posts: 281
Joined: Fri Aug 08, 2008 1:30 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: The Badger State!

Re: Hex-editing capes

Post by 666rulerofclones »

nice, im glad you finally figured it out and that is some sweet work on the visor.
Deviss
Master of the Force
Master of the Force
Posts: 3772
Joined: Tue Aug 12, 2008 7:59 pm
Projects :: Clone Wars Extended
Games I'm Playing :: BF2

Re: Hex-editing capes

Post by Deviss »

RepSharpshooter wrote:Sweet work :D
very thanks sir and other thing:
i want thanks you specially to you for all my works, because since you answer my PM (i requested you about your ep3commander modl on this) i begin to be better people, i began to realese all my works (skins, hex-edited models, etc) and began to learn more for example to modify models and others, begab to realese mod and others and for this reason i bettered how member of this forum i began to help to others members with him problems and more, so simplelly i am very thanks you, because all my realese are thanks to you :D
DarthD.U.C.K. wrote:halfontopic: i made holsters for my dc17-pistol, do you want to add them too? :wink:
1° so sorry darth for mines request again and again for using the BConstructor, and very thanks for all your help modding, for example the help with the magnaguard electrostuff

2° yes, i very like to add the holsters to someone models :bowdown: , first i will add the holsters to the model you want of course :D
666rulerofclones wrote:nice, im glad you finally figured it out and that is some sweet work on the visor.
very thanks man, and thanks to you and FIODIS i got this work fine, because i learnt to add first MODL chunks of clothes and thaks to that i learnt to add MODL chunks of others things for example the visor and someone backpack

NOTE: problem solved totally and credits for this to:
FIODIS, RepSharpShooter, 666rulerofclones and DarthD.U.C.K. :D very thanks my masters :bowdown:
User avatar
666rulerofclones
Command Sergeant Major
Command Sergeant Major
Posts: 281
Joined: Fri Aug 08, 2008 1:30 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: The Badger State!

Re: Hex-editing capes

Post by 666rulerofclones »

DEVISS-REX wrote:
Hidden/Spoiler:
[quote="RepSharpshooter"]Sweet work :D
very thanks sir and other thing:
i want thanks you specially to you for all my works, because since you answer my PM (i requested you about your ep3commander modl on this) i begin to be better people, i began to realese all my works (skins, hex-edited models, etc) and began to learn more for example to modify models and others, begab to realese mod and others and for this reason i bettered how member of this forum i began to help to others members with him problems and more, so simplelly i am very thanks you, because all my realese are thanks to you :D
DarthD.U.C.K. wrote:halfontopic: i made holsters for my dc17-pistol, do you want to add them too? :wink:
1° so sorry darth for mines request again and again for using the BConstructor, and very thanks for all your help modding, for example the help with the magnaguard electrostuff

2° yes, i very like to add the holsters to someone models :bowdown: , first i will add the holsters to the model you want of course :D
666rulerofclones wrote:nice, im glad you finally figured it out and that is some sweet work on the visor.
very thanks man, and thanks to you and FIODIS i got this work fine, because i learnt to add first MODL chunks of clothes and thaks to that i learnt to add MODL chunks of others things for example the visor and someone backpack

NOTE: problem solved totally and credits for this to:
FIODIS, RepSharpShooter, 666rulerofclones and DarthD.U.C.K. :D very thanks my masters :bowdown:[/hide][/quote]

you are very welcome, DEVISS-REX, and have fun using this new knowledge of yours :D :wink:
Deviss
Master of the Force
Master of the Force
Posts: 3772
Joined: Tue Aug 12, 2008 7:59 pm
Projects :: Clone Wars Extended
Games I'm Playing :: BF2

Re: Hex-editing capes

Post by Deviss »

666rulerofclones wrote:you are very welcome, DEVISS-REX, and have fun using this new knowledge of yours :D :wink:
i realesed my first work with modl chunks added HERE, thanks to all :D
Post Reply