subtledoctor Posted August 14, 2020 Share Posted August 14, 2020 (edited) This is not complicated, but maybe useful for kit mods: I've made a drop-in-ready .tpa file containing two functions which will check whether the next kit to be installed will overlap with the IDS value of the Abjurer, Conjurer, or Diviner mage specialists. (They are 0x0040, 0x0080, and 0x0100.) If you add enough kits into your game, three of the mod-added kits might be assigned IDS values of 0x4040, 0x4080, and 0x4100 by Weidu's ADD_KIT function. (My current install has about 300 kits; all three of those overlaps occur.) When this happens, especially if the mod-added kit is an arcane spellcaster, some aspects of it will be overridden by characteristics of the vanilla mage kits. The linked code will 1) check whether the next kit to be installed will overlap with one of those three; and 2) if so, it will insert a dummy kit first to take the problematic spot, and then continue on to allow the next real kit to be installed after. Using this is simple: drop that .tpa file into a mod (or replicate it, whatever); then INCLUDE ~%MOD_FOLDER%/lib/extra_kits.tpa~ LAF check_kit_conflict END ADD_KIT ~D5_ARCANIST~ ...etc. Edited August 15, 2020 by subtledoctor Quote Link to post
Caedwyr Posted August 14, 2020 Share Posted August 14, 2020 Thanks, adding this to my sorcerer kit mod since I seem to recall that sorcerer kits could run into this issue as well. Quote Link to post
subtledoctor Posted August 15, 2020 Share Posted August 15, 2020 On 8/14/2020 at 12:09 AM, Caedwyr said: Thanks, adding this to my sorcerer kit mod since I seem to recall that sorcerer kits could run into this issue as well. Definitely can affect sorcerers - the game will happily apply a mage kit to a sorcerer. (I once played with Dynaheir as a sorcerer, but let her keep the Invoker kit.) This issue can really affect any kit; you may end up with a cleric that imposes a -2 save bonus against conjuration spells upon targets. I don't think the record screen will say anything with a cleric kit, but cleric spells do have schools and this might (slightly) affect gameplay even if you don't realize it. Quote Link to post
Luke Posted August 28, 2020 Share Posted August 28, 2020 @Ardanis ADD_SPELL_HEADER: this should be WRITE_SHORT instead of WRITE_BYTE. Quote Link to post
ptifab Posted August 28, 2020 Share Posted August 28, 2020 @Luke @Ardanis 12 hours ago, Luke said: @Ardanis ADD_SPELL_HEADER: this should be WRITE_SHORT instead of WRITE_BYTE. and in the same code: ADD_SPELL_HEADER: this should be WRITE_SHORT instead of WRITE_LONG ? Quote Link to post
Luke Posted August 29, 2020 Share Posted August 29, 2020 11 hours ago, ptifab said: @Luke @Ardanis and in the same code: ADD_SPELL_HEADER: this should be WRITE_SHORT instead of WRITE_LONG ? Yep, correct. Quote Link to post
Luke Posted August 31, 2020 Share Posted August 31, 2020 (edited) @ptifab OK, technically speaking some of them are not really bugs (e.g., offsets 0x2, 0x10). For instance, let's consider offset 0x2 ("Location"). Since legal values for these fields never fall outside the byte range, then writing WRITE_BYTE is not that bad (even if the "Location" field of SPL files is 2 bytes long...) Edited August 31, 2020 by Luke Quote Link to post
kjeron Posted August 31, 2020 Share Posted August 31, 2020 1 hour ago, Luke said: @ptifab OK, technically speaking some of them are not really bugs (e.g., offsets 0x2, 0x10). For instance, let's consider offset 0x2 ("Location"). Since legal values for these fields never fall outside the byte range, then writing WRITE_BYTE is not that bad (even if the "Location" field of SPL files is 2 bytes long...) 0x10 (Minimum level) does have a full two-byte range. Standard spellcasting only utilizes the first byte (0-255), but opcodes that specify casting level (146*2/326*EFF/333) have access to the entire range (0 - 65535). Quote Link to post
Recommended Posts