Jump to content

Rebuilding Blucher's alternate BG2 NPCs


Recommended Posts

you guys are fast... I am still reading over Divine Remix 5 to see if I understand the OUTER INNER PATCH_IF_YOU_KNOW_WHAT_A_TPH IS :mad:


Sacrily, I understood you wrote, Nythrun, and CamDawg, I see what that table is. I even decipherred the COUNT_2DA_ROWS and reading in stuff. I am going to try some scratch pad work on the Development Wikki, for everyone to play with.


Just to be sure I am on the right track, as I understand what we are trying to do the ~read_from_template~ could also include experience points but not level, so that like TOB style NPCs, the base creature showing up ingame would actually be a L1 creature, but we can let the game decide exactly how advanced they are based on the 2da bringing in the correct .cre. So the added line to ~read_from_template~ would be


READ_LONG 0x18 "original_xp" //XP

Edit: Duh, not needed -- won't work. Nythrun's code above adds the xp, because we are reading only one of the .cres to create the template...


I also understand the re-patch of creature can be acomplished by that ~w_f_t~ by changing each READ to WRITE or WRITE_EVALUATED...


EDIT: put up on development wikki


If I understand correctly, by creating a blank creature file for each class and kit, we avoid having to build spellbooks and tables. This is why we want to do this, right?

If we do it this way, we can tweak all the creatures with C_E to match what we need for the final version.


Azazello, the list of NPCs is a little longer: I'll toss it up on the Wikki too.


EDIT: scratchspace up --


Link to comment

OK, I have some stuff scatched out for folks to poke at.




plus the read and write .tphs


If I did it kind of correctly, there is a component which can be installed or skipped

~Change Imoen's Class~


which has three subcomponents, one of which must be installed:

Imoen as TrueClass, starting at L1 with xp of XXXX granted based on .cre called ingame

Imoen as a Swashbuckler, starting at L1 with xp of XXXX granted based on .cre called ingame

Imoen as a Fighter, starting at L1 with xp of XXXX granted based on .cre called ingame


Tag - someone else is it; I need to wrap up some BG1 NPC code and see if I can get the final version 12 out the door for both Tutu and BGT folks!


Any clarifications, teaching/tutorials, even harsh criticism welcome - it is the best way to learn.

Link to comment

Just a base creature for each class/kit combination at L1.

HPs don't matter, gender, etc - nothing matters except that they be L1 creatures from each class/combo (well, obviously if they are multi-classed they need to be demi-human :mad: )


Then the process drops the modified .cres as L1 with all the experience expected by the various incarnations, so that if I pick Imoen up after Spellhold, she is a Swashbuckler L1 with 2000000 or whatever xps, and the player goes through the level-up process and assigns all the stuff they want. If I am in a BGT game and pick her up at L4 somehow, then she has the right experience, etc.


So far, the way it is going to work is we

1. use Nythrun's cool inner patch to gather the info from one copy of the original creature, and

2. copy over a base creature (that's what you and 5th horseman if interested would create) into a subfolder, then

3. a. patch the subfolder creature with the original information

3. b. tweak the creature further with any special stuff needed if we want (special items, changes in proficiencies tailored to the NPC, whatever)

3. c. output the changed cre (actually this happens as part of 1 and 2, but for ease of understanding) as the various incarnations based on version (Tutu, BG2, BGT), then

4. tweak the final creature set if we want to for any reason change other stuff (I think this goe better in #3, but here it would be player choice).


To clarify, the changes made in step 3 are ones we make from the development side; if I choose "Imoen as Swashbuckler", she comes as a L1 swashbuckler with the equipment, etc. created by us. The player cannot choose L1 proficiencies, or to equip her initially with a dagger and longsword a-la the Grey Mouser, or anything like that - we choose.

Link to comment
It's not really necessary to read from existing creature files at install time;

Definitely a cool idea, especially if using a complete patch instead of newbie multiple-mixed-stuff, but one step that I think will save some possible problems between versions is to keep this behavior.

All you need now is a list of which offsets are important to copy over :mad:

I'm on it! The use of the REGEXP stuff to find all .cre's with IMOEN and LAUNCH_PATCH_MACRO would be an easy way to make these changes; it also could be standard tp2 patching using C_E with a regualr wexpresion find for file. I will try both when the Wikki is back in operation, for you master-modder tytpes to comment on. As you said about Racial Enemy, we can leave that alone, as the base .cres will automatically be blank and then just overwrite the entry if a ranger class/kit combo is installed.


Haer'dalis has tiefling resistances, but only in his haer15 and haer19 .cre files (this is overworked ToB developers skimping time on an unpopular NPC).

I do recommend not using the level6 versions of NPCs to read from, as there are a few errors with these (mostly unused) incarnations that may not be corrected in the end users install.

Darned good to knoew on both accounts -- I have worked strictly with Tutu (and try hard to follow the BGT folks' discussions where it relates to things not working on their side).


Don't forget that Imoen is her own twin sister, which means keeping imoen10.cre separate from imoen211.cre, imoen213.cre and imoen15.cre - there first of those (death variable "imoen") is Chateau Irenicus and needs a special belt via ADD_CRE_ITEM, while the other three are death variable imoen2 and are for after Spellhold (the last of those is for Throne of Bhaal).
Got it! The "2" threw me for a loop there. Imoen10 is dungeon and chateau, needs the Belt of Game Chastity, and the others are free to get rolling!


I'd not worry too much about whether the NPCs qualify for their new classes ... well, if the developers bent these rules a lot, there's no reason why you can't.

I agree - for starters, anyways, we can set it up this way, and then as folks want to add code (highly encoraged - it would be ideal to have


Downside is that when Mazzy the necromancer, Keldorn the necromancer, and Aerie the necromancer join your party, they'll all know the same spells to start of with, which looks a little weird. Anyone who isn't expecting a healthy dollop of weird in this situation is being silly though...
I agree, but am ok with the downside (anyone who disagrees, please, you are welcome to adjust the wikki code -- this is definitely an open area!). It may be easier to have the base .cre be completely unequipped, and then use patching or tp2 to add a standard set of weapons by class, based on the install. That way you don't have to worry about _sw2h07 vs sw2h07, etc. - just ADD_CRE_ITM and be done. Same with profiencies; if we get them at L1 and are in a BG2 game, the player gets to modify like crazy; if in Tutu, well, there is always SK! We could just use the stereoptype weapons/armor for the new class. Same with the spells, but this is more awkward as clerics are alignment driven... if you build a base .cre with a good, neutral, or evil alignment and then overwrite the alignment, what happens to the spellbook?



I definitely hope this is a democratic/community mod revision. If everyone kicks in a little, we can get this up and running without a long development cycle. It really does mess with the original game intent, but if even one NPC you like could be interpreted in your mind as a slightly different class, here is your chance to kick in what *you* think the NPC should start like (code, folks, not ideas ;) money-where-mouth-is time!). I started with Imoen because I always thought of her as a short sword and dagger "Three Musketeer" (plus she is one of the toughest with the various incarnations and the differences across Tutu/BG2/BGT). I know existing mods do this, but that way I could compare the differences between approaches and learn more.

Link to comment
Just a base creature for each class/kit combination at L1.

HPs don't matter, gender, etc - nothing matters except that they be L1 creatures from each class/combo (well, obviously if they are multi-classed they need to be demi-human :mad: )

OK, I'm on it. I need one to two weeks to have 'em all ready (Real Life... meh). In Blucher's original mod there are already some CREs created, but I'll make new one to ensure that they are factory-approved.


I have a vanilla, patched install of BG2-ToB ready. I thought of rolling CREs from the New Game creation screen, ensure that stats are "below optimal", e.g. most scores 10 or below - not counting required stats for classes like Paladin. Is this OK?


I'll have do multi-class CRE and dual-class CRE combos, n'est pas? (for different races? ouch!) Or will coding handle this?


Where do I put the finished products?

Link to comment

I would go with absolutely vanilla base .cres for any class or class/kit combination you want to allow a player to use. Since we will be patching the stats from the original NPC back over (with adjustments if folks want, but we don't have to) the stats don't matter. You might (for simplicities sake) want to SK the initial HPs up to maximum to be nice to Tutu players, but that is your perogative.


Don't worry about equipping them or anything fancy, we can do that later - all we need is a Guru (hey out there in Expert-Land :mad:)to let you know if it is necessary to have the base .cre for Clerics be different for each alignment combination, or if we just need a single basic Cleric .cre that will adjust its spellbook when we patch the NPC alignment back over it.


Hold onto your .cres for now (they are small) - I have a temporary site we can use when we have enough stuff to start putting this together. When we get some other folks doing some stuff that requires actual files, we could ask CamDawg for some space if people feel odd about dropping thier work to a private email, but 90% of the coding work can be done on the wikki so that everyone can help fix/comment!


NiGHTMARE, et al are right on the choice thing, from your perspective, though - these are L1 NPCs so dual class will have to have the correct race to allow it to happen. You may want to make decisions on how far you are willing to go in terms of concept - minor, major, or complete freedom for the end user.

Link to comment

Thanks to whoever added BG1 NPCs to the wiki. Very sweet!


{BTW, please add their default class/kit with a 99: label to the top of their choices. Check the other NPCs for example.}


And thanks very much for splitting the topic. I did indeed mean for the original topic to focus on non-WeidU mods in-general.

Link to comment

Oh, no problem, man... got your back :)


Now all we need is for a couple of other folks tro step in and give a boost.


Community project, y'know... the good kind, where we all work on it, so it gets done quickly and out to test!

Link to comment

I have finished the first batch of baseline CREs.


When ready, please double-check that the files have been sanitized correctly. I'm sure I left some junk in them that don't belong there.


I'm gonna stop for several reasons:

- interesting procsses, doing it manually, but hoping that some semi-automatic way will be developed to make the multi-/dual-class versions.

- I'ld like to see some testing on these current templates, just to confirm that we're approaching this from the right direction.


Notes on the CREs:

- all of them have 4 HPs. Yup, this is by design! Level 1 Mages will praise my name; all others will curse it.

- I gave every CRE just one weapon proficiency. No particular reason for this. Will the engine assign the correct number of pips once the NPC has been given more experience points?

- of course, removed the PC innates from each NPC.

Link to comment

Could a knowledgeable person please check this code before I start on a huge copy/paste rampage? I know this is unnessesary, as it is just rebuilding the .cre that exists, but that is why it makes a great test...


	  /* TUTU Build base .cre, read in values */
  COPY ~level1npcs/thieves/thief.cre~ ~level1npcs/template/imoen.cre~
		LAUNCH_PATCH_MACRO ~read_from_template~

  /* TUTU _IMOEN (6xp, cutscene only) */
  COPY ~level1npcs/template/imoen.cre~ ~override/_imoen.cre~
		LAUNCH_PATCH_MACRO ~write_from_template~
	  WRITE_LONG  0x0018  0x0006  //experience
	  WRITE_SHORT 0x0028 0x6310 //animation ID thief_female_human

  /* TUTU _IMOEN1 (9xp, _BOW05, 2x_AROW01, 3x_POTN08, _WAND12, _POTN14) */
  COPY ~level1npcs/template/imoen.cre~ ~override/_imoen1.cre~
		LAUNCH_PATCH_MACRO ~write_from_template~
	  WRITE_LONG  0x0018 0x0009  //experience
	  WRITE_SHORT 0x0028 0x6310 //animation ID thief_female_human


EDIT: Edited per Grim Squeaker's post :) so that the default for Imoen matches her BG1 items - 1 short bow, 2 quivers of 20 arrows, 1 MM wand with 10 charges left, and three potions of healing.


EDIT2: Edited pr Nythrun's help for correct (?) usage of WRITE_LONG (I need to edit the BG1 NPC tp2 pretty extensively then, and check the internet for how to understand 0x0001 vs 1 h vs 1 :)) Looking up and adding proficiencies (although the bas .cres should have them)

Link to comment

I would greatly appreciate confirmation on the above code, and some assistance on the ADD_CRE_ITEM - I am not understanding the three "charges" usage, and whether or not I need to "equip" quick items, and I have used the animation id from NI, but notice it is a 2 byte field that has what looks like an ascii reference. Should I be using WRITE_ASCII here? Most of all, I am unsure of READ behavior; if I read the .cre, does that info stay resident in memory for multiple actions (for example, two separate ACTION_IFs for BG2 and BGT) until another is read in, or do i need to read beofre each WRITE component?

Link to comment

Example of ADD_CRE_ITEM from Jelina:


  ADD_CRE_ITEM ~leat05~ #0 #0 #0 ~IDENTIFIED~ ~ARMOR~
 ADD_CRE_ITEM ~amul09~ #0 #0 #0 ~IDENTIFIED~ ~AMULET~
 ADD_CRE_ITEM ~potn52~ #2 #0 #0 ~IDENTIFIED~ ~QITEM1~
 ADD_CRE_ITEM ~potn08~ #4 #0 #0 ~IDENTIFIED~ ~QITEM2~


Basically you use EQUIP only for weapons as that'll state which of the characters many items the CRE will actually have ready to use. If you look at the bottom two you can see a simple use of charges (which is all you'll need for ammo). That first entry means the number in the stack (in this case the number of various healing potions Jelina starts with).

Link to comment


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

This topic is now closed to further replies.
  • Create New...