Reply
 
Thread Tools Display Modes
  #1  
Old 01-15-2020, 04:44 PM
Damuri Ajashi is offline
Guest
 
Join Date: Jul 2006
Posts: 21,110

Baldur's Gate Enhanced Edition Hex Editing Codes


So I am getting back into Baldur's Gate but i want to customize the game. I have the game on my phone and i can't figure out how to use EEKeeper.

But I do know how to use a hex editor.

The main thing i want to do is change alignments and classes. I want Jaheira=Ranger/Cleric, Khalid= Paladin, Minsc=Berserker, Imoen=Thief/Mage multi-class, Dynaheir=Sorcerer

I know where the class hex location is and I know the class codes for:

Mage=1
Fighter=2
Cleric=3
Thief=4

But I do not have and cannot find class codes for any of the others and i fear I am starting to destroy saved games to figure it out.

Does anyone have these class codes

I would also like to know a few alignment and race codes and hex locations so that I can change Khalid to LG, etc.
  #2  
Old 01-15-2020, 05:17 PM
GESancMan's Avatar
GESancMan is online now
Guest
 
Join Date: Mar 2008
Location: Portland
Posts: 3,390
I'm guessing since you're on your phone you don't have a way to access the game resources. There is a file called class.ids, which defines the constants for all classes and races (including monsters and whatnot). These numbers are in base 10, not hex. The first 21 lines are:

1 MAGE
2 FIGHTER
3 CLERIC
4 THIEF
5 BARD
6 PALADIN
7 FIGHTER_MAGE
8 FIGHTER_CLERIC
9 FIGHTER_THIEF
10 FIGHTER_MAGE_THIEF
11 DRUID
12 RANGER
13 MAGE_THIEF
14 CLERIC_MAGE
15 CLERIC_THIEF
16 FIGHTER_DRUID
17 FIGHTER_MAGE_CLERIC
18 CLERIC_RANGER
19 SORCERER
20 MONK
21 SHAMAN

Everything after that is races and monsters.

If you're looking to also assign kits, there is a file called kit.ids, which defines all kit constants, this time in hexadecimal.
  #3  
Old 01-15-2020, 05:30 PM
GESancMan's Avatar
GESancMan is online now
Guest
 
Join Date: Mar 2008
Location: Portland
Posts: 3,390
Oops! Missed the last line of your post.

race.ids:

1 HUMAN
2 ELF
3 HALF_ELF
4 DWARF
5 HALFLING
6 GNOME
7 HALFORC


align.ids:

0x00 NONE
0x11 LAWFUL_GOOD
0x12 LAWFUL_NEUTRAL
0x13 LAWFUL_EVIL
0x21 NEUTRAL_GOOD
0x22 NEUTRAL
0x23 NEUTRAL_EVIL
0x31 CHAOTIC_GOOD
0x32 CHAOTIC_NEUTRAL
0x33 CHAOTIC_EVIL
0x01 MASK_GOOD
0x02 MASK_GENEUTRAL
0x03 MASK_EVIL
0x10 MASK_LAWFUL
0x20 MASK_LCNEUTRAL
0x30 MASK_CHAOTIC

I fired up Near Infinity, and looked at a few NPCs, at it appears race is located at 0272, while alignment is located at 027b. This *should* be uniform for all NPCs.
  #4  
Old 01-15-2020, 05:47 PM
Damuri Ajashi is offline
Guest
 
Join Date: Jul 2006
Posts: 21,110
Quote:
Originally Posted by Damuri Ajashi View Post
So I am getting back into Baldur's Gate but i want to customize the game. I have the game on my phone and i can't figure out how to use EEKeeper.

But I do know how to use a hex editor.

The main thing i want to do is change alignments and classes. I want Jaheira=Ranger/Cleric, Khalid= Paladin, Minsc=Berserker, Imoen=Thief/Mage multi-class, Dynaheir=Sorcerer

I know where the class hex location is and I know the class codes for:

Mage (M)=01
Fighter(F)=02
Cleric(C)=03
Thief(T)=04

But I do not have and cannot find class codes for any of the others and i fear I am starting to destroy saved games to figure it out.

Does anyone have these class codes

I would also like to know a few alignment and race codes and hex locations so that I can change Khalid to LG, etc.
Mage(M)=01
Fighter(F)=02
Cleric(C)=03
Thief(T)=04
Bard(B)=05
Paladin=06
F/M=07
F/C=08
F/T=09
F/M/T=0a
Druid(D)=0b
Ranger(R)=0c
M/T=0d
C/M=0e
C/T=0f
F/D=10
F/M/C=11
C/R=12
Sorcerer=13
Monk=14
Shaman=15
[empty]=16+

The hex location for the class is 6 rows down and 5 columns to the right of the Charisma stat (or 53 spots after the Charisma stat)

Other hex locations are responsible for the class kit and alignment. I will update as I can
  #5  
Old 01-15-2020, 05:52 PM
Damuri Ajashi is offline
Guest
 
Join Date: Jul 2006
Posts: 21,110
Quote:
Originally Posted by GESancMan View Post
I'm guessing since you're on your phone you don't have a way to access the game resources. There is a file called class.ids, which defines the constants for all classes and races (including monsters and whatnot). These numbers are in base 10, not hex. The first 21 lines are:

1 MAGE
2 FIGHTER
3 CLERIC
4 THIEF
5 BARD
6 PALADIN
7 FIGHTER_MAGE
8 FIGHTER_CLERIC
9 FIGHTER_THIEF
10 FIGHTER_MAGE_THIEF
11 DRUID
12 RANGER
13 MAGE_THIEF
14 CLERIC_MAGE
15 CLERIC_THIEF
16 FIGHTER_DRUID
17 FIGHTER_MAGE_CLERIC
18 CLERIC_RANGER
19 SORCERER
20 MONK
21 SHAMAN

Everything after that is races and monsters.

If you're looking to also assign kits, there is a file called kit.ids, which defines all kit constants, this time in hexadecimal.
I don't see those flags on the saved game hex data. Where do I find the class.id file you speak of?
  #6  
Old 01-15-2020, 05:54 PM
Damuri Ajashi is offline
Guest
 
Join Date: Jul 2006
Posts: 21,110
Do you know where the address is for kits? I'd like Minsc to be a Berserker but i can't figure out how kits work.
  #7  
Old 01-15-2020, 07:38 PM
GESancMan's Avatar
GESancMan is online now
Guest
 
Join Date: Mar 2008
Location: Portland
Posts: 3,390
Quote:
Originally Posted by Damuri Ajashi View Post
I don't see those flags on the saved game hex data. Where do I find the class.id file you speak of?
On the PC, In the unmodded game, the files are all packed away in zipped files called biffs. There are a mess of them, I'm not sure it's possible to locate which biff has which files. You need a program like Near Infinity to access them. Unfortunately, I don't know how it works with a tablet or phone. Near Infinity is written in Java and is cross-platform (I use it on linux), so it's possible it will work with Android (assuming that's what you're using).

If a mod touches a file, then it gets put in a folder called override, within the game folder. Then the file can be accessed directly. .ids files are just text files, so they can be opened right up.

The .ids file just defines constants. For our purposes, it's a list of which integer indicates which class.
  #8  
Old 01-15-2020, 07:41 PM
GESancMan's Avatar
GESancMan is online now
Guest
 
Join Date: Mar 2008
Location: Portland
Posts: 3,390
Quote:
Originally Posted by Damuri Ajashi View Post
Do you know where the address is for kits? I'd like Minsc to be a Berserker but i can't figure out how kits work.
Looks like the kit offset is 0244. Here's kit.ids:

0x4000 TRUECLASS
0x4001 BERSERKER
0x4002 WIZARDSLAYER
0x4003 KENSAI
0x4004 CAVALIER
0x4005 INQUISITOR
0x4006 UNDEADHUNTER
0x0040 MAGESCHOOL_ABJURER
0x0080 MAGESCHOOL_CONJURER
0x0100 MAGESCHOOL_DIVINER
0x0200 MAGESCHOOL_ENCHANTER
0x0400 MAGESCHOOL_ILLUSIONIST
0x0800 MAGESCHOOL_INVOKER
0x1000 MAGESCHOOL_NECROMANCER
0x2000 MAGESCHOOL_TRANSMUTER
0x4000 MAGESCHOOL_GENERALIST
0x4007 FERALAN
0x4008 STALKER
0x4009 BEASTMASTER
0x400A ASSASIN
0x400B BOUNTYHUNTER
0x400C SWASHBUCKLER
0x400D BLADE
0x400E JESTER
0x400F SKALD
0x4013 GODTALOS
0x4014 GODHELM
0x4015 GODLATHANDER
0x4010 TOTEMIC
0x4011 SHAPESHIFTER
0x4012 BEASTFRIEND
0x40000000 BARBARIAN
0x80000000 WILDMAGE
0x4020 Blackguard
0x4021 SHADOWDANCER
0x4022 DWARVEN_DEFENDER
0x4023 DRAGON_DISCIPLE
0x4024 DARK_MOON
0x4025 SUN_SOUL
0x4027 GRIZZLY_BEAR
0x4028 OHTYR
0x4029 OHTEMPUS

Be careful assigning kits, though. If you want Minsc to be a bezerker, then his base class needs to be changed to fighter. I don't know what kind of bizarre things might happen if a kit is assigned to a class it's not meant for. But it probably will just fail to work.
  #9  
Old 01-15-2020, 07:54 PM
GESancMan's Avatar
GESancMan is online now
Guest
 
Join Date: Mar 2008
Location: Portland
Posts: 3,390
For a little further clarification, I looked at Jan in Near Infinity. He's a mage/thief with the illusioninst kit.

0x0400 MAGESCHOOL_ILLUSIONIST

Looks like the kit is 4 bytes long, starting at 0244, so the hex looks like:

.............. 04 05 06 07
00000240 00 00 00 04

It seems that 0244 and 0245 are always 00. Weird that they did it that way.

Last edited by GESancMan; 01-15-2020 at 07:56 PM.
  #10  
Old 01-15-2020, 08:05 PM
GESancMan's Avatar
GESancMan is online now
Guest
 
Join Date: Mar 2008
Location: Portland
Posts: 3,390
I just realized something... everything I've been saying refers to modifying the NPC's creature file, but you're talking about editing your savegame file. Doh!

Ok, so looking at this another way: in a NPC creature file, the class starts at offset 0273, and the kit starts at 0244. So if you've located the NPC's class in your savegame file, you can figure out how far to back up to locate the kit.
  #11  
Old 01-16-2020, 08:00 AM
Damuri Ajashi is offline
Guest
 
Join Date: Jul 2006
Posts: 21,110
I'm on an android device.

BTW. I just realized this should probably be in game room.
  #12  
Old 01-16-2020, 02:14 PM
Damuri Ajashi is offline
Guest
 
Join Date: Jul 2006
Posts: 21,110
In the slot immediately below Charisma (8 spots later) is the fighter kit address on line 00000458 column 3

00=Basic Fighter
01=Berserker
02=Wizard Slayer
03=Kensai
04-09 does nothing and defaults to normal fighter

But this is all I need to turn Minsc into a Berserker.

Now I'm gonna try and figure out how to turn Khalid into a Cavalier.
  #13  
Old 01-16-2020, 02:22 PM
Damuri Ajashi is offline
Guest
 
Join Date: Jul 2006
Posts: 21,110
04=Cavalier
05=Inquisitor
06=Undead Hunter
20=Blackguard
  #14  
Old 01-16-2020, 02:47 PM
Damuri Ajashi is offline
Guest
 
Join Date: Jul 2006
Posts: 21,110
Barbarian requires a 40 in row 00000458 column 2 right below the Constitution stat
It also requires changing row 00000458 column 4 from 40 to 00

Wild Mage is 80 in that slot with an 01 in the class slot
40 Abjurer
80 Conjurer

one slot to the right of that
01 Diviner
02 Enchanter
04 Illusionist
08 Invoker
10 Necromancer
20 Transmuter
40 generalist
  #15  
Old 01-16-2020, 03:32 PM
Chronos's Avatar
Chronos is online now
Charter Member
Moderator
 
Join Date: Jan 2000
Location: The Land of Cleves
Posts: 86,725
[Moderating]

Huh, I'd seen this thread before, but I thought it was in the Game Room. Fixing that now.
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 06:26 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.

Send questions for Cecil Adams to: cecil@straightdope.com

Send comments about this website to: webmaster@straightdope.com

Terms of Use / Privacy Policy

Advertise on the Straight Dope!
(Your direct line to thousands of the smartest, hippest people on the planet, plus a few total dipsticks.)

Copyright 2019 STM Reader, LLC.

 
Copyright © 2017