Jump to content

SubtleMods: NPC_EE - in-game customization for NPCs


Recommended Posts

I'd like to announce my NPC customization mod: Non-Player Characters, Enhanced for Everyone. That's right - NPC_EE!

You can download the mod here.

And here is the Readme.

EDIT February 2022: this mod has gone through many iterations including several huge, ground-up structural changes. I'll keep some of the old description in spoiler tags, but here is how the mod works as of version 5.0:

This allows you to completely customize any NPC that joins the party, in almost any way. Every NPC will have a book that allows you to make changes to the character; if you don't want to change them, you can simply throw the book away. But if you want to change the character you can use the book from a quickslot.

Using the book will open up a dialogue. If you tell it you want to make changes, then the NPC will be dropped to level 0 and you will be prompted to choose a class. This can be a new class, or the same class they already had. (You can choose the same class if you only want to change the NPC's kit, or proficiencies or something.)

After choosing a class you will be prompted to make changes to the NPC's ability scores. Any score can be changed to anything from 5 to 25. If you end up choosing a class with minimum ability scores higher than when you choose, than any too-low scores will be raised to the minimum.

After the NPC's ability scores are set, you will be prompted to choose a kit. For single-class NPCs, you can choose any kit installed in the game that is valid for their class. If tyhe NPC is multiclassed, then you can choose any single-class kit that is valid for either underlying class, or any multiclass kit installed for that multiclass combo.

After the dialogue ends, you will have a level 0 NPC with 2 hit points and no proficiencies or skills. You can go to the Record screen and level them up. Now there are two possibilities:

  • If they only have enough XP to become level 1, you will be prompted to choose their 1st-level proficiencies and (if appropriate) thief skills. Sorcerers and shamans will be prompted to choose spells.
  • If they have enough XP to jump from level 0 straight to level 2 or higher, then you will be prompted to allocate thief skill points (if appropriate) and sorcerers and shamans will be prompted to cast spells; but you will only be able to choose proficiencies based on proficiency points gained after level 1. In this case you will be given an innate ability, which looks like a green sword in a circle on a white background. This will open up a new dialogue and allow you to gain any proficiency points that you were supposed to get from level 1.

NOTE: If you have any proficiency abilities from Scales of Balance (it will look like a green or yellow sword in a circle on a black stone background), then you are advised to use those abilities before you use the green-on-white NPC_EE proficiency ability.

Finally, if your new class is a mage, you will be granted a gem that can be used to learn a couple spells. Just put it in a quickslot and you can use it over and over until you have learned all you can. This will let you learn up to two spells in each level of the spell levels that you can cast. It will only let you learn up to two spells total; so if you already know two spells in each spell level, this will not do anything.

FINAL NOTE: the book that lets you change class/stats/kit will only work in a limited fashion for NPCs who is dual-classed. Their dual-class flag cannot be changed at all in the game, so the dialogue cannot change their class, or proficiencies. You can only change their kit this way. If you want to change Imoen, Nalia, or Anomen's class, there are installation options to remove their dual-class flags at the time you install them mod. This will, for example, change Imoen from a dual-class thief-->mage into a multiclass mage/thief. Wen you go into the game, she will advance as a multiclassed character. You CAN still change her back into a dual-class (as, indeed, you can change any NPC into a dual-class) by using the book. In this case, to change Imoen from a multiclass back into a thief 7-->mage 9, then the procedure would be something like this:

  • Use the book to change Imoen into a single-class thief (choose a kit if you want her to be e.g. a swash-->mage!)
  • Use the console to set her XP as a 7th-level thief (45,000 or so): " C:SetCurrentXP("45000") "
  • Level her up from 0 to 7, setting her thief skills and choosing proficiencies
  • Use the white proficiency ability to choose more proficiencies
  • On the Record screen, press "Dual-class"
  • Choose her new class, e.g. mage
  • Use the console to set her XP to what it should be, e.g. 89,000 for the start of SoA: " C:SetCurrentXP("89000") "
  • Done! the installation changed her to multiclass but now you have changed her back to dual-class.

Of course, instead of making Imoen a thief-->mage again, you could make her a ranger-->cleric, or a cleric-->mage, or whatever. By setting her to be a multiclass during installation, it opens up the maximum variety of possibilities that you can choose for her in-game.

------------------------

The old description:

Spoiler

Please note, this is EE-only. If you're playing TOB or BGT or Tutu, you should instead use the excellent "Level 1 NPCs" mod.

What is this mod?

Well, this is a bone I'm throwing to BGEE players, since the wonderful, excellent, currently-unsupported "Level 1 NPCs" mod does not work on the new engine. I added some rekitted NPC components to the end of my Scales of Balance mod (SoB); but there were only a few options, and many of them relied on having installed earlier parts of SoB.

This mod includes various options to change NPCs' class. There are only a few such options, because there are only so many class changes that work - for lore reasons, I'm not changing Jaheira from druid, or Quayle from cleric/mage, or Kagain from fighter, etc. Side benefit: less work for me! :p

Then, in-game, the magic happens: the mod generates a script on the fly that will detect any kits in your game, including mod kits. Every single joinable NPC in the game will get an innate ability to add a kit, or to switch to a new kit, and they will have options for every kit that their class (or multiclass!) allows.

You can turn Minsc into a fighter, and then in-game you can turn him into a Barbarian!  You can turn Coran into a kensai/thief. You can turn Montaron into a berserker/thief. You can make Imoen into a mage/thief multiclass, and then in-game turn her into a swashbuckler/mage. Et cetera.

By default, when you use the ability to change someone's kit, it will zero out their proficiencies and then present you with several innate abilities, which will let you add new ones from scratch.  If you like, you can give an NPC the same kit they already have, and just use this to choose new proficiencies for them.  (If you don't like the proficiency stuff, you can turn it off in the mod's settings file before you install it.)

 

F.A.Q.:

Can't people just use EEKeeper for this?

Yes. But you have to wait until the NPC is in your party, and quit out of the game and spend 20 minutes fiddling in EEKeeper when you really want to be playing. It's a lot easier to install this via Weidu, IMHO. Of course EEKeeper is more flexible, so if the class you want for Shar-Teel isn't in this mod, you can always use EEKeeper as a fall-back. Again, the spirit of this is, more options are better than fewer options.

 

Okay, can I change things around later?

Yes.  Well, the whole idea of this is that it reduces your need to uninstall/reinstall the mod, the way you would have to with Level1NPCs.  You can run two games simultaneously and, because you choose kits for NPCs in-game, the same person can have a different kit and different proficiencies in each playthrough, at the same time and without reinstalling anything!  Of course the class changes will require a reinstall to undo or alter, so this mod should be installed dead last, after all other mods. After BG2Tweaks. After SCS. All the way at the end.

 

I've already changed up some NPCs with Scales of Balance components (or the NPCKits mod, or some other method). Do I have to uninstall those changes before using this mod?

No - whichever one goes in last should control. You should be able to install/uninstall/reinstall this one on top of anything else you've already done. (I have not tested doing this, but it overwrites the various ckass/kit/HP/etc. fields, so I don't see how they would conflict.)

 

Cheers!

Edited by subtledoctor
Link to comment

...making an L1NPCs.. version .. for the EEs...

There's a legend that someone already did that... I would say that CrevsDaak had done that, or a lot of work towards it, but he went silent about this subject some time ago:

 

...

OK, that had escaped me. Then I'll list new NPCs and done.

So you might ask of it ..

 

Here is the download link.

 

And here is the ReadMe

:beer:

Edited by Jarno Mikkola
Link to comment

Nice. Well like I say, feel free to add in anything you want. (And/or criticize the code... some of it needs work, like the "Ajantis=Inquisitor" component that I've commented out.)

 

Also, one of my back-burner ideas for this is to add an .ini file that just looks like

AJANTIS_1 = bastard sword 
AJANTIS_2 = long bow
...
etc.
And let the .tp2 read that and insert them into the proficiency assignment, just to give the player one more thing they control. It's still nowhere near the control that L1NPCs gives you, but it would probably be enough for most people. Edited by subtledoctor
Link to comment

 

...making an L1NPCs.. version .. for the EEs...

There's a legend that someone already did that... I would say that CrevsDaak had done that, or a lot of work towards it, but he went silent about this subject some time ago:

 

...

OK, that had escaped me. Then I'll list new NPCs and done.

So you might ask of it ..

 

Here is the download link.

 

And here is the ReadMe

:beer:

 

Eeeeh, my version barely installs, it is in my old computer's HDD (if it wasn't accidentally deleted in one or misplaced), and I haven't even finished adding all of the EE NPCs (I had added Neera and Dorn (both BG:EE and BG2:EE), and had started adding Rasaad), so I wouldn't say that it's actually there for anyone else to install... I'll look for it later and see if I can get some more work done (dude, 'cause I had even forgotten xD).
Link to comment

That came together faster than I thought! Here's a very rough beta of v2.

 

Some of the strings are stupid, and it's limited to the NPC's current class. I'll clean up the text and eventually add some Weidu options to change some NPCs' class. Consider this a proof-of-concept.

 

https://dl.dropboxusercontent.com/u/86011511/NPC_EE_beta.zip

 

EE-only - it relies on an EE feature of kitlist.2da. If you're playing BGT or TOB, use Level1NPCs instead.

Link to comment

Okay: I'm ready to unveil v2!

 

Download link

 

This makes MAJOR changes. There are no more options to change kits. Instead, there are options to change NPCs' class. There are many fewer components, because there are not as many class changes that work (for lore reasons, I'm not changing Jaheira from druid, or Quayle from cleric/mage, or Kagain from fighter, etc. Side benefit: less work for me! :p

 

Then, in-game, the magic happens: I've devised a way to generate a script on the fly that will detect any mod kits you have added. Every single joinable NPC in the game will get an innate ability to add a kit, or to switch to a new kit, and they will have options for every kit that their class allows.

 

It's frakkin' awesome.

 

What's more: I've cheated a bit. Just 20 minutes ago, I figured out how to add an extra option to sorcerers, allowing them to take the Wild Mage wizard kit. I haven't tested it at all but I did confirm that it works. So, with this mod you can turn Neera into a sorcerer, and then in game turn her into a Wild Sorcerer! It's perfect for her!

 

You can turn Minsc into a fighter, and then in-game you can turn him into a Barbarian!

 

Also, as if that's not enough (come on!):

 

I've also added options for multiclass characters to take a kit. They can only take a kit in one class, so here how it pans out:

- ranger/clerics: choose a ranger kit

- fighter/clerics: choose a cleric kit

- cleric/thieves: choose a cleric kit

- cleric/mages: choose a cleric kit

- fighter/druids: choose a fighter kit

- fighter/thieves: choose a fighter kit

- fighter/mages: choose a fighter kit

- thief/mages: choose a thief kit

- fighter/mage/clerics: choose a cleric kit

- fighter/mage/thieves: choose a fighter kit

 

So you can turn Coran into a kensai/thief. You can turn Montaron into a berserker/thief. You can make Imoen into a mage/thief multiclass, and then in-game turn her into a swashbuckler/mage.

 

YES, you can do all of this and more with EEKeeper. But this is much cooler and easier to use.

 

Cheers!

Edited by subtledoctor
Link to comment

Hey, I've noticed that you added support for EET in this mod. Thanks. Few things are not perfect yet though. In EET following NPC BG1 creatures are renamed due to conflicting names with BG2 resources:

IMOEN6 => IMOEN6_ (IMOEN61 in BGT)

QUAYLE => QUAYLE_ (BGQUAYLE in BGT)

VICONI6 => VICONI6_ (VICONI61 in BGT)

XAN => XAN_ (BGXAN in BGT)
XZAR => XZAR_ (BGXZAR in BGT)

 

Also your code is not compatible with tutu at all. That platform renames every single resource in BG1 by adding _ at the beginning, not only for conflicting ones. Overall I think it would be better to assign variables depending on the platform like this and paste it into ALWAYS section of the tp2 file (this way they will be assigned for each component). Right before LANGUAGE declaration you could add something like this:

ALWAYS
  ACTION_IF GAME_IS ~bgee~ BEGIN
    OUTER_SPRINT tutu_var ~~
    OUTER_SPRINT IMOEN6_var ~IMOEN6~
    OUTER_SPRINT QUAYLE_var ~QUAYLE~
    OUTER_SPRINT VICONI6_var ~VICONI6~
    OUTER_SPRINT XAN_var ~XAN~
    OUTER_SPRINT XZAR_var ~XZAR~
  END ELSE ACTION_IF GAME_IS ~eet~ BEGIN
    OUTER_SPRINT tutu_var ~~
    OUTER_SPRINT IMOEN6_var ~IMOEN6_~
    OUTER_SPRINT QUAYLE_var ~QUAYLE_~
    OUTER_SPRINT VICONI6_var ~VICONI6_~
    OUTER_SPRINT XAN_var ~XAN_~
    OUTER_SPRINT XZAR_var ~XZAR_~
  END ELSE ACTION_IF GAME_IS ~bgt~ BEGIN
    OUTER_SPRINT tutu_var ~~
    OUTER_SPRINT IMOEN6_var ~IMOEN61~
    OUTER_SPRINT QUAYLE_var ~BGQUAYLE~
    OUTER_SPRINT VICONI6_var ~VICONI61~
    OUTER_SPRINT XAN_var ~BGXAN~
    OUTER_SPRINT XZAR_var ~BGXZAR~
  END ELSE ACTION_IF GAME_IS ~tutu tutu_totsc~ BEGIN
    OUTER_SPRINT tutu_var ~_~
    OUTER_SPRINT IMOEN6_var ~IMOEN6~
    OUTER_SPRINT QUAYLE_var ~QUAYLE~
    OUTER_SPRINT VICONI6_var ~VICONI6~
    OUTER_SPRINT XAN_var ~XAN~
    OUTER_SPRINT XZAR_var ~XZAR~
  END
END

now you no longer need separate blocks for each platform. For example this (which is not really compatible with either EET or Tutu):

ACTION_IF GAME_IS ~tutu bgee eet~ THEN BEGIN
    COPY_EXISTING ~IMOEN1.cre~ ~override~
                ~IMOEN2.cre~ ~override~
                ~IMOEN4.cre~ ~override~
                ~IMOEN6.cre~ ~override~

could be changed to:

ACTION_IF GAME_IS ~tutu tutu_totsc bgee eet bgt~ THEN BEGIN
    COPY_EXISTING ~%tutu_var%IMOEN1.cre~ ~override~
                ~%tutu_var%IMOEN2.cre~ ~override~
                ~%tutu_var%IMOEN4.cre~ ~override~
                ~%tutu_var%%IMOEN6_var%.cre~ ~override~

notice that whole

ACTION_IF GAME_IS ~bgt~ THEN BEGIN

block in mage_thief.tpa is no longer needed if you code it like this, so there is less chance for mistakes.

 

btw. if you are adding exact same changes in both BG1 and BG2 creatures than you could use code like this instead (Imoen used just as an example, from what I've seen you are doing different patching in BG1 and BG2):

ACTION_FOR_EACH file IN ~%tutu_var%IMOEN1~ ~%tutu_var%IMOEN2~ ~%tutu_var%IMOEN4~ ~%tutu_var%%IMOEN6_var%~ ~IMOEN6~ ~IMOEN10~ ~IMOEN15~ ~IMOEN211~ ~IMOEN213~ BEGIN
  ACTION_IF FILE_EXISTS_IN_GAME ~%file%.cre~ BEGIN
    COPY_EXISTING ~%file%.cre~ ~override~
      //do your patching
    BUT_ONLY
  END
END
Edited by K4thos
Link to comment

Oy. More, different renaming conventions. What was wrong with the BGT convention?

 

Well, I think I'm just removing Tutu compatibility - it's not used very much, and it's a ton of work to deal with, and I don't have a Tutu install to test with so I would be releasing code blindly. And it's fine for this mod, anyway, because it's now EE-only.

 

As for EET, I'll get around to adding those variants when i can. Bad timing though, as RL is preventing me from doing much more than the occasoinal bug-fix and some forum posts. Until SoD comes out, EET is not going to be a very high priority...

Link to comment
What was wrong with the BGT convention?

1. It's not consistent. Using exmples from previous post:

QUAYLE => BGQUAYLE - this one is fine

IMOEN6 => IMOEN61 - this is odd one

2. Due to 2 characters prefix there are instances where 7 character filenames had to be changed to fit in 8 characters limit (no common convention, dropping 1 or 2 letters, usually at the end but not always).

3. Area renaming have no bearing on the original BG1 area numbers. You are always forced to use external site for reference

4. It changes much more than it should (for example every single EXIT and DOOR name in area files)

5. BGT appends dialogues for continuous NPCs, so common convention with EET wouldn't be reliable either way

And so forth. Ascension64 (author of BGT-weidu) actually agrees with the opinion that it's not a good convention.

 

When modding EET you pretty much only need to know about 2 rules regarding BG1 resources:

- area resources = changed prefix from AR to BG

- other resources = "_" suffix at the end of few conflicting files

 

As for EET, I'll get around to adding those variants when i can. Bad timing though, as RL is preventing me from doing much more than the occasoinal bug-fix and some forum posts. Until SoD comes out, EET is not going to be a very high priority...

Thanks. You may also consider using cross-platform coding implementation via community standard cpmvars btw. These files contains all vatiables that you will need in your mods to make it work with all platforms.

 

------------

 

Some bug reports:

1. npc_ee/npcs/coran/bard.tpa

EXTEND_BOTTOM ~imoen.bcs~ ~npc_ee/npcs/coran/coran_bard.baf~

=>

EXTEND_BOTTOM ~coran.bcs~ ~npc_ee/npcs/coran/coran_bard.baf~

2. Pretty much every EXTEND_TOP like the one above for BG2 NPCs is not compatible with a game started in ToB because you only modify non-ToB variants of Override scripts.

Edited by K4thos
Link to comment

2. Pretty much every EXTEND_TOP like the one above for BG2 NPCs is not compatible with a game started in ToB because you only modify non-ToB variants of Override scripts.

Actually most of them do also EXTEND the TOB scripts, but a few (Nalia, Mazzy) were missing. Good catch.

 

As to EET, I don't mean to gripe and it is 100% in my plans. It's just, RL is absolutely destroying me right now and I don't have enough time to get this done anytime soon.

Link to comment

Just taking a closer look at this. It's a very nice technique, defining the variables up-front. But I see a possible problem (really just with Imoen and Viconia)

now you no longer need separate blocks for each platform. For example this (which is not really compatible with either EET or Tutu):

ACTION_IF GAME_IS ~tutu bgee eet~ THEN BEGIN
    COPY_EXISTING ~IMOEN1.cre~ ~override~
                ~IMOEN2.cre~ ~override~
                ~IMOEN4.cre~ ~override~
                ~IMOEN6.cre~ ~override~
could be changed to:
ACTION_IF GAME_IS ~tutu tutu_totsc bgee eet bgt~ THEN BEGIN
    COPY_EXISTING ~%tutu_var%IMOEN1.cre~ ~override~
                ~%tutu_var%IMOEN2.cre~ ~override~
                ~%tutu_var%IMOEN4.cre~ ~override~
                ~%tutu_var%%IMOEN6_var%.cre~ ~override~
notice that whole
ACTION_IF GAME_IS ~bgt~ THEN BEGIN
block in mage_thief.tpa is no longer needed if you code it like this, so there is less chance for mistakes.

 


In EET and BGT you don't just need the one variant of Imoen6 or Viconi6; I need to patch both imoen6 and imoen61; and both viconi6 and viconi61. So I would still need a separate block for

ACTION_IF GAME_IS ~bgt eet~ THEN BEGIN

No?

Link to comment

You can patch both at the same time, that's why we're setting these variables beforehand. This example probably is more readable:

ACTION_FOR_EACH file IN ~IMOEN1~ ~IMOEN2~ ~IMOEN4~ ~%IMOEN6_var%~ ~IMOEN6~ ~IMOEN10~ ~IMOEN15~ ~IMOEN211~ ~IMOEN213~ BEGIN
  ACTION_IF FILE_EXISTS_IN_GAME ~%file%.cre~ BEGIN
    COPY_EXISTING ~%file%.cre~ ~override~
      //do your patching
    BUT_ONLY
  END
END

above example will return correct file names for both BGT and EET but only if you assigned that "IMOEN6_var" like I've mentioned in the first post. If you don't know which variables needs to be set than please consider downloading cpmvars for each platform here (notice that these files contains exactly the same variable names but different words evaluated in them) Now INCLUDE each of these files in the ALWAYS section of your mod depending on GAME_IS command. From now on you no longer need to worry about setting variables, you just need to remember which files are renamed and replace the names with variable names, using BG:EE file as a reference. Let me know if it's still confusing.

Edited by K4thos
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...