Jump to content

CHR File Header


Guest Roana

Recommended Posts

Guest Roana

Hello,

 

during my search, why BG1Tutu will not give the right HP at starting a game (shich was yet without succsess), I have recovered the last Unknown in the CHR File Header. This is value for CHR File Headers in V1.0, 1.2, 2.0 and 2.1 . For V9,0 I can't say it, because I haven't this Version of CHR Files in my games.

 

At the Offset 0x0030 is stored the SLOTs-Offset of the Character depending on his Class.

 

They are only a bit different in showing up: e.g. a pure fighter-CHR in V 2.0 has this value at the beginning:

 

0a 00 0a 00 ff ff ff ff .....

 

an equal character in V 2.1 the following:

 

23 00 0a 00 0a 00 0a

 

both have 4 weapon Slots. The first is unarmed except the SLOT "FIST", the second has one weapon armed in the first SLOT.

 

These Slots are grapped from the SLOT.IDS, which is present in BG1 and BG2 and not changed between them, where at number 10 the SLOT "FIST" is referenced.

 

Also stored are in this offset the first quickspell with the Spell Name changed into Hex and the Quickitem-SLOTS, which has the values 15, 16 and 17 in the SLOT.IDS (they are called there as "MISC", but by comparing these with the Characters inventory you can see, which it must be).

 

 

My Character, that I import to TUTU has the following offset here:

 

23 00 0a 00 ff ff ff ff 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff

 

This is a Fighter/Mage only created and exported with no learned spells and no other than her Staff armed in weapon-SLOT 0. (0x23 = 35 = Weapon0 in the SLOT.IDS)

 

Another character, with which I have played until the Final Save in BG1 has the following value:

 

0b 00 24 00 ff ff ff ff 00 00 00 00 ff ff ff ff 53 50 57 49 31 31 32 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0f 00 10 00 11 00 00 00 00 00 00 00

 

She is armed with two weapons, has her quickspells, and also Potions. Now lets see, which value is what:

 

0b 00 24 00

 

She has a bow in the first weapon-SLOT (0x0b = 11 = Ammo0 in the SLOT.IDS) and a sword in the second (0x24 = 36 = Weapon1 in the SLOT.IDS).

 

By translating some values to binary I noticed that this:

 

53 50 57 49 31 31 32

 

means SPWI112, which is the Magic Missile Spell, my Character has in her first quickspell-SLOT

 

by comparing with some other Characters I noticed that this:

 

0f 00 10 00 11

 

are always the same values depending on if the SLOT is filled or not. If we take now a look at the SLOT.IDS there the values 15, 16 and 17 referenced as

 

15 SLOT_MISC0

 

16 SLOT_MISC1

 

17 SLOT_MISC2

 

If you take a look on a character with only the quickitemslots filled you will find this values in the header of the CHR File from the exported Character.

 

Oh and... as a Fighter could not have any spells the full offset of a fighter will ever show 00-values there, where my character has the SPWI112 in its file as these for example (the full values of the pure fighter from above):

 

V2.0 (a BG1 generic CHR without anything)

 

0a 00 0a 00 ff ff ff ff 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff

 

V2.1 (a TOB-generic CHR with weapon and Potions)

 

23 00 0a 00 0a 00 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0f 00 10 00 11 00 00 00 00 00 00 00

 

Hope this helps a little, as IEDSP has answered me several questions the time I have begun moding my BG2 game (about two years ago).

 

I am glad, that this has not died together with TeamBG :)

 

 

Roana

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...