Skip to content

[How to] Making kit mods for the EE!

1246714

Comments

  • The user and all related content has been deleted.
  • Abdel_AdrianAbdel_Adrian Member Posts: 430
    Thanks once again, I'll check that out. I agree with your sentiment on effects and lore though, all of the items I'm creating follow the lore of Abeir-Toril very closely, and I'm having a blast writing stories of that nature, but I'm also adding a lot of items that expand on the variability among weapons (i.e. masterwork, silver/cold iron/mithral/adamantine/darkwood etc.)
    Sometimes that'll make a % chance hard to justify if it's "just the nature of the enchantment," no angry demon trapped in the sword or something, but I'm trying to keep it plausible.
  • [Deleted User][Deleted User] Posts: 0
    edited April 2015
    The user and all related content has been deleted.
    Post edited by [Deleted User] on
  • VhaluusVhaluus Member Posts: 10
    edited April 2015
    I notice in the link "CamDawg's Kit mods tutorial for BG2" that it says sorcerors can not be kitted. Is that still the case or has EE changed this since it has the dragon disciple kit?
    Post edited by Vhaluus on
  • The user and all related content has been deleted.
  • CrevsDaakCrevsDaak Member Posts: 7,155
    Vhaluus said:

    I notice in the link "CamDawg's Kit mods tutorial for BG2" that it says sorcerors can not be kitted. Is that still the case or has EE changed this since it has the dragon disciple kit?

    All classes (except the Barbarian which is coded as a Fighter kit) can be kitted in the EEs.
  • VhaluusVhaluus Member Posts: 10
    Ok next question. I'm reading through a lot of documentation at the moment and there's one thing I haven't come across. Is it possible to grant a kit more frequent proficiency points than the base class? For example can I give the sorceror the proficiency point gain rate of a fighter?

    I'm basically trying to assess how possible it would be to make a sorc kit that can somewhat mimic a fighter/sorceror multiclass via an exp penalty. I realize some things like 18/xx strength and con scores counting over 16 are probably hard coded.
  • CrevsDaakCrevsDaak Member Posts: 7,155
    edited April 2015
    Vhaluus said:

    Is it possible to grant a kit more frequent proficiency points than the base class? For example can I give the sorceror the proficiency point gain rate of a fighter?

    Yes. You'll have to modify the file profs.2da on the RATE column (I recommend taking a look at it with NearInfinity and if you're going to release the mod change it with WeiDU with a command like SET_2DA_ENTRY).

    Watch out, because this changes it for the Sorcerer class, there actually isn't a way of doing this for a kit only (though you can make a Feature Request to make this possible).
    Vhaluus said:

    I'm basically trying to assess how possible it would be to make a sorc kit that can somewhat mimic a fighter/sorceror multiclass via an exp penalty. I realize some things like 18/xx strength and con scores counting over 16 are probably hard coded.

    The 18/XX thing with STR is hardcoded IIRC and AFAIK... But you can change it for other classes (yes, ALL the other classes other than the Warrior classes) by editing the OTHER column in the file hpconbon.2da.

    Edit: you might want to edit the file clswpbon.2da to give your Sorcerer kit access to the APR bonus from specialization by putting a 1 on the GETS_PROF_APR column on your kit's row.
  • VhaluusVhaluus Member Posts: 10
    Hi, Thank you very much for your help @CrevsDaak . I just wanted to let you know that your example script was hugely useful but there is one small error in it I think.

    the line

    thiefscl = ~100 100 100 100 100 100 100~

    only has 7 values where the 2DA requires 8. This threw up an error until I added the extra value.
  • VhaluusVhaluus Member Posts: 10
    edited April 2015
    I am having a problem with one of the passive abilities I added that increments on level up. If I use 'add kit' in EEKeeper the increments add fine and work in game, yet if I level up in game they simply don't get applied (if opening the file after levelling in EEKeeper there are no effects showing as added).

    Attached is what I have if anyone could shed some light.

    It is '1AFSTHACO.SPL' giving me the issues
  • CrevsDaakCrevsDaak Member Posts: 7,155
    edited April 2015
    Vhaluus said:

    Hi, Thank you very much for your help @CrevsDaak . I just wanted to let you know that your example script was hugely useful but there is one small error in it I think.

    the line

    thiefscl = ~100 100 100 100 100 100 100~

    only has 7 values where the 2DA requires 8. This threw up an error until I added the extra value.

    Thanks. Fixed ;)
    Vhaluus said:

    I am having a problem with one of the passive abilities I added that increments on level up. If I use 'add kit' in EEKeeper the increments add fine and work in game, yet if I level up in game they simply don't get applied (if opening the file after levelling in EEKeeper there are no effects showing as added).

    Attached is what I have if anyone could shed some light.

    It is '1AFSTHACO.SPL' giving me the issues

    The name's too long :) for the engine. The game only supports up to 8 characters on a filename (without counting the extension).

    Don't feel bad--this has happened to everyone :D
  • VhaluusVhaluus Member Posts: 10
    Thanks that fixed it. I'm glad it was a silly mistake like that than something bigger.

    I think I have the mod getting as close as it can to emulating a fighter/sorc multiclass... but a lot of the solutions are very hacked together so I doubt it's worth releasing.
  • CoM_SolaufeinCoM_Solaufein Member Posts: 2,607
    To save myself time from reading every post, custom kits now work for the games? I recall one time they didn't because a a patch did something to the game.
  • IsayaIsaya Member, Translator (NDA) Posts: 752
    @CoM_Solaufein Yes it works, provided you add a call to the fl#add_kit_ee function with proper paramters, as explained in the first post.
  • CoM_SolaufeinCoM_Solaufein Member Posts: 2,607
    Awesome
  • Gel87Gel87 Member Posts: 158
    Hello :)
    I desperatly need your help :P
    I started modding baldurs gate 1 & 2 ee about a year ago. My first mod was a mindflayer kit. With loads of help from people i got it to work. I played almost true shadow of amn with it, no issues except i found out that some new spells etc had to be implemented to be able to run single run true the game. Then i had almost a year break from baldurs gate in general.

    So then i tryed to fix it so that instead of invi creature was going to make me into a mindflayer which would not happen before i level'd up 1 level, i tryed to get it to shapechange as once(with a lot of help ofc)
    But after this suddenly i can't make a new game, the char dies at once u start and irenicus movie never starts... Doesent even mather what char, its impossible to start any char, they just die.

    I tried to unninstal kit mod, dident work. At the end i i applied the latest update, 1.3. It said it would remove all mods. And it did, but still character dies at very first start, before first movie.

    So i uninstalled bg2ee, deleted folder under C: disk. Redownloaded it and reinstalled it with newest patch. I tried to make a new game and it worked.
    I installed XP cap mod. Saradas chapechanger.
    Made a totally new werewolf kit, where i used my other .tp2 file as a base. Weidu installed it after i fixed 4 writing errors. I started a new game, and same shit happens again. The char dies.
    What is wrong? :P

    What should i do?
    Make a totally new .tp2 kit file? And remake the entire kit? Is it somewhere there the fault is?
    Or should i just give up on the kit and just make a mod which changes the wherewolf cla and lua tables and adds my spells/weps into those etc?

    Need help, totally stucked and need to reinstall bg2ee again for the second time this evening xD
  • Gel87Gel87 Member Posts: 158
    Here is the werewolf mod btw xD Forgot to add it, dont install it, it might fuck up ur bg2 game xD But plz have a look and see what wrong^^
  • Gel87Gel87 Member Posts: 158
    Gel87 said:

    Here is the werewolf mod btw xD Forgot to add it, dont install it, it might fuck up ur bg2 game xD But plz have a look and see what wrong^^

    If i start at the expansion it works somehow LOL xD
  • Gel87Gel87 Member Posts: 158
    Omg, i lold. It was somehting to do with the xpcap mod, deleted that and it worked xD Wrong starting point or smt xD
  • joshuar9476joshuar9476 Member Posts: 55
    So after about three years I've decided to fire up BG:EE. I guess I have to update my custom kits to 1.3. It's been so long I'd probably have to reteach myself. I guess the question is, is there and easy fix (a specific line or two) to make my kits work in 1.3? I installed it without fixing it and neither kit is select-able after selecting fighter.
  • elminsterelminster Member, Developer Posts: 16,315
    edited January 2016

    So after about three years I've decided to fire up BG:EE. I guess I have to update my custom kits to 1.3. It's been so long I'd probably have to reteach myself. I guess the question is, is there and easy fix (a specific line or two) to make my kits work in 1.3? I installed it without fixing it and neither kit is select-able after selecting fighter.

    Check out other EE compatible kit mods. You are likely missing stuff involving fl#add_kit_ee.tpa
  • Abdel_AdrianAbdel_Adrian Member Posts: 430
    @joshuar9476 I can't attach the fl#add_kit_ee.tpa here, but this is what it would look like:
    /*
    * fl#add_kit_ee - An ADD_KIT supplement for EE-type games
    * Author: Fredrik Lindgren, a.k.a., Wisp
    * Licence: public domain
    * Date: 2014-09-28
    */

    OUTER_SPRINT fl#add_kit_ee#version "1.1.0"

    DEFINE_ACTION_FUNCTION fl#add_kit_ee#get_row
    STR_VAR
    file = ""
    row_rame = ""
    column = 0
    RET
    row
    BEGIN
    COPY_EXISTING "%file%.2da" override
    COUNT_2DA_COLS num_col
    READ_2DA_ENTRIES_NOW file num_col
    SPRINT row ""
    FOR (i = 0; i < file; ++i) BEGIN
    READ_2DA_ENTRY_FORMER file i column label
    PATCH_IF "%label%" STRING_EQUAL_CASE "%row_name%" BEGIN
    FOR (j = 1; j < num_col; ++j) BEGIN
    READ_2DA_ENTRY_FORMER file i j item
    SPRINT row "%row% %item%"
    END
    END
    END
    BUT_ONLY
    END

    DEFINE_ACTION_FUNCTION fl#add_kit_ee#get_column
    STR_VAR
    file = ""
    column_name = ""
    RET
    column
    BEGIN
    COPY_EXISTING "%file%.2da" override
    COUNT_2DA_COLS num_col
    READ_2DA_ENTRIES_NOW file num_col - 1
    SPRINT column ""
    FOR (i = 0; i < num_col - 1; ++i) BEGIN
    READ_2DA_ENTRY_FORMER file 0 i label
    PATCH_IF "%label%" STRING_EQUAL_CASE "%column_name%" BEGIN
    FOR (j = 1; j < file; ++j) BEGIN
    READ_2DA_ENTRY_FORMER file j i + 1 item
    SPRINT column "%column% %item%"
    END
    END
    END
    BUT_ONLY
    END

    DEFINE_ACTION_FUNCTION fl#add_kit_ee#add_row
    STR_VAR
    kit_name = ""
    input = ""
    file = ""
    clone = ""
    BEGIN
    ACTION_IF "%input%" STR_CMP "" BEGIN
    OUTER_SPRINT append "%kit_name% %input%"
    APPEND "%file%.2da" "%append%" UNLESS "%kit_name%"
    END ELSE ACTION_IF "%clone%" STR_CMP "" BEGIN
    LAF fl#add_kit_ee#get_row
    STR_VAR
    file
    row_name = EVAL "%clone%"
    RET
    row
    END
    OUTER_SPRINT append "%kit_name% %row%"
    APPEND "%file%.2da" "%append%" UNLESS "%kit_name%"
    END
    END

    DEFINE_ACTION_FUNCTION fl#add_kit_ee#add_column
    STR_VAR
    kit_name = ""
    input = ""
    file = ""
    clone = ""
    BEGIN
    ACTION_IF "%input%" STR_CMP "" BEGIN
    OUTER_SPRINT append "$ $ %kit_name% %input%"
    APPEND_COL "%file%.2da" "%append%" UNLESS "%kit_name%"
    END ELSE ACTION_IF "%clone%" STR_CMP "" BEGIN
    LAF fl#add_kit_ee#get_column
    STR_VAR
    file
    column_name = EVAL "%clone%"
    RET
    column
    END
    OUTER_SPRINT append "$ $ %kit_name% %column%"
    APPEND_COL "%file%.2da" "%append%" UNLESS "%kit_name%"
    END
    END

    DEFINE_ACTION_FUNCTION fl#add_kit_ee#validate
    INT_VAR
    kit_number = 0
    kit_class = 0
    STR_VAR
    kit_name = ""
    backstab = ""
    clswpbon = ""
    hpclass = ""
    numwslot = ""
    thiefskl = ""
    traplimt = ""
    clascolr = ""
    clasiskl = ""
    clasthac = ""
    thiefscl = ""
    sneakatt = ""
    crippstr = ""
    RET
    backstab
    thiefskl
    traplimt
    sneakatt
    crippstr
    BEGIN
    ACTION_IF kit_class != 4 AND ("%backstab%" STR_CMP "" OR
    "%thiefskl%" STR_CMP "" OR
    "%traplimt%" STR_CMP "" OR
    "%sneakatt%" STR_CMP "" OR
    "%crippstr%" STR_CMP "")
    BEGIN
    WARN ~WARNING: the arguments for thief-only 2DAs should only be provided for thief kits~
    OUTER_SPRINT backstab ""
    OUTER_SPRINT thiefskl ""
    OUTER_SPRINT traplimt ""
    OUTER_SPRINT sneakatt ""
    OUTER_SPRINT crippstr ""
    END
    END

    DEFINE_PATCH_FUNCTION fl#add_kit_ee#get_2da_value
    STR_VAR
    row = ""
    column = ""
    req_column_count = 2
    value = ""
    RET
    value
    BEGIN
    COUNT_2DA_COLS num_col
    READ_2DA_ENTRIES_NOW file req_column_count
    FOR (i = 0; i < file; ++i) BEGIN
    READ_2DA_ENTRY_FORMER file i 0 row_label
    PATCH_IF "%row_label%" STRING_EQUAL_CASE "%row%" BEGIN
    // We assume the top row is off by one
    FOR (j = 0; j < num_col - 1; ++j) BEGIN
    READ_2DA_ENTRY_FORMER file 0 j col_label
    PATCH_IF "%col_label%" STRING_EQUAL_CASE "%column%" BEGIN
    READ_2DA_ENTRY_FORMER file i j + 1 value
    i = file
    j = num_col
    END
    END
    END
    END
    END

    DEFINE_ACTION_FUNCTION fl#add_kit_ee
    INT_VAR
    biography = "-2"
    fallen = 0
    briefdesc = "-2"
    fallen_notice = "-2"
    STR_VAR
    kit_name = ""
    backstab = ""
    clsrcreq = ""
    clswpbon = ""
    hpclass = ""
    numwslot = ""
    thiefskl = ""
    traplimt = ""
    clascolr = ""
    clasiskl = ""
    clasthac = ""
    thiefscl = ""
    sneakatt = ""
    crippstr = ""
    BEGIN
    ACTION_IF GAME_IS ~bgee bg2ee iwdee~ BEGIN
    PRINT "Doing EE-type kit extensions for kit %kit_name%"

    OUTER_SET kit_number = "-1"

    COPY_EXISTING kitlist.2da override
    READ_2DA_ENTRIES_NOW kitlist 9
    FOR (i = 0; i < kitlist; ++i) BEGIN
    READ_2DA_ENTRY_FORMER kitlist i 1 k
    PATCH_IF "%k%" STRING_EQUAL_CASE "%kit_name%" BEGIN
    READ_2DA_ENTRY_FORMER kitlist i 0 kit_number
    READ_2DA_ENTRY_FORMER kitlist i 2 kit_lower
    READ_2DA_ENTRY_FORMER kitlist i 3 kit_mixed
    READ_2DA_ENTRY_FORMER kitlist i 4 kit_desc
    READ_2DA_ENTRY_FORMER kitlist i 8 kit_class
    END
    END
    BUT_ONLY

    ACTION_IF kit_number < 0 BEGIN
    FAIL ~ERROR: the kit %kit_name% was not found in kitlist.2da~
    END

    LAF fl#add_kit_ee#validate
    INT_VAR
    kit_number
    kit_class
    STR_VAR
    kit_name
    backstab
    clsrcreq
    clswpbon
    hpclass
    numwslot
    thiefskl
    traplimt
    clascolr
    clasiskl
    clasthac
    thiefscl
    sneakatt
    crippstr
    RET
    backstab
    thiefskl
    traplimt
    sneakatt
    crippstr
    END

    COPY_EXISTING kitlist.2da override
    INNER_ACTION BEGIN
    COPY_EXISTING kit.ids override
    READ_2DA_ENTRIES_NOW file 2
    FOR (i = file - 1; i >= 0; --i) BEGIN
    READ_2DA_ENTRY_FORMER file i 1 k
    PATCH_IF "%k%" STRING_EQUAL_CASE "%kit_name%" BEGIN
    READ_2DA_ENTRY_FORMER file i 0 number
    END
    END
    BUT_ONLY
    END
    INNER_PATCH_SAVE kitids "%number%" BEGIN
    REPLACE_TEXTUALLY "0x\([0-9]+\)" "0x0000\1"
    END
    SPRINT w "[ %TAB%]+"
    SPRINT ow "[ %TAB%]*"
    SPRINT d "[0-9]+"
    SPRINT h "[0-9x]+"
    REPLACE_TEXTUALLY ~\(%d%%w%%kit_name%%w%%d%%w%%d%%w%%d%%w%.+%w%%d%%w%%h%%w%%d%%ow%$\)~ ~\1 %kitids%~
    BUT_ONLY

    OUTER_PATCH 0 BEGIN
    LOOKUP_IDS_SYMBOL_OF_INT class class kit_class
    END

    ACTION_IF biography < "-1" OR briefdesc < "-1" OR fallen_notice < "-1" BEGIN
    COPY_EXISTING clastext.2da override
    PATCH_FOR_EACH column IN biography briefdesc fallen_notice BEGIN
    PATCH_IF EVAL "%column%" < "-1" AND FILE_CONTAINS_EVALUATED (clastext.2da "%column%") BEGIN
    LPF fl#add_kit_ee#get_2da_value
    STR_VAR
    row = EVAL "%class%"
    column
    req_column_count = 8
    RET
    value
    END
    SET EVAL "%column%" = value
    END
    END
    BUT_ONLY
    END

    OUTER_SPRINT clastext "%kit_name% %kit_class% %kit_number% %kit_lower% %kit_desc% %kit_mixed% %biography% %fallen% %briefdesc%"

    ACTION_IF FILE_CONTAINS_EVALUATED (clastext.2da "FALLEN_NOTICE") BEGIN
    OUTER_SPRINT clastext "%clastext% %fallen_notice%"
    END

    APPEND clastext.2da "%clastext%" UNLESS "%kit_name%"

    ACTION_DEFINE_ARRAY row_files BEGIN
    backstab
    clsrcreq
    clswpbon
    hpclass
    numwslot
    thiefskl
    traplimt
    sneakatt
    crippstr
    END

    ACTION_DEFINE_ARRAY col_files BEGIN
    clascolr
    clasiskl
    clasthac
    thiefscl
    END

    ACTION_PHP_EACH row_files AS _ => item BEGIN
    ACTION_IF FILE_EXISTS_IN_GAME "%item%.2da" BEGIN
    ACTION_IF FILE_CONTAINS_EVALUATED ("%item%.2da" "^[ %TAB%]*%class%[ %TAB%]+") BEGIN
    OUTER_SPRINT clone "%class%"
    END ELSE BEGIN
    OUTER_SPRINT clone ""
    END
    LAF fl#add_kit_ee#add_row
    STR_VAR
    kit_name
    input = EVAL EVAL "%%item%%"
    file = EVAL "%item%"
    clone
    END
    END
    END

    ACTION_PHP_EACH col_files AS _ => item BEGIN
    ACTION_IF FILE_EXISTS_IN_GAME "%item%.2da" BEGIN
    LAF fl#add_kit_ee#add_column
    STR_VAR
    kit_name
    input = EVAL EVAL "%%item%%"
    file = EVAL "%item%"
    clone = EVAL "%class%"
    END
    END
    END

    ACTION_DEFINE_ARRAY cleanup BEGIN kitlist END
    OUTER_SET index = 1

    ACTION_PHP_EACH row_files AS _ => file BEGIN
    OUTER_SPRINT $cleanup("%index%") "%file%"
    OUTER_SET ++index
    END
    ACTION_PHP_EACH col_files AS _ => file BEGIN
    OUTER_SPRINT $cleanup("%index%") "%file%"
    OUTER_SET ++index
    END

    ACTION_PHP_EACH cleanup AS _ => file BEGIN
    ACTION_IF FILE_EXISTS_IN_GAME "%file%.2da" BEGIN
    COPY_EXISTING "%file%.2da" override
    PRETTY_PRINT_2DA
    BUT_ONLY
    END
    END
    END
    END
    All credit to Fredrik Lindgren, a.k.a., Wisp.

    Then the kit's tp2 would include something like this:
    LAF fl#add_kit_ee
    INT_VAR
    biography = ~-1~
    briefdesc = 102499
    fallen = 0
    fallen_notice = ~-1~
    STR_VAR
    kit_name = KIT
    clswpbon = ~1 0 3~
    numwslot = ~2~
    clascolr = ~57 58 122 1 43~
    clasiskl = ~0 0 0 0 0 0 0~
    clasthac = ~0~
    thiefscl = ~0 0 0 0 0 0 0 0~
    hpclass = ~HPFM~
    clsrcreq = ~0 1 0 0 0 0 0~
  • joshuar9476joshuar9476 Member Posts: 55
    @Abdel_Adrian thank you very much. I managed to get the bugs sorted out and I hope everything is good.
  • The user and all related content has been deleted.
  • CrevsDaakCrevsDaak Member Posts: 7,155

    Anyone familiar with the latest additions to kit externalizations/the fl#add_kit_ee routine? I feel like I've read that you can restrict a thief kit to only using a few different skills. If I want to make a kit that can *only* use Hide in Shadows, Move Silently, and Detect Illusions, how would I do that?

    If you mean the changes in the beta, I have no idea as I didn't download it yet.

    If you mean that the player can/cannot spend points in a certain thieving ability with a certain kit, then you should look at thiefscl.2da. In the OP I talk about it. I believe it's ruled by percentages (100 = can spend, 0 = can't) and it's also used in how many points/level Bards and Rangers get in their thieving abilities (for example, some Bard kits get less Pick Pockets than the base and such things) if it's set to anything but 100 or 0.

    Also I'll be revamping the guide when I finished doing so... Which will be when I actually finish doing so :p
  • GrammarsaladGrammarsalad Member Posts: 2,582
    edited March 2016
    As of the 1.4 patch, (iwdee) thiefscl.2da only cares about 0 and 100 values for classes that can select their skill percentages manually (e.g. the thief), but other values can be added for the classes that automatically get their skill points (e.g. the blade and their 25 in pick pockets).

    Edit: I'm not sure about values higher than 100. Maybe it's possible (e.g.) to create a bard kit with double the pick pocket progression. Not sure
  • DoomjoonDoomjoon Member Posts: 1
    What decides whether the kit will have a spellbook, whether it will have access to sneaking, and things like that? Is it dependent entirely on what class it belongs to?
  • elminsterelminster Member, Developer Posts: 16,315
    edited June 2016
    Doomjoon said:

    What decides whether the kit will have a spellbook, whether it will have access to sneaking, and things like that? Is it dependent entirely on what class it belongs to?

    Yes. Though you can use spl files to restrict access to buttons.
  • NoobaccaNoobacca Member Posts: 139
    @elminster, is it possible to change a class's in game sprite? For example, could you give a ranger a thief sprite? Or a bard a Mage sprite?
  • elminsterelminster Member, Developer Posts: 16,315
    edited November 2016
    Noobacca said:

    @elminster, is it possible to change a class's in game sprite? For example, could you give a ranger a thief sprite? Or a bard a Mage sprite?

    You can make a script that uses the ChangeAnimationNoEffect, ChangeAnimation, or Polymorph action. That or you could make a kit that has a non-dispellable spell that changes their animation.
Sign In or Register to comment.