How to clone armor?

Users who are viewing this thread

Janus

*spicy* *camper*
Administrator
Ok, here's what I'm trying to do. I want to add in new separate armor, which is simply a retextured version of armor already in the game.
I have gone through n008's tutorial on cloning an animated mesh and pointing it to another texture (DDS) file, and double-checked everything. I made sure to copy the texture sections which corresponded to the original texture files in materials.brf, thus retaining the extra material info.
I copied the item_meshes.brf file to another filename since it has the armors in it, deleted every mesh other than the two armors I wanted clones of, then renamed the meshes to what I wanted them called. After editing materials.brf and texture_names.brf to include the 2 new uniquely named DDS files with the edited textures (previously costumes2.dds and costumes4.dds) and of course incrementing the necessary value towards the top of each file by 2, I then loaded BRFview back up and set the material of each of the two armors.
I have also properly set the new armor items I've created in the script files to use the new meshes.

Ok, everything looks perfect in BRFview, both retextures show up perfectly. No problem at that point.
The problem is, M&B crashes when I try to run it when the new BRF file with the 2 armors is included. It gives an error "Assertion failed! (cursor + len) <= str_length".

Is there something I'm missing, or does anyone have any helpful advice? Can you even successfully clone armor meshes in BRFview? I was under the impression it should work, but...
 
I'm guessing you've made a little error with the the hex values in either the materials or the textures brf.

Are you using Hex Workshop?

IIRC, this error is typical if when giving the length of the ensuing word (that fourth dot before the term) is erroneous.

If you're using hex workshop, count the letters (including underscores and that dot in x.dds) of EVERY new word you added (yes, for the shaders, the "nones" and all that too).

Now open up the hex calculator (top right of your Hex Workshop). The calculator screen will show DEC or HEX. Touch on the screen to convert one to the other. (you can also find hex-to-dec conversion tables online, e.g.
http://www.nthelp.com/ascii.htm

So, set calculator to DEC, enter the number of letters of the word you've counted, convert it to HEX. That is what should be in the fourth dot before the word.

e.g. if you include shield_special, that's 14 letters, in Hex it transforms to 0E. (that is zero-E). So fill the fourth dot before the word with 0E.

I know it's kind of annoying, but you have to make sure that's the case for EVERY word you added. That usually does the trick for this kind of error.

If that doesn't work, check the following:

(a) the number you added at the top is very correct. (again, it has to be in Hex, not Dec. Even if it "looks" like a regular number, remember it ain't. e.g. suppose it is 77 and you're adding three items. DON'T put 80 in there. 77 is really Hex for 119, so if you add 3 items (taking the total to 122)), the Hex equivalent is 7A (not 80).

(b) Alternative cause of this problem is if in the process of pasting, you made a mistake and changed the number of dots BETWEEN two words. (IIRC they are usually either four or eight, but just compare with other entries).

It is a perfectly correctable error. Just takes some painstaking counting of digits and tiresome use of the hex calculator and remembering not to confuse dec & hex numbers when filling in entries.

(BTW, a quick way to pinpoint exactly where you went "wrong", open up your item_meshes in Lurb's BRFView, then click "materials editor", go to where the new materials is listed and click on it. You'll see the entries "name", "texture", "shader", a number and then a whole bunch of "none" entries and so on. All these should look clean & clear. WHERE these entries look "off" (e.g. a "ron_shader" instead of "iron_shader" or a "one" instead of "none"), THAT is where you made the mistake in the Hex Workshop and you should go back and count the letters at that point.

P.S. - DO NOT try to correct or save materials through Lurb's editor; do it in Hex Workshop. )
 
Well, strange.
I've used hex before, and can convert back and forth without too much trouble. I double checked everything, all of the numbers were correct. I might have misplaced an extra "." when copying and pasting, that's my best guess. I opened the Material Editor in BRFview, but all names and values for the two new materials I added lined up perfectly.

So, I restarted on the files from scratch, this second time sticking to names that matched the length of characters in the copied entries. Also I added 1 entry at a time, instead of both at once. Whaddaya know, this time it worked like a charm. <shrug>

Now I just need to figure out how to fix the output from Photoshop's DDS plugin (by nVidia) which is giving my edited armor texture a super-shiny look in the game. :razz:
Then again, may be partly/wholly due to the fact I copied the original (costume4) texture file's entry for it, which includes the iron_shader.
Meh, just need to mess with it some more, I guess.

Thanks for the help. :smile:
 
Cool. Yeah, I've learnt to stop myself from taking many shortcuts. 'Tis a fussy little program.

(P.S. - I hope I didn't sound too pedantic. I first heard about Hex...um... about a week ago or so (through noo8's tutorial :smile: ) , so I naturally assume it is as much a novelty to everyone else as it is to me. :smile: )
 
I've done hex editing in the past, but it's been a few years. I never really have liked the 4-bit (as opposed to ASCII 8-bit/1 byte) hex system. :razz:

As for sounding pedantic, nah, hex is something most people have never had to mess with. It's cool you went into detail. Looks like a good guide for finding errors when cloning meshes, so I imagine it will be helpful to people having such problems.
 
Back
Top Bottom