Skip to content

[Tool] QDMULTI: A Library for Multiclass Kits

1234568»

Comments

  • AbelAbel Member Posts: 785
    edited December 2019
    So, I made some special spells using opcode 42 and a CLAB to fix this issue. Assign the CLAB to the generalist Mage and he will get the correct amount of spells.

    Edit: also, as mentioned by others multiclass Thief does not use 2da tables for backstab, etc. So abilities with the relevant opcodes must be added in the CLAB for a Thief kit in that case. For example, the Shadowdancer gets -1 backstab and doesn't get traps. Using Near Infinity, we create new spells with opcode 263 and 172 (remove spell) for SPC412 (Set Trap).

    I use this simple function to add abilities to CLAB (will not add new rows).
    DEFINE_PATCH_FUNCTION bl_add_ability_to_clab
    	INT_VAR
    		level = 1
    	STR_VAR
    		ability = ~****~
    BEGIN
    	COUNT_2DA_COLS cols									//count columns
    	COUNT_2DA_ROWS cols rows							//count rows
    	READ_2DA_ENTRIES_NOW array cols						//store entries in array
    	FOR (row = 0; row < array; ++row) BEGIN				//loop through rows
    		READ_2DA_ENTRY_FORMER array row level value		//entry value
    		PATCH_IF (~%value%~ STRING_EQUAL ~****~) BEGIN	//no value
    			SET_2DA_ENTRY row level cols ~%ability%~	//add ability
    			row = array									//~break
    		END
    	END
    	PRETTY_PRINT_2DA									//formatting
    END
    
    Post edited by Abel on
  • GroomGroom Member Posts: 7
    edited January 2020
    Anyone able to apply this to(?):
    Multiclassed Multikit Builder Mod // Multikit mod
    http://www.shsforums.net/topic/45258-multiclassed-multikit-builder-mod-experimental/
    (https://github.com/CrevsDaak/m7multikit/releases/)

    That mod has issues with over 200+ kits:
    (in following link, one user was able to solve this issue, with help of QDmulti)
    http://forums.pocketplane.net/index.php?topic=29866.0
  • GwendolyneGwendolyne Member Posts: 461
    edited February 2020
    @Aquadrizzt
    I got this error while installing your library:
    Creating file QD_MC_AP.eff; 272 bytes
    Copying and patching 1 file ...
    Copied [.../fl-inlined/tmp] to [override/QD_MC_AP.eff]
    
    Creating file QD_MC_GA.eff; 272 bytes
    Copying and patching 1 file ...
    Copied [.../fl-inlined/tmp] to [override/QD_MC_GA.eff]
    DELETE_BYTES out of bounds - file is long 114, point given is 114, bytes were 200
    Stopping installation because of error.
    Stopping installation because of error.
    Stopping installation because of error.
    Stopping installation because of error.
    Stopping installation because of error.
    Stopping installation because of error.
    Stopping installation because of error.
    Stopping installation because of error.
    Stopping installation because of error.
    

    Seems the issue is there
    CREATE SPL ~qd_mc_01~
    			LPF ADD_SPELL_HEADER END
    

    As far as I saw (with PATCH_PRINT's), the culprit seems to be FJ_SPL_ITM_REINDEX. But I really don't understand why...
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    Gwendolyne wrote: »
    As far as I saw (with PATCH_PRINT's), the culprit seems to be FJ_SPL_ITM_REINDEX. But I really don't understand why...

    It's explained here...
  • GwendolyneGwendolyne Member Posts: 461
    edited February 2020
    Thanks a lot!

    I am so stupid. I should have found it... :/

    Edit: I think @Aquadrizzt should fix its code...
  • The user and all related content has been deleted.
  • GwendolyneGwendolyne Member Posts: 461
    edited February 2020
    The one of Aquadrizzt's account (0.3).

    Argent77's version enforces me to write two codes: one for classic games and one for EE. So I will stick to v0.3 which works in game with my fix. ;)

    Edit: the kit is not available for players, just for a NPC.
    Post edited by Gwendolyne on
  • The user and all related content has been deleted.
  • GwendolyneGwendolyne Member Posts: 461
    edited February 2020
    1. This is a F-C kit: with version 0.3, I can set the ADD_KIT function with a 3 value (C) which installs the kit both in classic and EE games. With Argent77's version, I can't use the 3 value, but the F-C one, otherwise the kit is not installed (error message: it does not find the kit id. I guess it is not looking for cleric kit ids). But if I do so, the kit won't install in classic games... >:)

    2. Will have a look at your v0.8 version.

    3. About your coding
    OUTER_FOR (num = 1; num < 10; ++num) BEGIN
    	ACTION_FOR_EACH class IN ~D~ ~F~ ~M~ ~P~ ~R~ ~T~ BEGIN
    	  ACTION_IF !(FILE_EXISTS_IN_GAME ~QD_MC%class%0%num%.spl~) BEGIN 
    		COPY_EXISTING ~QD_MC_01.SPL~ ~override/QD_MC%class%0%num%.spl~
    		  LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter1 = 0 parameter2 = 1 timing = 9 STR_VAR resource = EVAL ~QD#MC%class%0%num%~ END
    	  END
    	  ACTION_IF !(FILE_EXISTS_IN_GAME ~QD#MC%class%0%num%.spl~) BEGIN 
    		COPY_EXISTING ~QD_MC_01.SPL~ ~override/QD#MC%class%0%num%.spl~
    		  LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~QD_MC%class%0%num%~ END
    	  END
    	END
      END
      OUTER_FOR (num = 10; num < 51; ++num) BEGIN
    	ACTION_FOR_EACH class IN ~D~ ~F~ ~M~ ~P~ ~R~ ~T~ BEGIN
    	  ACTION_IF !(FILE_EXISTS_IN_GAME ~QD_MC%class%%num%.spl~) BEGIN 
    		COPY_EXISTING ~QD_MC_01.SPL~ ~override/QD_MC%class%%num%.spl~
    		  LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter1 = 0 parameter2 = 1 timing = 9 STR_VAR resource = EVAL ~QD#MC%class%%num%~ END
    	  END
    	  ACTION_IF !(FILE_EXISTS_IN_GAME ~QD#MC%class%%num%.spl~) BEGIN 
    		COPY_EXISTING ~QD_MC_01.SPL~ ~override/QD#MC%class%%num%.spl~
    		  LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~QD_MC%class%%num%~ END
    	  END
    	END
      END
    

    I simplified it a bit:
    ACTION_FOR_EACH cl IN ~f~ ~t~ ~d~ ~m~ ~p~ ~r~ BEGIN
    	OUTER_FOR (i = 1 ; i <= 50 ; ++i) BEGIN
    		ACTION_IF (i < 10) BEGIN OUTER_TEXT_SPRINT level "0%i%" END ELSE BEGIN OUTER_TEXT_SPRINT level "%i%" END
    		COPY_EXISTING ~qd_mc_01.spl~ ~override/qd_mc%cl%%level%.spl~ 
    	END
    END
    

    Post edited by Gwendolyne on
  • GwendolyneGwendolyne Member Posts: 461
    @subtledoctor v0.8 works fine for me. Thanks a lot.
  • argent77argent77 Member Posts: 3,478
    I have recently added a couple of fixes and improvements to the ADD_KIT_EX library which solves several issues addressed in this thread, which includes
    - improved thieving skill checks (added support for more base classes)
    - fixed kittable check failing on triple-class entries
    - apply clab tables to multiple base class aspects of a multiclass kit

    The latter feature is still somewhat experimental, so I'd be happy if you could try it out and let me know how it works.
    Download: A7-add_kit_ex (latest)

    With the current state of the library it is possible to reduce this piece of code (from Abel's Multikit mod)...
    ///////////////////////////////
    //BERSERKER/MAGE/SWASHBUCKLER//
    ///////////////////////////////
    
    ADD_KIT ~BL_BZMGSW~
      ~BL_BZMGSW 1 1 1 1 1 1 1 1~     // clasweap, old proficiencies
      ~BL_BZMGSW 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 2 2 2 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0~ // weapprof
      ~BL_BZMGSW 9 9 0 9 0 0~         // abclasrq, abilities min STR DEX CON INT WIS CHA
      ~BL_BZMGSW 0 0 0 0 0 0~         // abclsmod, abilities mod STR DEX CON INT WIS CHA
      ~BL_BZMGSW 0 0 0 0 0 0~         // abdcdsrq, abilities min to dual to STR DEX CON INT WIS CHA
      ~BL_BZMGSW 0 0 0 0 0 0~         // abdcscrq, abilities min to dual from STR DEX CON INT WIS CHA
      ~BL_BZMGSW 0 0 0 1 1 1 1 1 1~   // alignmnt, LG LN LE NG NN NE CG CN CE
      ~BL_BZMGSW 0 0 0 0 0 0~         // dualclas, to F C M T D R
      ~%MOD_FOLDER%/data/BLANKCLAB.2DA~  //kit CLAB
      ~K_FMT_HE~              // kittable, class/race combination
      ~0x00100001 10~         // unusability & kit class, SCB FMT
      ~FMT~                   // luabbr, HLA identifier
      ~* * * * * * * * * * * * * * * * * * * *~
      SAY @222                // kit name, lower case
      SAY @223                // kit name, proper case
      SAY ~%bzmgsw_desc%~     // description
    
    LAF fl#add_kit_ee
      INT_VAR
        briefdesc = RESOLVE_STR_REF (~%bzmgsw_desc%~)
      STR_VAR
        kit_name  = ~BL_BZMGSW~
        clsrcreq  = ~0 0 1 0 0 0 0~     // race, HUM ELF HLF DWA HAL GNO HRC
        //clswpbon  = ~1 0 2~           // APR bonus, unarmed APR, unproficient
        //hpclass  = ~HPFMT~            // HP table
        //numwslot  = ~2~               // weapon slots
        clascolr  = ~93 58 169 93 93~   // default colors, TMTTF
        //clasthac  = ~0~               // THAC0 bonus, always 0
        //clasiskl  = ~0 0 0 10 0 0 0~  // thieving abilities starting score, P
        //thiefscl  = ~100 100 100 100 100 100 100 0~   // scale in %, PP OL FT MS HIS DI ST SH
        //thiefskl  = ~40 15~           // starting & level-up points
        backstab  = ~0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0~
        sneakatt  = ~0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0~
        crippstr  = ~0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0~
        //traplimt  = 6
    END
    
    LAF qd_multiclass
      STR_VAR
        kit_name = ~BL_BZMGSW~
        kit_clab = ~CLABFI02~
        base_class = ~F~
    END
    
    LAF qd_multiclass
      STR_VAR
        kit_name = ~BL_BZMGSW~
        kit_clab = ~BLCLABMG~
        base_class = ~M~
    END
    
    
    LAF qd_multiclass
      STR_VAR
        kit_name = ~BL_BZMGSW~
        kit_clab = ~CLABTH04~
        base_class = ~T~
    END
    

    ...to this without functional differences:
    LAF ADD_KIT_EX
    INT_VAR
      kit_class   = 10  // FMT
      lower       = RESOLVE_STR_REF(@222)             // kit name, lower case
      mixed       = RESOLVE_STR_REF(@223)             // kit name, proper case
      help        = RESOLVE_STR_REF(~%bzmgsw_desc%~)  // description
      briefdesc   = RESOLVE_STR_REF(~%bzmgsw_desc%~)
    STR_VAR
      kit_name    = ~BL_BZMGSW~
      clasweap    = ~1 1 1 1 1 1 1 1~       // clasweap, old proficiencies
      weapprof    = ~2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 2 2 2 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0~
      abclasrq    = ~9 9 0 9 0 0~           // abclasrq, abilities min STR DEX CON INT WIS CHA
      abclsmod    = ~0 0 0 0 0 0~           // abclsmod, abilities mod STR DEX CON INT WIS CHA
      abdcdsrq    = ~0 0 0 0 0 0~           // abdcdsrq, abilities min to dual to STR DEX CON INT WIS CHA
      abdcscrq    = ~0 0 0 0 0 0~           // abdcscrq, abilities min to dual from STR DEX CON INT WIS CHA
      alignmnt    = ~0 0 0 1 1 1 1 1 1~     // alignmnt, LG LN LE NG NN NE CG CN CE
      dualclas    = ~0 0 0 0 0 0~           // dualclas, to F C M T D R
      clab_base_f = ~CLABFI02~              // clab for fighter class aspect
      clab_base_m = EVAL ~%MOD_FOLDER%/data/BLCLABMG.2DA~   // clab for mage class aspect
      clab_base_t = ~CLABTH04~              // clab for thief class aspect
      kittable    = ~K_FMT_HE~              // kittable, class/race combination
      unusable    = ~0x00100001~
      luabbr      = ~FMT~                   // luabbr, HLA identifier
      stweap      = ~* * * * * * * * * * * * * * * * * * * *~
      clsrcreq    = ~0 0 1 0 0 0 0~         // race, HUM ELF HLF DWA HAL GNO HRC
      clascolr    = ~93 58 169 93 93~       // default colors, TMTTF
      backstab    = ~0~ // expands automatically to full row
      sneakatt    = ~0~ // expands automatically to full row
      crippstr    = ~0~ // expands automatically to full row
    END
    
  • [Deleted User][Deleted User] Posts: 0
    edited March 2020
    The user and all related content has been deleted.
  • AbelAbel Member Posts: 785
    Thanks, @argent77 for the update (that I'm only seeing now)!
    I actually started tinkering with it. You said that there's no functional difference from the old code. Does that mean issues from then are still present?
    I'm thinking specifically about the need for additional code to fix Shadowdancers (backstab and set traps) or Stalkers (backstab) abilities. I'm also wondering if there's a way to include a fix for generalist Mages getting specialists' spell bonus.

    I encountered a bug (already present) when creating a FMC Berserker/Conjurer/Priest of Tempus (tested on IWDEE). The character is being afforded 3 spells to learn instead of the usual 2. Going back to a default FMC 'unusable' variable fixed it. The problem doesn't occur with a Kensai/Mage/Priest of Tempus, however.

    Here's the code:
    LAF ADD_KIT_EX
    INT_VAR
      kit_class   = 17  // FMC
      lower       = RESOLVE_STR_REF(@322)             // kit name, lower case
      mixed       = RESOLVE_STR_REF(@323)             // kit name, proper case
      help        = RESOLVE_STR_REF(~%bzcjtp_desc%~)  // description
      briefdesc   = RESOLVE_STR_REF(~%bzcjtp_desc%~)
    STR_VAR
      kit_name    = ~BL_BZCJTP~
      abclasrq    = ~9 0 15 9 9 0~       // abclasrq, abilities min STR DEX CON INT WIS CHA
      alignmnt    = ~0 0 0 1 1 1 1 1 1~  // alignmnt, LG LN LE NG NN NE CG CN CE
      clab_base_f = ~CLABFI02~           // clab for fighter class aspect
      clab_base_m = ~CLABMA06~           // clab for mage class aspect
      clab_base_p = ~OHTEMPUS~           // clab for priest class aspect
      unusable    = ~0x00000081~
    END
    
  • EndarireEndarire Member Posts: 1,519
    @Abel
    SubtleDoctor on Gibberlings3 was working on a mod to automatically parse what kits are installed and allow for dynamic multiclasses, like Berserker/Assassin/Diviner. He got stuck on the HLA table. Talk with him about this since you two seemingly have similar interests.
  • AbelAbel Member Posts: 785
    @Endarire Thanks for the info! I had that in mind as well!
Sign In or Register to comment.