Author Topic: A minor issue with Imoen's portrait  (Read 4456 times)

Offline aVENGER

  • Planewalker
  • *****
  • Posts: 143
A minor issue with Imoen's portrait
« on: May 10, 2010, 12:24:06 PM »
Apparently, the "Creature Corrections" component of BG1 UB assigns a BG1 style portrait to Imoen's Candlekeep incarnation (IMOEN.CRE). However, it doesn't check whether another mod has already assigned a portrait to Imoen, which can lead to an inconsistency if the "Give Imoen her BG2 Portrait" component of BG1 NPCs has been installed beforehand. In order to avoid this, I'd recommend changing this code:

Code: [Select]
COPY_EXISTING ~%tutu_var%IMOEN.CRE~ ~override~ // Imoen (Thief, AR2600, Candlekeep)
  WRITE_EVALUATED_ASCII 0x34 ~%tutu_scripti%MOENS~ #8     // Corrects Imoen's portraits
  WRITE_EVALUATED_ASCII 0x3c ~%tutu_scripti%MOENL~ #8
  PATCH_IF (SOURCE_SIZE > 0x2d4) BEGIN
    READ_LONG 0x2b8 slotOff
    READ_SHORT slotOff + 0x12 weap1
    READ_SHORT slotOff + 0x14 weap2
    READ_SHORT slotOff + 0x16 weap3
    READ_SHORT slotOff + 0x18 weap4
    // make sure the creature has no weapons
    PATCH_IF ((weap1 == 0xffff) && (weap2 == 0xffff) && (weap3 == 0xffff) && (weap4 == 0xffff)) BEGIN
      ADD_CRE_ITEM ~%tutu_var%BOW05~ #0 #0 #0 NONE WEAPON1 EQUIP // Short Bow
    END
  END
BUT_ONLY_IF_IT_CHANGES

into something like this:

Code: [Select]
COPY_EXISTING ~%tutu_var%IMOEN.CRE~ ~override~ // Imoen (Thief, AR2600, Candlekeep)
  PATCH_IF (SOURCE_SIZE > 0x2d4) BEGIN
    READ_LONG 0x2b8 slotOff
    READ_SHORT slotOff + 0x12 weap1
    READ_SHORT slotOff + 0x14 weap2
    READ_SHORT slotOff + 0x16 weap3
    READ_SHORT slotOff + 0x18 weap4
    // make sure the creature has no weapons
    PATCH_IF ((weap1 == 0xffff) && (weap2 == 0xffff) && (weap3 == 0xffff) && (weap4 == 0xffff)) BEGIN
      ADD_CRE_ITEM ~%tutu_var%BOW05~ #0 #0 #0 NONE WEAPON1 EQUIP // Short Bow
    END
    READ_ASCII 0x34 ~ports~
    READ_ASCII 0x3c ~portm~
    PATCH_IF (("%ports%" STRING_EQUAL_CASE ~~) OR ("%ports%" STRING_EQUAL_CASE ~None~)) BEGIN
      WRITE_EVALUATED_ASCII 0x34 ~%tutu_scripti%MOENS~ #8     // Corrects Imoen's small portrait
    END
    PATCH_IF (("%portm%" STRING_EQUAL_CASE ~~) OR ("%portm%" STRING_EQUAL_CASE ~None~)) BEGIN
      WRITE_EVALUATED_ASCII 0x3c ~%tutu_scripti%MOENM~ #8     // Corrects Imoen's medium portrait
    END
  END
BUT_ONLY_IF_IT_CHANGES

Also, as indicated by the revised code, the file name for Imoen's medium portrait should be IMOENM rather than IMOENL.

Offline jastey

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1524
  • Gender: Female
Re: A minor issue with Imoen's portrait
« Reply #1 on: October 01, 2010, 02:55:14 PM »
Also, as indicated by the revised code, the file name for Imoen's medium portrait should be IMOENM rather than IMOENL.
Not for vanilla BG1 (w/o TotSC): The used format notation is "S" for the small and "L" for the medium sized portraits there.

In this regard - do I only have to change the code for Tutu/BGT installs?
Or, if the general check is advantagous for BG1 also, does is work there too or do I have to use 

 READ_ASCII 0x34 ~ports~
    READ_ASCII 0x3c ~portl~ //"small L" instead of m

?

Offline Mike1072

  • Planewalker
  • *****
  • Posts: 298
  • Gender: Male
Re: A minor issue with Imoen's portrait
« Reply #2 on: October 01, 2010, 03:25:26 PM »
If you want that code to be compatible with BG1...

Code: [Select]
    READ_ASCII 0x34 ~ports~
    READ_ASCII 0x3c ~portm~
    TEXT_SPRINT medium ~M~
    PATCH_IF (~%tutuorbgt%~ STRING_EQUAL ~BG~) BEGIN
      TEXT_SPRINT medium ~L~
    END
    PATCH_IF (("%ports%" STRING_EQUAL_CASE ~~) OR ("%ports%" STRING_EQUAL_CASE ~None~)) BEGIN
      WRITE_EVALUATED_ASCII 0x34 ~%tutu_scripti%MOENS~ #8     // Corrects Imoen's small portrait
    END
    PATCH_IF (("%portm%" STRING_EQUAL_CASE ~~) OR ("%portm%" STRING_EQUAL_CASE ~None~)) BEGIN
      WRITE_EVALUATED_ASCII 0x3c ~%tutu_scripti%MOEN%medium%~ #8     // Corrects Imoen's medium portrait
    END

Offline jastey

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1524
  • Gender: Female
Re: A minor issue with Imoen's portrait
« Reply #3 on: October 01, 2010, 03:52:01 PM »
Ah, this is good. I think I understand what it's doing. Thank you!

 

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)?: