This is my first guide, so don't expect much.
Many of you modders don't like to have too much unnessesary 'ReplaceTexture' in their anims. the solution for this is to change the name in the brg file.
some of you know how to do this, but there is always a problem that, when the name is shorter than the orginal texturename you have to put \x00 (hex code, means that there's no character at that place) after the name.
If the new name is longer you need to use ReplaceTexture.
>-----
In this guide I'll discribe how the material system of a brg works. and how to change the indicator wich difines the lenght of the name.
You'll need to download a hex editor.
There are many on the internet, just search hex editor on google.
Some recommed ones:
-http://www.pspad.com
-http://www.portablefreeware.com/?sc=23(portable one)
-http://www.softcircuits.com/cygnus/fe/
Follow everything step by step and read carefull, then you will get it!
First i'll show you how a the material part looks. You can find it on the end of a brg file.
This one is from the Infantry G Hypaspist_IdleA:
The red parts are the headers of a material. This is where the data of a material starts.
The orange parts sets the id of the material. This number is used in the data part before to define wich material a face uses.
It also conforms a defenition in the file materials.lib. Ykkrosh also used this in the names of the textures wich are created when converting a brg with aomed.
The blue parts are the texture names. They have to be the same as an existing texture or you have to replace them with ReplaceTexture.
The green part are what this tutorial is going about.
Its always the 13th byte after the MTRL header.
hex converting can just be done with the window calculator.
set the clac to scientific mode in the view menu.
lets have a look at the last material.
it has the hex lenght identifier '19'.
switch to he coding:
set the lenght on byte and type 19:
if you have a byte with the chars A,B,C,D,E or F, you can use this buttons on the bottom of the calc:
Than change to decimal coding. don't press any other button underwhile:
And see the result:
Count the chars in the name and you'll see that there are 25.
Now I'll show you how to add a new texture name to the file.
Lets saw you want to make a greek palagnite mod. and you want to add the textures Infantry G Palagnite Standard (two, one for player color) and Infantry G Palagnite Head Iron.
The first to are 29 chars long and the third 30.
So the first two can jst replace the orginal first two, but the second need an other lenght identifier.
so first convert it to hex.
Make sure you set the calc to 'dec' coding first:
Then fill in the lenght:
Switch to hex coding:
And copy the result:
Now you can type the byte and the new name into your brg file:
Make sure you spell the name right and that the material end with '00 00 80 3f'.
So save the file and test it. If everything went right, it should work.
So this how it works, enjoy modding!!!
regards,
EmjeR
>-----
Thanks to Scorpion Ra for the screenshot of the english calculator. (mine is dutch)
>> www.EmjeR.com <<
Mods - EmjeR's eyecandy pack :: Improved Greeks look :: Ghengis Khan - Mods
Programs - BCTool Attachpoint Editor :: BCTool :: Words - Programs
Games - 0 AD :: Stronhold 2 :: BfME 2 - Games
!! Proud member of WildFire Games !!
Many of you modders don't like to have too much unnessesary 'ReplaceTexture' in their anims. the solution for this is to change the name in the brg file.
some of you know how to do this, but there is always a problem that, when the name is shorter than the orginal texturename you have to put \x00 (hex code, means that there's no character at that place) after the name.
If the new name is longer you need to use ReplaceTexture.
>
In this guide I'll discribe how the material system of a brg works. and how to change the indicator wich difines the lenght of the name.
You'll need to download a hex editor.
There are many on the internet, just search hex editor on google.
Some recommed ones:
-
-
-
Follow everything step by step and read carefull, then you will get it!
First i'll show you how a the material part looks. You can find it on the end of a brg file.
This one is from the Infantry G Hypaspist_IdleA:
The red parts are the headers of a material. This is where the data of a material starts.
The orange parts sets the id of the material. This number is used in the data part before to define wich material a face uses.
It also conforms a defenition in the file materials.lib. Ykkrosh also used this in the names of the textures wich are created when converting a brg with aomed.
The blue parts are the texture names. They have to be the same as an existing texture or you have to replace them with ReplaceTexture.
The green part are what this tutorial is going about.
Its always the 13th byte after the MTRL header.
hex converting can just be done with the window calculator.
set the clac to scientific mode in the view menu.
lets have a look at the last material.
it has the hex lenght identifier '19'.
switch to he coding:
set the lenght on byte and type 19:
if you have a byte with the chars A,B,C,D,E or F, you can use this buttons on the bottom of the calc:
Than change to decimal coding. don't press any other button underwhile:
And see the result:
Count the chars in the name and you'll see that there are 25.
Now I'll show you how to add a new texture name to the file.
Lets saw you want to make a greek palagnite mod. and you want to add the textures Infantry G Palagnite Standard (two, one for player color) and Infantry G Palagnite Head Iron.
The first to are 29 chars long and the third 30.
So the first two can jst replace the orginal first two, but the second need an other lenght identifier.
so first convert it to hex.
Make sure you set the calc to 'dec' coding first:
Then fill in the lenght:
Switch to hex coding:
And copy the result:
Now you can type the byte and the new name into your brg file:
Make sure you spell the name right and that the material end with '00 00 80 3f'.
So save the file and test it. If everything went right, it should work.
So this how it works, enjoy modding!!!
regards,
EmjeR
>
Mods - EmjeR's eyecandy pack :: Improved Greeks look :: Ghengis Khan - Mods
Programs - BCTool Attachpoint Editor :: BCTool :: Words - Programs
Games - 0 AD :: Stronhold 2 :: BfME 2 - Games
!! Proud member of WildFire Games !!
[This message has been edited by EmjeR (edited 02-27-2009 @ 02:52 AM).]