Hex for Dummies
Posted: Tue Jul 11, 2006 3:20 pm
Ok, ok, I'll make this one as simple as I damn well can. It'll just consist of definitions of terms basicly.
Hex: A number system with 16 characters which are 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. Thats all you need to know about it for modding.
Meta: The definition of an object. Its what you edit in HMT and any modding tools. Each object has a meta which defines what it can do and how it acts.
ID/Identity: Like the meta's ID card so to speak. Its what HHT edits for effects and that kind of stuff. Within a meta there will be ID's listed. When you see an ID listed in a meta, it means that another meta is being called into use. Ex. A vehi meta controls a vehicle and calls the collision model, visual model, animatino trigger, lights, and everything else to use within the vehi meta for any of the vehicles.
Offset/Address: The location of a specific byte in the file. Ex. 0x157 is the 157th byte in the file.
Longword: Most people call it a long for short. Anyway, its just 4 consecutive bytes. EX. 2A3B4C5D is one long.
Magic: The number that you subtract from any reflexive in the map to find where the reflexive is pointing to. Tools will generate the magic for you, but this is the equation to find it: magic = IndexMagic - ( header.OffsetToIndex + 40 )
Reflexive: 4 bytes that are in reversed order (Read them from right to left.) which, when the magic is subtracted from them, point to a specific place within the map file.
Little Endian: Basicly reversed order. Ex. Little endian swaps the order of things, so say DEEF was the little endian way of writing FEED. DE EF is the little endian version, FE ED is the way you reverse it so you can subtract the magic from it.
Reading XML files:
In the xml files it'll say this at first,
<plugin> means its a plugin, <tag>weap<tag> says what tag the plugin is used for and <struct> I don't know. You don't need to know it though.
Ok, so, when in an xml file it says <offset> then the file is specifying where to find something within the meta. In other words when it says <offset>0x34</offset> its saying that its at the 34th byte in the file. Simple enough, isnt it?
Then, when it goes <type>, it will then specify how to represent something in the file. When it says <type>float</type> then it tells the tool to represent the long at the specific offset stated in that section of the xml file.
So, together it looks like this:
So, the <value> </value> represents the end of the thing you and the tool needs to read. the <type>float</type> tells the tools/you that you should represent the 4 byte value as a float, and the <offset>0x3E0</offset> tells you/the tool that its byte number 3E0 in the meta.
Now, you may see something that looks like this:
So, its the same as the last one, but with one change. The value parts tell where to begin and end reading this part, the offset tells you what part its at, and the name says what it does. But, the difference is that it says <type>short<type> instead of float. Well, all that means is that you can edit it as a normal number, it doesnt have to be converted to a float. So, normally you would see at this offset, 01 00 00 00 which means one round is shot per shot. Well, to edit that, you just make the value whatever you want, making it 00 00 00 00 will make it shoot nothing, 05 00 00 00 will make it shoot 5 rounds, and so on. Its that simple.
Ok, there is another thing you should know. You'll see this too:
So, what does that mean? You'll see that I defined how you use reflexives in hex modding. Well, all this does is tells you where the reflexive within the meta is. In this case, the reflexive is located at byte 4FC and it leads to the section which controls triggers. Now, when you look in the file there will be a preceding section that (usually) looks like 01 00 00 00. You don't really need to know what that means for this, just follow the reflexive right after that long, and you'll find the section your looking for.
Now, to convert hex to floating point intergers, which are known as floats, you'll need to use a float converter. Hell, I still don't know how to do it without a float converter, and I don't know where one for windows would be.
So, I hope this gives you a better idea about how to edit things in hex. If not, your a sillykins.
-sword
Hex: A number system with 16 characters which are 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. Thats all you need to know about it for modding.
Meta: The definition of an object. Its what you edit in HMT and any modding tools. Each object has a meta which defines what it can do and how it acts.
ID/Identity: Like the meta's ID card so to speak. Its what HHT edits for effects and that kind of stuff. Within a meta there will be ID's listed. When you see an ID listed in a meta, it means that another meta is being called into use. Ex. A vehi meta controls a vehicle and calls the collision model, visual model, animatino trigger, lights, and everything else to use within the vehi meta for any of the vehicles.
Offset/Address: The location of a specific byte in the file. Ex. 0x157 is the 157th byte in the file.
Longword: Most people call it a long for short. Anyway, its just 4 consecutive bytes. EX. 2A3B4C5D is one long.
Magic: The number that you subtract from any reflexive in the map to find where the reflexive is pointing to. Tools will generate the magic for you, but this is the equation to find it: magic = IndexMagic - ( header.OffsetToIndex + 40 )
Reflexive: 4 bytes that are in reversed order (Read them from right to left.) which, when the magic is subtracted from them, point to a specific place within the map file.
Little Endian: Basicly reversed order. Ex. Little endian swaps the order of things, so say DEEF was the little endian way of writing FEED. DE EF is the little endian version, FE ED is the way you reverse it so you can subtract the magic from it.
Reading XML files:
In the xml files it'll say this at first,
Code: Select all
<plugin>
<tag>weap</tag>
<struct>
Ok, so, when in an xml file it says <offset> then the file is specifying where to find something within the meta. In other words when it says <offset>0x34</offset> its saying that its at the 34th byte in the file. Simple enough, isnt it?
Then, when it goes <type>, it will then specify how to represent something in the file. When it says <type>float</type> then it tells the tool to represent the long at the specific offset stated in that section of the xml file.
So, together it looks like this:
Code: Select all
<value>
<type>float</type>
<offset>0x3E0</offset>
<name>Magnification Range - To</name>
</value>
Now, you may see something that looks like this:
Code: Select all
<value>
<type>short</type>
<offset>0x22</offset>
<name>Rounds Per Shot</name>
</value>
Ok, there is another thing you should know. You'll see this too:
Code: Select all
<value>
<type>reflexive</type>
<offset>0x4FC</offset>
<name>Triggers</name>
</value>
Now, to convert hex to floating point intergers, which are known as floats, you'll need to use a float converter. Hell, I still don't know how to do it without a float converter, and I don't know where one for windows would be.
So, I hope this gives you a better idea about how to edit things in hex. If not, your a sillykins.
-sword