Author Topic: A few more EE items...  (Read 4960 times)

Offline CamDawg

  • Infidel
  • Planewalker
  • *****
  • Posts: 834
  • Dreaming of a red Xmas
    • The Gibberlings Three
A few more EE items...
« on: August 01, 2013, 02:09:23 PM »
ADD_MUSIC fails if there are already 100 entries unless it's a GemRB game or TobEx is detected, but the EE games have this ability built in.

ADD_KIT is also going to be a bit problematic going forward, as EE kits have a lot more 2da files they need to touch to work (especially thief kits). The other problem is that some of these are still being finalized, but I wanted to at least get you a head start on what's coming. For backwards compatibility we'd probably have to extend ADD_KIT to update the new files, but provide default values if an older mod with ADD_KIT gets installed.

backstab.2da now provides for extra rows that allow for kits to define a custom backstab multiplier progression. If the row is not present the kit can not backstab.

Code: [Select]
              0          1          2          3
THIEF         1          2          2          2
SHADOWDANCER  1          2          2          2
ASSASIN       1          2          2          2
BOUNTY_HUNTER 1          2          2          2
STALKER       1          2          2          2

clastext.2da allows for unique player1 biographies determined by the class/kit. It's not yet finalized and is currently of the form:

Code: [Select]
                     CLASSID              KITID                LOWER                DESCSTR              MIXED                BIOGRAPHY            FALLEN
FIGHTER              2                    16384                7201                 9556                 1076                 15881                0
BERSERKER            2                    1                    24239                24284                24261                15881                0
DWARVEN_DEFENDER     2                    34                   31973                31975                31974                15881                0
FALLEN_RANGER        12                   16384                10365                9557                 10369                15888                1

For now I'd suggest simply copying the parent's line outright and setting the kit ID. Biography values of -1 default to the generic biography.

clswpbon.2da lets modders set the non-proficiency penalties for kits and whether they can get extra APR for weapon specialization and beyond. A sample:

Code: [Select]
                        GETS_PROF_APR   UNARMED_DIVISOR ZERO_SKILL_THAC0
MAGE                    0            0            5
FIGHTER                 1            0            2
CLERIC                  0            0            3
ABJURER                 0            0            5

The UNARMED_DIVISOR has to do with monks (the default monk and its kits all have 3 in this column).

hpclass.2da lets kits use a different (or custom) HP progression table than their parent class; i.e. mage kits could use the cleric HP table if desired. In this case the fighter kit Dwarven Defender is using the barbarian d12 progression:

Code: [Select]
                     TABLE 
FIGHTER              HPWAR     
BERSERKER            HPWAR     
DWARVEN_DEFENDER     HPBARB

numwslot.2da lets the modder decide how many weapon slots to give the kit:

Code: [Select]
                 SLOTS
MAGE                2
FIGHTER             4
KENSAI              4

thiefskl.2da lets the modder determine how many points the kit gets to distribute at character creation and at future level ups. Classes/kits w/o thief skills shouldn't use this table:

Code: [Select]
START_POINTS LEVEL_POINTS
THIEF 40 25
SHADOWDANCER 30 15
ASSASIN 40 15
BOUNTY_HUNTER 40 20
SWASHBUCKLER 40 25
MONK 0 10
The monks are there for the detect traps stuff.

traplimt.2da externalizes the maximum number of traps a thief can set:

Code: [Select]
                 LIMIT
THIEF              6
FIGHTER_THIEF      6
BOUNTY_HUNTER      6

clascolr.2da determines the default coloring for classes and kits (column-wise):

Code: [Select]
            MAGE CLERIC BERSERKER
METAL       57   25     25
MINOR_CLOTH 58   28     28
MAIN_CLOTH  122  57     57
LEATHER     1    2      2
ARMOR       43   24     24

clasiskl.2da determines a class/kit's initial thieving bonuses (column-wise):

Code: [Select]
                    MAGE
PICK_POCKETS        0
OPEN_LOCKS          0
FIND_TRAPS          0
MOVE_SILENTLY       0
HIDE_IN_SHADOWS     0
DETECT_ILLUSION     0
SET_TRAPS           0   

clasthac.2da lets a kit start with an initial thac0 bump over the normal class progression (column-wise):

Code: [Select]
                    MAGE                FIGHTER
BONUS               0                   0       

thiefscl.2da determines what thieving skills a class has access to, and possibly bonuses. A zero means the kit can't use the skill (or invest points). Non-zero values are percentages applied to the skill points invested--so a value of 150 in find traps means that I actually get 15 points of find traps for every 10 points I actually put in. The default 2da only has values of 0 and 100:

Code: [Select]
2DA                 V1.0
0
                    MAGE                THIEF               BARD                FERALAN
PICK_POCKETS        0                   100                 100                 0
OPEN_LOCKS          0                   100                 0                   0
FIND_TRAPS          0                   100                 0                   0
MOVE_SILENTLY       0                   100                 0                   100
HIDE_IN_SHADOWS     0                   100                 0                   100
DETECT_ILLUSION     0                   100                 0                   0
SET_TRAPS           0                   100                 100                 0
STEALTH             0                   0                   0                   0

Though it's there, the STEALTH row is unused and filled with nothing but zeroes.

And this is majorly QND, ugly hack but if it helps at all... this is a function I wrote for SP Collection to basically clone the kit's parent class values in these 2da files:

Code: [Select]

DEFINE_ACTION_FUNCTION ee_kit_appends STR_VAR class = "CDNOTSET" kitname = "CDNOTSET" BEGIN

  ACTION_FOR_EACH file IN backstab clastext clswpbon hpclass numwslot thiefskl traplimt BEGIN
 
    ACTION_IF FILE_EXISTS_IN_GAME ~%file%.2da~ THEN BEGIN
 
      ACTION_IF ((FILE_CONTAINS_EVALUATED(~%file%.2da~ ~^%class%\([ %TAB%].+\)$~)) AND NOT
                 (FILE_CONTAINS_EVALUATED(~%file%.2da~ ~^%kitname%\([ %TAB%].+\)$~))) THEN BEGIN
     
        COPY_EXISTING ~%file%.2da~ ~override~
          REPLACE_EVALUATE ~^%class%\([ %TAB%].+\)$~
            BEGIN SPRINT "RESULT" "%MATCH1%"
            END
            ~%class%%RESULT%~
       
        APPEND ~%file%.2da~ ~%kitname%%RESULT%~
 
        COPY_EXISTING ~%file%.2da~ ~override~
          PRETTY_PRINT_2DA
     
      END

    END
 
  END
 
  ACTION_FOR_EACH file IN clascolr clasiskl clasthac thiefscl  BEGIN

    ACTION_IF FILE_EXISTS_IN_GAME ~%file%.2da~ THEN BEGIN
 
      ACTION_IF ((FILE_CONTAINS_EVALUATED(~%file%.2da~ ~[ %TAB%]%class%[ %TAB%]~)) AND NOT
                 (FILE_CONTAINS_EVALUATED(~%file%.2da~ ~[ %TAB%]%kitname%[ %TAB%]~))) THEN BEGIN
                 
        APPEND ~%file%.2da~ ~ ~ // add trailing newline
     
        COPY_EXISTING ~%file%.2da~ ~override~ // first, add column on end
          REPLACE_TEXTUALLY ~%TAB%~ ~ ~
          REPLACE_TEXTUALLY ~ *$~ ~~ // remove trailing spaces from lines
          REPLACE_TEXTUALLY ~\( +[^ ]+ +[^ ]+ +\)\([^ %LNL%%MNL%%WNL%]+\)[ %LNL%%MNL%%WNL%]+$~ ~\1\2 \2~ // only grab rows with at least three entries to avoid header
          COUNT_2DA_COLS col_num
          COUNT_2DA_ROWS col_num row_num
          COUNT_2DA_ROWS (col_num - 1) row_num_test
          PATCH_IF (row_num_test != row_num) BEGIN // basically, header row doesn't have initial entry
            SET row_num += 1
            READ_2DA_ENTRY 0 0 (col_num - 1) temp
            SET_2DA_ENTRY 0 0 (col_num - 1) ~CDTEMPHEADER %temp%~
          END
     
        COPY_EXISTING ~%file%.2da~ ~override~ // now set values on new column
          FOR (index = 0 ; index < col_num ; ++index) BEGIN
            READ_2DA_ENTRY 0 index col_num header
            PATCH_IF ("%header%" STRING_COMPARE_CASE "%class%" = 0) BEGIN
              SET_2DA_ENTRY 0 (col_num - 1) col_num CDNEWKIT
              FOR (index2 = 1 ; index2 < row_num ; ++index2) BEGIN // copy class values to newkit column
                READ_2DA_ENTRY index2 index   col_num temp
                SET_2DA_ENTRY  index2 (col_num - 1) col_num temp
              END
            END
          END

        COPY_EXISTING ~%file%.2da~ ~override~
          REPLACE_TEXTUALLY ~CDTEMPHEADER ~ ~~
          REPLACE_TEXTUALLY ~CDNEWKIT~ ~%kitname%~
          PRETTY_PRINT_2DA
     
      END

    END
 
  END

END
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1108
Re: A few more EE items...
« Reply #1 on: August 01, 2013, 03:41:16 PM »
Do you know if BGEE also supports more than 256 kits?

Also, is there some version of BGEE where one or more of this should not be allowed? (And some way of detecting which version of BGEE we're on?)
« Last Edit: August 01, 2013, 04:12:05 PM by Wisp »

Offline CamDawg

  • Infidel
  • Planewalker
  • *****
  • Posts: 834
  • Dreaming of a red Xmas
    • The Gibberlings Three
Re: A few more EE items...
« Reply #2 on: August 02, 2013, 07:31:43 AM »
Currently, no, but the >256 kits is in the feature request queue. Pretty much all of TobEx's core is either implemented or in the works.

At present, some of these 2das are only in the development builds which is why I wrapped all of the 2da patching with F_E_I_G checks. I don't think there's an easy way to check version, but I'll see.
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1108
Re: A few more EE items...
« Reply #3 on: November 09, 2013, 12:44:09 PM »
Okay, feedback wanted on the extended ADD_KIT syntax.

clastext.2da introduces two new strings (bio and briefdesc), so that's two more SAYs. We also have a number of new 2da files to append to. Is it preferable if those strings come before the SAYs (like all the other strings) or after the SAYs (perhaps to highlight their BGEE-only nature)? BACKSTAB.2DA, TRAPLIMT.2DA and THIEFSKL.2DA should only be appended to by thief kits. Is it preferable to make these strings optional (trickier syntax) or simply deciding that non-thiefs put 0 in those strings and WeiDU only appends them if the values are not-0? We also have the syntactical inconsistency of some strings that have to start with the kit name and some strings where WeiDU autosmartly adds the kit name. We probably want to stick with the latter, right? Edit: also, should there be a string/variable for the FALLEN column in clastext.2da?

Anything new besides briefdesc that was introduced in the latest BGEE patch (1.2)?

And fair warning: if I extend ADD_KIT now and Beamdog continues to change things, the ADD_KIT syntax will turn ugly/-ier faster than you can say "Michael Jackson".
« Last Edit: November 09, 2013, 01:05:23 PM by Wisp »

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1108
Re: A few more EE items...
« Reply #4 on: November 12, 2013, 03:40:32 PM »
WeiDU 235 comes with the function fl#add_kit_ee (in lib/). This function runs after ADD_KIT and takes care of the EE stuff. In addition to the BRIEFDESC column in clastext.2da, it accounts for the KITIDS column in kitlist.2da and the new clsrcreq.2da. The eventual extension of ADD_KIT will be closely modelled after fl#add_kit_ee, so opine now.

Known issues with v1:
  If will bomb on BGEE versions less than 1.2 because I just assumed all the new stuff naturally exists.

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
Re: A few more EE items...
« Reply #5 on: November 14, 2013, 06:21:36 PM »
edit: nevermind. Search-foo is my friend.

I'd not worry about the bombing - if someone isn't running with the patch, there will be plenty of other challenges to their game. I'd say that it failing on the non-patched game is a feature.
« Last Edit: November 14, 2013, 06:28:47 PM by cmorgan »

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: