Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Planescape: Torment: Enhanced Edition has been released! Visit www.planescape.com to purchase and check for details. Planescape: Torment: Enhanced Edition Official Soundtrack is available.
Soundtracks for BG:EE, SoD, BG2:EE, IWD:EE are now available in the Beamdog store.
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

[Tool] QDMULTI: A Library for Multiclass Kits

AquadrizztAquadrizzt Member Posts: 736
edited January 23 in General Modding
QDMULTI is a library for mods that install multiclass kits in the Enhanced Infinity Engine (v2.0+).

The newest version of this library is available on GitHub.

Background

Beamdog released the Enhanced Infinity Engine (v2.0) with the release of their original game, Siege of Dragonspear. Among numerous other functionality changes, this patch enabled the character creation menus to display multiclass kits. Unfortunately, any kit that would appear in the multiclass menus would not gain any of its unique class bonuses, due to the way that the engine handled multiclass kits.

This library fixes that problem, and enables multiclass kits to both appear properly in character creation and apply the appropriate bonuses during character advancement.

Usage

If you would like to tie your mod's multiclass kits into the qdmulti framework, then you first need to download the latest version of qdmulti and include it somewhere in your mod's installation files. The .tpa file (qd_multiclass.tpa) can be kept anywhere within the installation files, but the other three files must be kept in the same directory.

After adding these files to your mod structure, you can enable the functionality in your mod's compenents by adding the following code to your mod's installation files (either .tp2 or .tpa).

This line should be included before you use the ADD_KIT function (if you are adding a new kit).
INCLUDE ~your/folders/here/qd_multiclass.tpa~ 
This line should be included after you use the ADD_KIT function (if you are adding a new kit).
LAF qd_multiclass
STR_VAR
kit_name = ~kitname~ //the internal name for your kit (e.g. QDMAGUS)
kit_clab = ~kitclab~ //the internal name of your kit's clab file, without the .2da extension
base_class = ~X~ // this can take 6 values: [F]ighter, [P]riest, [D]ruid, [R]anger, [M]age, [T]hief
mc_dir = ~your/file/structure~ // the directory containing the three files, as noted above
END
Of the parameters utilized, the only one that I feel needs further explanation is the "base_class" parameter. This parameter handles which class the kit abilities will be tied to; if you say that a multiclass kit's base class is fighter ("base_class = F"), then it will gain the assigned kit bonuses from increases in its fighter level.

Limitations

Note that this library is only designed to handle class benefits that are granted through the class' clab file; it will not handle specialist mages' school restrictions, specific kit's item restrictions, or other effects tied to the kit's usability flags.

Furthermore, due to the length restrictions on internal names, the library can only include abilities that have internal names of 7 characters or less. Abilities with internal names of 8 characters (or more) will not be converted during the qd_multiclass function.

Applications

This library is very versatile, and can be used in a variety of scenarios. Some of the things it can do include:
- giving a kit to a multiclass character at character creation (e.g. Swashbuckler/Mage).
- allowing a multiclass character to have one kit for each of their classes (e.g. a Berserker/Priest of Talos).
- allowing modders to implement their own multiclass kits that have abilities tied to each of the base classes (e.g. the Bladesinger Fighter/Mage kit).
- allowing a single- or multiclass character to gain the benefits of multiple kits of the same class.

QDMULTI in Action

Mods that make use of QDMULTI include:
- Eldritch Magic by @Abdel_Adrian
- Might and Guile by @subtledoctor

Permissions and Support

I am publishing QDMULTI so that other modders may make multi-class kits more reliably and efficiently. I do not require nor expect modders to contact me requesting permission to use this library. If you encounter errors while using this library, please contact me so that I may provide fixes and updates.
Post edited by Aquadrizzt on
Abdel_AdrianGrammarsaladinethKurona
«134

Comments

  • subtledoctorsubtledoctor Member Posts: 7,552
    Well, I guess the secret's out. But, I got there first! :tongue:

    Man I can't even imagine the amount of super-powered multiclass kit cheese people are going to produce with this... :tongue:

    More seriously, great work. When I have some time I'll try using this in Might & Guile for my three multiclass kits that aren't proper multiclass kits. If this works for the Ranger/Mage it'll work for anything.

    @Abdel_Adrian might also be interested.

    Finally, a note to any future users of this: be warned that ANY kitted mage, regardless of which kit they have or whether they are single-class or multiclass, will get an extra spell per level like specialists. As far as I know this is hard-coded and difficult to code around. So keep that in mind for purposes of balancing: a kitted multiclass fighter/mage (for example) already will have a *huge* built-in advantage over regular fighter/mages... and fighter/mages are already regarded as just about the most powerful class in the game. Design your kits accordingly.
    Abdel_Adrianineth
  • AquadrizztAquadrizzt Member Posts: 736
    edited June 2016
    @subtledoctor , if your Ranger/Mage is just a Thief with a bunch of granted abilities in a CLAB, then it should work. I haven't found kit issues that can't be coded around (e.g. backstab progression defaults to the base Thief's for multiclasses, but opcode 263 applied at specific levels fixes that.) Obviously this is a work in progress and I'll refine it more as time goes on.

    I'll post a more thorough guide on how to use this and how to work with various engine limitations at some point. Now that I've coded this, I need to actually get back to work on updating the mod that lead me to make this in the first place...
    Mythalar
  • subtledoctorsubtledoctor Member Posts: 7,552
    I wonder how multiclass kits deal with HLA tables. Do they get their own, or do they use the base multiclass table, or is it like clab tables where they use both of the trueclass single-class tables.

    If anyone plays to epic levels with my Bladesinger or any forthcoming multiclass kit, please let us know what you experience as far as HLAs.
  • OlvynChuruOlvynChuru Member Posts: 1,440
    edited June 2016
    A kensai/swashbuckler would be insane. At level 30/30 in Icewind Dale they would have +9 AC and +16 damage and THAC0.
  • Abdel_AdrianAbdel_Adrian Member Posts: 423
    edited June 2016
    @subtledoctor I will admit you absolutely did this first post-2.0 and were gracious enough to share your code with me, BUT I did try it just about as soon as BGEE came out! Even made my own K_X_Y.2da's like we have now. Just wasn't possible then without the scroll bars in character creation. Same with creating selectable tieflings, but @rapsam2003 and I figured that out post-2.0.
    I can't wait for IWDEE to update.
  • subtledoctorsubtledoctor Member Posts: 7,552
    Poop - I just realized I'm going to have to update NPC_EE to recognize these kits. Oh, this is going to get complicated...
  • subtledoctorsubtledoctor Member Posts: 7,552
    Btw Aquadrizzt my unmodded copy of BGEE 2.2 does not have clabma01.2da in it. So you should do a check for it and supply a blank copy if it doesn't exist.
  • AquadrizztAquadrizzt Member Posts: 736
    @subtledoctor , the very first thing the main function does is add a blank CLABMA01.2da if it doesn't exist.
    Abdel_Adrian
  • subtledoctorsubtledoctor Member Posts: 7,552
    Oops - I missed that. (Skipped to the middle!)
  • rapsam2003rapsam2003 Member Posts: 1,481

    @subtledoctor I will admit you absolutely did this first post-2.0 and were gracious enough to share your code with me, BUT I did try it just about as soon as BGEE came out! Even made my own K_X_Y.2da's like we have now. Just wasn't possible then without the scroll bars in character creation. Same with creating selectable tieflings, but @rapsam2003 and I figured that out post-2.0.
    I can't wait for IWDEE to update.

    I was not following things; been busy with work. Is it possible now? (My gut says "no", because why make it easy?)
  • subtledoctorsubtledoctor Member Posts: 7,552
    Is what possible now? New races/subraces? No. You guys have that particular minefield all to yourselves. :wink:

    Proper multiclass kits? Yes, and Aquadrizzt's functions here will make it quite easy for just about anyone to make them.
  • Abdel_AdrianAbdel_Adrian Member Posts: 423
    edited June 2016
    @rapsam2003 Yeah, we discussed it in your thread while I was helping you figure it out - doesn't mean it's necessarily a "new race" the way you can achieve with scripts, but I could have sworn I posted an image of selectable tieflings. It's just an elf, blame Haer'dalis.
    I've got vampires in BG2EE too, out of necessity, but there are no classes attached to the race.ids file so it's just a placeholder to prevent a bug that would appear without it there.
    But this is off topic. Multiclass kits are now possible for the same reason as my tieflings and vampires: scroll bars.

  • subtledoctorsubtledoctor Member Posts: 7,552
    Actually it's not just a matter of scroll bars. It's that, in 2.0+, when you click a multiclass, if the game detects a K_MC_R.2da file with more than one entry, it kicks you into the kit selection screen. That doesn't happen in 1.4 or lower.
  • inethineth Member Posts: 443

    Man I can't even imagine the amount of super-powered multiclass kit cheese people are going to produce with this... :tongue:

    Kensai/Assassin/WildMage triple-class playthrough confirmed! :P
  • ScrybeScrybe Member Posts: 13
    Hey man; signed up just so I could thank you!

    Awesome to see something like this finally come around! I've been playing BG for about 13 years now, and I always wanted to mix and match the classes like this. Just what I wanted to be rekindle my desire to play.

    I do have a slight problem with it so far though; all the descriptions seem to be messed up for me on the two installed kits. Getting a placeholder for Kensai/Thief and a random text string for the Berserker/Priest of Talos. Any ideas on why this might be happening?
  • AquadrizztAquadrizzt Member Posts: 736
    @Scrybe , that's strange that the descriptions are messed up. I can't seem to find a reason why these wouldn't work properly. As an aside, the mod isn't an officially supported mod so much as an example of how to add kits to multiclasses.
  • Abdel_AdrianAbdel_Adrian Member Posts: 423

    Actually it's not just a matter of scroll bars. It's that, in 2.0+, when you click a multiclass, if the game detects a K_MC_R.2da file with more than one entry, it kicks you into the kit selection screen. That doesn't happen in 1.4 or lower.

    True, it's not just the one thing I mentioned. Either way, 2.0 has brought some amazing mod capabilities to the engine...and now I have an excuse on the delay of all my multiclass kits lol.
    subtledoctor
  • ScrybeScrybe Member Posts: 13

    @Scrybe , that's strange that the descriptions are messed up. I can't seem to find a reason why these wouldn't work properly. As an aside, the mod isn't an officially supported mod so much as an example of how to add kits to multiclasses.

    It's really bizarre. Everything seems to work apart from the descriptions. It's definitely compiling them in the .TRA file and applying it to the correct location...just when I boot the game it has random text for the classes and descriptions.
  • subtledoctorsubtledoctor Member Posts: 7,552
    @Scrybe are you using SoD from Steam or GOG? If so, did you install ModMerge before this mod?
    Grammarsalad
  • GrammarsaladGrammarsalad Member Posts: 1,986
    okay, so a gnome illusionist/priest of x is now possible? Great to know!
  • rapsam2003rapsam2003 Member Posts: 1,481
    edited June 2016

    Actually it's not just a matter of scroll bars. It's that, in 2.0+, when you click a multiclass, if the game detects a K_MC_R.2da file with more than one entry, it kicks you into the kit selection screen. That doesn't happen in 1.4 or lower.

    Ok, so...pardon me if I seem slow...

    Do we actually have the capability to make new K_MC_R.2da file that actually get picked up by the Game Engine? Because if that's actually the case, then that changes "everything"!

    When I tried this stuff for my mod, I recall that creating a new K_MC_R.2da file did jack all, because the Engine didn't pick up the file.
  • AquadrizztAquadrizzt Member Posts: 736
    @Grammarsalad , yes. The only problem with this method is that it requires every kit combination to be installed as a new kit.
    Grammarsalad
  • AquadrizztAquadrizzt Member Posts: 736
    @rapsam2003 , the game will let you define kit tables for existing races and existing classes using KITTABLE.2da. It will not, however, let you define kit tables for new classes or new races. I just tried this and couldn't get anything to appear during class selection.
    Abdel_Adrian
  • subtledoctorsubtledoctor Member Posts: 7,552
    edited June 2016
    @Grammarsalad yeah, I would not implement this in FnP (yet), it would require a major re-write and wholesale abandonment of the deity selection dialogue as we currently know it.

    @rapsam2003 yes. For a working proof-of-concept, install the Might & Guile multiclass kits from M&G v2.6 or higher, onto BGEE/SoD/BG2EE 2.0 or higher. Then take a look at the .2da files. It installs a single K_FM_E.2da file, because the only fighter/mage kit it installs is the Bladesinger, which is elf-only. But it installs K_MT_x.2da files for every race, because the Ranger/Mage and Spellfilcher are not race-restricted.

    Everyone please note: copying new K_MC_R.2da files into the game willy-nilly to add multiclass kits is a sure way to create incompatibilities between mods. I've already given code to @Abdel_Adrian that I am using in Might & Guile, which ensures that multiple mods installing multiclass kits will all work together. I am happy to share that code... but I assume Aquadrizzt has incorporated it into these functions, so your best and easiest bet is to use these tools that he has created.
    Abdel_Adrian
  • AquadrizztAquadrizzt Member Posts: 736
    @subtledoctor , the "qd_multiclass_tables" function initializes the tables and adds any tables that might be missing; it will not overwrite existing multiclass kit tables. Any component that includes a multiclass kit should run that function at the beginning of the component.
  • rapsam2003rapsam2003 Member Posts: 1,481
    edited June 2016

    @rapsam2003 , the game will let you define kit tables for existing races and existing classes using KITTABLE.2da. It will not, however, let you define kit tables for new classes or new races. I just tried this and couldn't get anything to appear during class selection.

    I want new classes/races to be "kittable". :'(
  • subtledoctorsubtledoctor Member Posts: 7,552

    ... KITTABLE.2da.

    Wow, I never even looked at that file before! :tongue:

    Weird that SoD v2.2 has a listing there for Barbarian (K_BN_R.2da) even though Barbarian now appears as a fighter kit in K_F_R.2da.

    I wonder if you could somehow use that to create a new menu... on the other hand, with our spiffy new scroll bars, there's no need for new menus...
  • subtledoctorsubtledoctor Member Posts: 7,552
    Getting back on topic:

    (As an aside, this system could easily be automated to add single-kit options to each multi-class during character creation removing the need to go into EEKeeper to do this. I'd be willing to code such a mod if there was interest.)

    My NPC_EE mod already does this for v1.3, the old-fashioned way, by scripting a kit change into a single-class kit. For broad application there is still something to be said for the old method; it works automatically and covers all installed kits, vanilla or mod-added. And it doesn't require making up to 4 copies of every kit to cover all possible multiclassing combinations. That might be a good place to do this: the mod could be updated with proper multiclass kits when doing so would provide some benefit (it would allow swash/mages to specialize in weapons, which can't be done with the current "single-class-kit-on-a-multi-class-character" method), and stick to the old method when it wouldn't make a difference. It would be the best of both worlds, and give maximum flexibility to players.

    On the other hand, while this is 100% guaranteed to bring out the cheesemongers (kenswash, yeah), I am MUCH more interested in seeing people use this to design proper multiclass kits from the ground up. For instance, I might finally put together my fighter/thief "Thug" kit. Something like:
    Advantages:
    - May achieve mastery (+++) with any one-handed weapons usable by vanilla thieves
    - May learn a combat-related feat or melee trick once per 4 levels
    Disadvantages:
    - May not use the Pick Pockets, Detect Illusion, or Open Locks skills (just bash those locks!)
    - Backstab maxes at x3
    - May only spend 15 skill points per level

    This will also make it much easier to do a proper implementation of the ranger/mage. :smiley:

    Anyone else have ideas for cool mutliclass kits?
    Grammarsalad
  • AquadrizztAquadrizzt Member Posts: 736
    @subtledoctor , one thing I would specify is whether its Rogue or Fighter levels that determines an ability, because it now could be either.
«134
Sign In or Register to comment.