Skip to content

[(BG2) bug] portrait icon bugs

CamDawgCamDawg Member, Developer Posts: 3,438
edited November 2012 in Fixed
Spell shield uses opcode (effectID) 226, which is hardcoded to display the wrong portrait icon of protection from magic energy instead of spell shield. Rather than fixing this in the engine, I'd suggest using the Fixpack solution, as it would cause fewer mod compatibility issues since it's been out so long.

We swap the portrait icons (states.bam, states2.bam) so that the hardcoded 226 has the right icon and update Protection from Magic Energy to point to the relocated icon.

I've attached my states.bam and states2.bam from BG2FP--it looks like BGEE currently has the smaller BG1 states.bam of portrait icons, so these BAMs would need to be updated anyway.
// spell shield is hardcoded to display icon #73 which is currently protection from magical energy; need to swap
// see also statdesc.2da, states.bam, states2.bam
COPY_EXISTING ~spwi606.spl~ ~override~
READ_LONG 0x64 "abil_off"
READ_SHORT 0x68 "abil_num"
READ_LONG 0x6a "fx_off"
FOR (index = 0 ; index < abil_num ; index = index + 1) BEGIN
READ_SHORT ("%abil_off%" + 0x1e + (0x28 * "%index%")) "abil_fx_num"
READ_SHORT ("%abil_off%" + 0x20 + (0x28 * "%index%")) "abil_fx_idx"
FOR (index2 = 0 ; index2 < abil_fx_num ; index2 = index2 + 1) BEGIN
READ_SHORT ("%fx_off%" + (0x30 * ("%abil_fx_idx%" + "%index2%"))) "opcode"
READ_LONG ("%fx_off%" + 0x08 + (0x30 * ("%abil_fx_idx%" + "%index2%"))) "icon"
PATCH_IF (("%opcode%" = 142) AND ("%icon%" = 73)) BEGIN // display old pro-magic energy icon
WRITE_LONG ("%fx_off%" + 0x08 + (0x30 * ("%abil_fx_idx%" + "%index2%"))) 123 // change to new pro-magic energy icon
END
END
END
BUT_ONLY_IF_IT_CHANGES
Post edited by Tanthalas on

Comments

  • CamDawgCamDawg Member, Developer Posts: 3,438
    Forgot the update to the state descriptions:
    // spell shield is hardcoded to display icon #73 which is currently protection from magical energy; need to swap
    // see also states.bam, states2.bam, spwi606.spl
    COPY_EXISTING ~statdesc.2da~ ~override~
    REPLACE_TEXTUALLY ~^\(73[%TAB% ]+\)[0-9]+~ ~\125123~
    REPLACE_TEXTUALLY ~^\(123[%TAB% ]+\)[0-9]+~ ~\125063~
    BUT_ONLY_IF_IT_CHANGES
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    I almost said to fix this in the engine, but yeah, the mods out there would cry.
  • SethDavisSethDavis Member Posts: 1,812
    Potentially fixed - @CamDawg's fix has been applied
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    edited August 2012
    @SethDavis Statdesc.2da also has a borked entry #7.

    Ok, #73 is Spell Shield now
    #123 is Protected from Magical Energy
  • BhryaenBhryaen Member Posts: 2,874
    Confirmed Fixed... ?

    1. In vBG1 STATES.BAM has a dark background while STATES2.BAM has the greenish one. Now both have the STATES2 greenish one. Actually it seems vBG2 has the same fix: both BAMs are identical. :-D But if the BAMs are being changed, was the change to the spell necessary?
    2. For all spell levels SPWI606 (Protection from Magical Energy) now creates Display portrait icon "Spell shield" (123), backward (and thus correct) from vBG2's use of Display portrait icon "Protection from Magical Energy" (73).
    3. STATDESC.2DA... Well, I don't know.
    Entry 73 = 25123 (Strref = "Magic Attack Cancelled")
    Entry 123 = 25063 (Strref = "Protected from Magical Energy")

    vBG2 uses:
    Entry 73 = 8286 (Strref = "Protected from Magical Energy")
    Entry 123 = 26228 (Strref = "Spell Shield")

    @CamDawg
    Not sure what that was supposed to have done, but now SPWI943.SPL that's called Dire Charm has a Spell description of "Protected from Magical Energy." Strref 25153 only shows up (according to NI) in MSECTYPE.2DA... At present SPWI606 is using Display string "Protection from Magic Energy", #26556. More lovely Dialog.tlk issues?

    NOTES:
    @Avenger_teambg is right though that Entry 7 = 54337, way out of bounds otherwise, I assume. Not sure what that affects, but maybe needs a new thread...
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    @Bhryaen Stinking cloud, i think.
    And the portrait icons are not fixed until they are displayed with the states bam font in the character status window too!!!
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    Confirmed not fixed, even the original issue
    Dawg swapped entry 73 and 123, that's correct, but...
    Magic Attack Cancelled is not the proper string for entry 73. It should be 'Spell Shield'
  • TanthalasTanthalas Member Posts: 6,738
    @SethDavis

    This one requires further tweaking.
  • CamDawgCamDawg Member, Developer Posts: 3,438
    State 73 is already fixed in 0914, but not 7 (should be diseased):
    COPY_EXISTING ~statdesc.2da~ ~override~
    REPLACE_TEXTUALLY ~^7\([%TAB% ]+\)[0-9]+~ ~7\131238~
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    edited September 2012
    Yeah, the 'magic attack cancelled' is 25153, so all we need is the #7 fix
  • SethDavisSethDavis Member Posts: 1,812
    I've no idea how that works, but the change looks clean lol
  • CamDawgCamDawg Member, Developer Posts: 3,438
    It's the WeiDU Frankenstein of regular expressions, since they were implemented after generic text matching and Wes didn't want to break backwards compatibility.
  • CamDawgCamDawg Member, Developer Posts: 3,438
    The last bits here are fixed in 0924.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    Confirmed fixed: statdesc #7 31238 Diseased
Sign In or Register to comment.