Hex edit issues

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
User avatar
skelltor
Sith
Sith
Posts: 1431
Joined: Fri Dec 11, 2009 6:24 pm
Projects :: BFSM
Games I'm Playing :: SWBFII
xbox live or psn: skelltor95
Location: minisnowta
Contact:

Hex edit issues

Post by skelltor »

Today I tried to add a darktrooper's jumppack to the mandalorian soldier and it ended up like this
Hidden/Spoiler:
Image
I used Darth D.U.C.K.'s darktrooper addon pack and I used AQT's tut for reference and I encoded all the right numbers. Does anyone know what I did wrong? or can anyone help me out please?

EDIT I tried using the darktroopers pack from the dark troopers model and I got this
Hidden/Spoiler:
Image
But how do I get the packs texture in my model? I looked at DEV's tut but am confused as I cant find the length of the strings he mentionions can someone please dumb it down for me lol?.
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 edit issues

Post by DarthD.U.C.K. »

did you make the addonpack a child of the ribcagebone?
User avatar
skelltor
Sith
Sith
Posts: 1431
Joined: Fri Dec 11, 2009 6:24 pm
Projects :: BFSM
Games I'm Playing :: SWBFII
xbox live or psn: skelltor95
Location: minisnowta
Contact:

Re: Hex edit issues

Post by skelltor »

I don't know how to do that or what exactly it means. Can you explain? I also would still like the help with matl and such as I think it would be helpful to know.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Hex edit issues

Post by AQT »

For the jetpack's texture, you need to hex edit over the MATD chunk: The chunk starts on the M of the MATD and ends on the character before the M of the MATD after the chunk you are trying to hex edit over. Unless the MATD you are trying to hex edit over is the last MATD of the MSH it originally belonged to, the chunk starts on the M of the MATD and ends on the character before the M of the MODL after the chunk you are trying to hex edit over.

With this said, if you are still using my tutorial for reference, hex editing over MATD chunks is exactly like hex editing over MODL chunks, except for two things:
  • Make sure you paste in the MATD chunk you are trying to hex edit over before the first MODL chunk of the MSH you are editing.
  • In addition to resizing the MSH2 and HEDR, you also need to resize the MATL, but only when hex editing over MATD chunks. The resizing process for MSH2 and HEDR is exactly the same for the MATL.
Afterwards, go to the fifth place after MATL. Now on the hexadecimal side of the hex editor, whatever face value it reads at this exact spot, raise it by a hexadecimal 01 for every MATD you hex edit into your MSH.

Lastly, in order for your MODL chunk to read the right MATD and thus, read the right texture, after hex editing in all the MATD chunks you need, do the following:
  • Using the editor's search function, search for MATD. The first MATD that comes up is assigned the hexadecimal value of 00. The second would be 01. The third would be 02, and so on. (You should keep track of this some how.)
  • Next, go to the MODL chunk that you hex edited over earlier. Using the editor's search function, search for MATI. This should take you to the MODL chunk's MATI.
  • go to the fifth place after this MATI. Now on the hexadecimal side of the hex editor, whatever face value it reads at this exact spot will correspond to one of the hexadecimal values assigned to the MATD chunks you kept track of above. If this value does not use the MATD chunk you want it to, change it so that it actually uses the texture it is supposed to.
And that should be everything.
User avatar
skelltor
Sith
Sith
Posts: 1431
Joined: Fri Dec 11, 2009 6:24 pm
Projects :: BFSM
Games I'm Playing :: SWBFII
xbox live or psn: skelltor95
Location: minisnowta
Contact:

Re: Hex edit issues

Post by skelltor »

Ok thanks a lot I will try this out.

EDIT ok so I finally got around to getting it ingame with a new texture and it looks fine in msh viewer ie
Hidden/Spoiler:
Image
Then I put it ingame and it looks like this
Hidden/Spoiler:
Image
Any ideas what I am doing/did wrong?
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Hex edit issues

Post by AQT »

Select the entire jetpack chunk in your unit's MSH. Cut it out, and repaste/insert it in before the last MODL with PRNT called bone_ribcage. Hopefully this should fix the problem.
User avatar
skelltor
Sith
Sith
Posts: 1431
Joined: Fri Dec 11, 2009 6:24 pm
Projects :: BFSM
Games I'm Playing :: SWBFII
xbox live or psn: skelltor95
Location: minisnowta
Contact:

Re: Hex edit issues

Post by skelltor »

@ AQT I tried what you said to do on xfire (move the chunk to right before the prnt name bone_ribcage) and that just rotated the jetpack a bit so then I renamed dummyroot to bone_ribcage (but there are no spaces between bone_ribcage of my chunk and TRAN and now the jetpack doesn't show up at all! Does anyone have any ideas as to what I did wrong?
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Hex edit issues

Post by AQT »

skelltor wrote:(move the chunk to right before the prnt name bone_ribcage)
No, I did not say that... if you even do that, you would be inserting a MODL inside of another MODL, which is a big no-no. I don't know how many times I have to explain this; I thought I was being very clear:

Okay, your MODL chunk (starting at the M and ending before the M of the next MODL) should go before (not inside!) the last MODL (because there are more than one) having a PRNT called bone_ribcage. No, you don't ever insert your MODL chunk before any PRNT; it will always go before another MODL or CL1L.
skelltor wrote:but there are no spaces between bone_ribcage of my chunk and TRAN
There should be spaces (in other words, those boxes that are the equivalent of hexadecimal 00s). That's why I recommended that you use the stock Dark Trooper jetpack MODL chunk so that you don't have to deal with this out-of-space problem. If you still on insisting on using whatever MODL chunk you are using now, you will need to make the PRNT name longer so that there is space for bone_ribcage and extra spaces. Use the Insert String... function under Edit for this. For every character you insert, resize the longint of this PRNT, your MODL, and the HEDR and MSH2 by one.
User avatar
skelltor
Sith
Sith
Posts: 1431
Joined: Fri Dec 11, 2009 6:24 pm
Projects :: BFSM
Games I'm Playing :: SWBFII
xbox live or psn: skelltor95
Location: minisnowta
Contact:

Re: Hex edit issues

Post by skelltor »

About the first part I meant to type (move the chunk to right before the modl chunk with the prnt name bone_ribcage) I am really sorry about the typing error

About part two I am using the pack chunk from a kitbash Dev made with the darktrooper pack on a rebel model as when I used to stock chunk the jetpack stuck out as the darktrooper has back armour that sticks out.

I will try resizing theose (by resizing I assume you mean Encode the longint + 1 (+ 1for the extra space) and for resizing my modl I assume I do just like I did for the hedr on the character directly after the modl of the jetpack chunk?

Please let me know if I am on the right or wrong track for these :)
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Hex edit issues

Post by AQT »

skelltor wrote:I will try resizing theose (by resizing I assume you mean Encode the longint + 1 (+ 1for the extra space) and for resizing my modl I assume I do just like I did for the hedr on the character directly after the modl of the jetpack chunk?
Yes, everything you will resize should be done exactly like when resizing the HEDR and MSH2. In addition to resizing your MODL, don't forget to resize the MODL's PRNT after lengthening it. And every one additional character you add to your MSH will be equal to 1 to add to the longint's. And no, you don't add an extra +1 for no reason like you do when you're reading directly from the Adr. dec; the only reason why you add an extra +1 there is because the Adr. dec starts counting the characters from 0. The same applies to when lengthening a texture's name, but instead, you would resize the texture's MATD, the MATD's TX0D, the MATL, and then, of course, the HEDR and MSH2 as always.

Also, whenever you rename something in a MSH, always start where the original name starts; don't use the extra spaces before it.
skelltor wrote:I am using the pack chunk from a kitbash Dev made with the darktrooper pack on a rebel model
Does this MODL chunk contain an ENVL chunk?
User avatar
skelltor
Sith
Sith
Posts: 1431
Joined: Fri Dec 11, 2009 6:24 pm
Projects :: BFSM
Games I'm Playing :: SWBFII
xbox live or psn: skelltor95
Location: minisnowta
Contact:

Re: Hex edit issues

Post by skelltor »

Ok so I resized them all by 4 and got this
Hidden/Spoiler:
Image
and it looks like that ingame too
EDIT Yes I just found envl at the very end of this model chunk and you said theose can really mess up hex editing are there any solutions to that? Like can I remove the last bit with envl and then resize stuff again? And what exactly do envl's do?
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 edit issues

Post by DarthD.U.C.K. »

envl contains the envelopinginformation for the chuck. it determinates with which bones the points move. if you dont copy it over, the chuck will float in the air and not move with the unit.
User avatar
skelltor
Sith
Sith
Posts: 1431
Joined: Fri Dec 11, 2009 6:24 pm
Projects :: BFSM
Games I'm Playing :: SWBFII
xbox live or psn: skelltor95
Location: minisnowta
Contact:

Re: Hex edit issues

Post by skelltor »

Oh ok do you know of any ways to get it to work right?
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Hex edit issues

Post by AQT »

If a MODL chunk has an ENVL chunk, then you don't attach it to a bone. By this, I mean do not rename the PRNT to bone_ribcage and do not move it before the last MODL chunk with bone_ribcage as its PRNT. Also, don't insert your MODL chunk between any two other MODL chunks with bone_ in either its NAME or PRNT. If you do all this, then the MODL chunk should appear in its correct position in MSH Viewer.

And no, do not remove the ENVL chunk. Keep it as is. In order for your MODL chunk to show up where it should be in-game, you will unfortunately have to guess and check, but don't worry; you have some hexadecimal values to go by. At the fifth spot after every ENVL on the hexadecimal side of the editor, there is a value, and continuing after this spot at every fourth spot afterwards, there are other values. As D.U.C.K. stated, these values determine what bones the MODL chunk will be enveloped to. Just search for the other ENVL (but not of the shadow volume chunk, if there is one) chunks in the MSH you are editing, and use the values following them to determine what value(s) your MODL's ENVL should have.
User avatar
skelltor
Sith
Sith
Posts: 1431
Joined: Fri Dec 11, 2009 6:24 pm
Projects :: BFSM
Games I'm Playing :: SWBFII
xbox live or psn: skelltor95
Location: minisnowta
Contact:

Re: Hex edit issues

Post by skelltor »

So I got the jumppack hexedited right finally thanks everyone :)
EDIT I am trying to kitbash a Dash Rendar and am putting the stormtrooper shoulder pads on a model they have an envl though and I got one pad on right but can't figure out what number/character to use. I tried using the same number (17) but that made it float by his head there are three places that need numbers (two now) and I don't think the first one does anything so I have tried almost every number from 17-1 (am I right in assuming the # refers to which bone?) as I have to right pad working and when I went through the bone list r_upperarm was before l_upperarm but idk exactly what the number counts wheither it counts bone_? as 1 and moves on, or if it counts prnt or where exactly to start. Anyhelp would be great :)
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 edit issues

Post by DarthD.U.C.K. »

im not sure bit i think theshoulderpads should be attached to the claviclebones.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Hex edit issues

Post by AQT »

skelltor wrote:(am I right in assuming the # refers to which bone?)
AQT wrote:As D.U.C.K. stated, these values determine what bones the MODL chunk will be enveloped to.
No need to assume.

The first value after ENVL usually does nothing. And no, you can't use the same value twice in the same ENVL. Also, keep in mind that the values should be increasing from left to right; they can't be out of order.
skelltor wrote:I went through the bone list r_upperarm was before l_upperarm but idk exactly what the number counts...
These ENVL values do not correspond to the order of the "bone list" like you are suggesting. ENVL value sets are different from player model to player model in most cases, hence why this step:
AQT wrote:Just search for the other ENVL (but not of the shadow volume chunk, if there is one) chunks in the MSH you are editing, and use the values following them to determine what value(s) your MODL's ENVL should have.
Trial and error is the only way to go, I'm afraid. But hey, at least you're getting the hang of it. Good job!
User avatar
skelltor
Sith
Sith
Posts: 1431
Joined: Fri Dec 11, 2009 6:24 pm
Projects :: BFSM
Games I'm Playing :: SWBFII
xbox live or psn: skelltor95
Location: minisnowta
Contact:

Re: Hex edit issues

Post by skelltor »

The only things with envl in the model are sv_jettrooper, overridetexture and overridetexture2 and none of them sound good to use for reference.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Hex edit issues

Post by AQT »

AQT wrote:(but not of the shadow volume chunk, if there is one)
Okay, so toss out "sv_jettrooper." That would leave "overridetexture" and "overridetexture2" as your only options. These two MODL's ENVL chunks should be chock full of values for references, which leads to
skelltor wrote:none of them sound good to use for reference.
me not understanding why is that so for you. :?

If the values with letters A through F are throwing you off, then they shouldn't; they are numbers, too. This is hexadecimal, not regular old decimal. Hope this helps, or am I missing something else?
User avatar
skelltor
Sith
Sith
Posts: 1431
Joined: Fri Dec 11, 2009 6:24 pm
Projects :: BFSM
Games I'm Playing :: SWBFII
xbox live or psn: skelltor95
Location: minisnowta
Contact:

Re: Hex edit issues

Post by skelltor »

Ok I got it right now :) I was confused as to how to use the envl as reference until I looked closer at their envls and found out the had many numbers and I made a list a found the right one I was originally thinking I had to find an envl chunk like other things for the shoulders general area on the model.
Post Reply