Jump to content

A couple of minor issues with v17


aVENGER_(RR)

Recommended Posts

At the moment, the "Give [NPC] his/her BG1 portrait" components overwrite the BG1 portrait files with their BG2 counterparts. This can create issues if the player wants to use one of the old BG1 portraits for his PC since he'll get the BG2 version instead. The solution is simple, instead of overwriting the bitmaps, simply assign the proper portraits to the CRE files instead. For example, this code will ensure that all incarnations of Edwin (both from BG1 and BG2) use his BG2 portrait:

 

COPY_EXISTING_REGEXP GLOB ~^_?edwin[0-9]*\.cre$~ ~override~
 PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN // protects against invalid files
WRITE_ASCII 0x34 "NEDWINS" #8 // small portrait
WRITE_ASCII 0x3c "NEDWINM" #8 // medium portrait
 END
BUT_ONLY_IF_IT_CHANGES

 

Note: due to the copying method used, the code should work without problems on both Tutu and BGT without any additional platform checks.

Link to comment

Cool - yeah, that component is overdue for an upgrade - I will revisit, and post my regexp for the various NPCs here for recheck!

 

Basics: instead of overwriting the portrait files we should readdress what the .cre looks for to display portraits.

Link to comment

Two minor issues with Jaheira's Cloakwood quest:

 

 

1) As soon as Andarthe spawns he initiates dialogue from off-screen (i.e. he doesn't check if there's a PC in his visual range) and that's a bit immersion breaking. To correct this, you might want to add a See([PC]) trigger or something similar to the following block in X#ANDART.BAF:

 

/* Andart if Beador is Alive, initiate */
IF %BGT_VAR%
Global("X#JaheiraHealsB","GLOBAL",6)
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
InMyArea(Player1)
THEN
RESPONSE #100
StartDialogNoSet([PC])
END

 

and probably here as well:

 

/* Andarthe if Beador is Dead, initiate */
IF %BGT_VAR%
Global("X#JQBeadorDead","GLOBAL",3)
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
InMyArea(Player1)
THEN
RESPONSE #100
StartDialogNoSet(Player1)
END

 

 

 

2) The club which Senyad gives to the party after completing the quest initially has zero charges of Call Lightning. This rectifies itself after resting but, judging by the description, the club should come with 1 charge available. To correct this, edit X#JAQU.D and change all instances of this:

 

GiveItemCreate("X#JACLUB",Player1,1,0,0)

 

into this:

 

GiveItemCreate("X#JACLUB",Player1,1,1,0)

Link to comment

Imoen's Artifact displays a "Polymoprh Other" string whenever it is used. Judging by the way the item is set up, I think that string should only be displayed when she polymorphs herself into a squirrel (5% chance) and not whenever she gets a dexterity boost (95% chance). To correct this, you might want to edit X#DEX.SPL and change its NAME1 strref into 2688 (Dexterity Increase).

 

Also, both X#DEX.SPL and X#POLY.SPL contain a reference to a non-existing sound file on BGT due to a prefixed underscore. You can safely drop the underscore here as the relevant sound file (CAS_M08.WAV) exists in unmodded BG2 and will therefore play just fine on both Tutu and BGT.

Link to comment
At the moment, the "Give [NPC] his/her BG1 portrait" components overwrite the BG1 portrait files with their BG2 counterparts. This can create issues if the player wants to use one of the old BG1 portraits for his PC since he'll get the BG2 version instead. The solution is simple, instead of overwriting the bitmaps, simply assign the proper portraits to the CRE files instead. For example, this code will ensure that all incarnations of Edwin (both from BG1 and BG2) use his BG2 portrait:

 

COPY_EXISTING_REGEXP GLOB ~^_?edwin[0-9]*\.cre$~ ~override~
 PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN // protects against invalid files
WRITE_ASCII 0x34 "NEDWINS" #8 // small portrait
WRITE_ASCII 0x3c "NEDWINM" #8 // medium portrait
 END
BUT_ONLY_IF_IT_CHANGES

 

Note: due to the copying method used, the code should work without problems on both Tutu and BGT without any additional platform checks.

 

Confirming repair - someone please doublecheck that the regexp used will catch imoen.cre - I think I need to add special handling for imoen61.cre on BGT.

 

 

Code:

 

/* Portrait Changes */
/* Edwin */
BEGIN @1022 /* The BG1 NPC Project: Give Edwin his BG2 portrait. */
 GROUP @1008  /* The BG1 NPC Project: Portrait Changes and Additions */
 REQUIRE_FILE ~override/X#BG1NPCCore.G3~ @1004 /* BG1 NPC Required Changes component is not installed. */
 COPY_EXISTING_REGEXP GLOB ~^_?edwin[0-9]*\.cre$~ ~override~
PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN // protects against invalid files
	WRITE_ASCII 0x34 ~NEDWINS~ #8 // small portrait
	WRITE_ASCII 0x3c ~NEDWINM~ #8 // medium portrait
END
 BUT_ONLY_IF_IT_CHANGES

/* Imoen */
BEGIN @1023 /* The BG1 NPC Project: Give Imoen her BG2 portrait. */
 GROUP @1008  /* The BG1 NPC Project: Portrait Changes and Additions */
 REQUIRE_FILE ~override/X#BG1NPCCore.G3~ @1004 /* BG1 NPC Required Changes component is not installed. */
 COPY_EXISTING_REGEXP GLOB ~^_?imoen[0-9]*\.cre$~ ~override~
PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN // protects against invalid files
	WRITE_ASCII 0x34 ~NIMOENS~ #8 // small portrait
	WRITE_ASCII 0x3c ~NIMOENM~ #8 // medium portrait
END
 BUT_ONLY_IF_IT_CHANGES

/* Jaheira */
BEGIN @1024  /* The BG1 NPC Project: Give Jaheira her BG2 portrait. */
 GROUP @1008  /* The BG1 NPC Project: Portrait Changes and Additions */
 REQUIRE_FILE ~override/X#BG1NPCCore.G3~ @1004 /* BG1 NPC Required Changes component is not installed. */
 COPY_EXISTING_REGEXP GLOB ~^_?jahei[0-9]*\.cre$~ ~override~
PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN // protects against invalid files
	WRITE_ASCII 0x34 ~NJAHEIRS~ #8 // small portrait
	WRITE_ASCII 0x3c ~NJAHEIRM~ #8 // medium portrait
END
 BUT_ONLY_IF_IT_CHANGES

/* Minsc */
BEGIN @1025 /* The BG1 NPC Project: Give Minsc his BG2 portrait. */
GROUP @1008  /* The BG1 NPC Project: Portrait Changes and Additions */
REQUIRE_FILE ~override/X#BG1NPCCore.G3~ @1004 /* BG1 NPC Required Changes component is not installed. */
COPY_EXISTING_REGEXP GLOB ~^_?minsc[0-9]*\.cre$~ ~override~
PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN // protects against invalid files
	WRITE_ASCII 0x34 ~NMINSCS~ #8 // small portrait
	WRITE_ASCII 0x3c ~NMINSCM~ #8 // medium portrait
END
 BUT_ONLY_IF_IT_CHANGES

/* Viconia */
BEGIN @1026  /* The BG1 NPC Project: Give Viconia her BG2 portrait. */
 GROUP @1008  /* The BG1 NPC Project: Portrait Changes and Additions */
 REQUIRE_FILE ~override/X#BG1NPCCore.G3~ @1004 /* BG1 NPC Required Changes component is not installed. */
COPY_EXISTING_REGEXP GLOB ~^_?viconi[0-9]*\.cre$~ ~override~
PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN // protects against invalid files
	WRITE_ASCII 0x34 "NVICONS" #8 // small portrait
	WRITE_ASCII 0x3c "NVICONM" #8 // medium portrait
END
 BUT_ONLY_IF_IT_CHANGES

 /* Kivan */
BEGIN @1027  /* The BG1 NPC Project: Kivan's "Kivan and Deheriana Companions" portrait */
GROUP @1008  /* The BG1 NPC Project: Portrait Changes and Additions */
REQUIRE_FILE ~override/X#BG1NPCCore.G3~ @1004 /* BG1 NPC Required Changes component is not installed. */
 COPY ~BG1NPC/Phase2/Portraits/P#KI2L.bmp~ ~override~
 COPY ~BG1NPC/Phase2/Portraits/P#KI2M.bmp~ ~override~
 COPY ~BG1NPC/Phase2/Portraits/P#KI2S.bmp~ ~override~
 COPY_EXISTING_REGEXP GLOB ~^_?kivan[0-9]*\.cre$~ ~override~
PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN // protects against invalid files
	WRITE_ASCII 0x34 ~P#KI2S~ #8 // small portrait
	WRITE_ASCII 0x3c ~P#KI2M~ #8 // medium portrait
END
 BUT_ONLY_IF_IT_CHANGES

<li> <a href="http://forums.gibberlings3.net/index.php?s=&showtopic=18332&view=findpost&p=156883"> aVENGER_(RR)'s repairs to 'Use BG2 Portraits' component.</a> 09.17.2009</li>

Link to comment
Two minor issues with Jaheira's Cloakwood quest:

 

 

1) As soon as Andarthe spawns he initiates dialogue from off-screen (i.e. he doesn't check if there's a PC in his visual range) and that's a bit immersion breaking. To correct this, you might want to add a See([PC]) trigger or something similar to the following block in X#ANDART.BAF:

 

/* Andart if Beador is Alive, initiate */
IF %BGT_VAR%
Global("X#JaheiraHealsB","GLOBAL",6)
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
InMyArea(Player1)
THEN
RESPONSE #100
StartDialogNoSet([PC])
END

 

and probably here as well:

 

/* Andarthe if Beador is Dead, initiate */
IF %BGT_VAR%
Global("X#JQBeadorDead","GLOBAL",3)
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
InMyArea(Player1)
THEN
RESPONSE #100
StartDialogNoSet(Player1)
END

 

Repaired:

 

/* Andart if Beador is Alive, initiate */
IF %BGT_VAR%
Global("X#JaheiraHealsB","GLOBAL",6)
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
InMyArea(Player1)
See([PC])
THEN
RESPONSE #100
StartDialogNoSet([PC])
END

/* Andart if Beador is Dead, activate */
IF %BGT_VAR%
Global("X#JQBeadorDead","GLOBAL",2) // was 22 to 24
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
InMyArea(Player1)
THEN
RESPONSE #100
SetGlobal("X#JQBeadorDead","GLOBAL",3)
END

/* Andarthe if Beador is Dead, initiate */
IF %BGT_VAR%
Global("X#JQBeadorDead","GLOBAL",3)
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
InMyArea(Player1)
See([PC])
THEN
RESPONSE #100
StartDialogNoSet(Player1)
END

 

2) The club which Senyad gives to the party after completing the quest initially has zero charges of Call Lightning. This rectifies itself after resting but, judging by the description, the club should come with 1 charge available. To correct this, edit X#JAQU.D and change all instances of this:

 

GiveItemCreate("X#JACLUB",Player1,1,0,0)

 

into this:

 

GiveItemCreate("X#JACLUB",Player1,1,1,0)

 

Search "GiveItemCreate("X#JACLUB",Player1,1,0,0)" (5 hits in 1 files)

E:\BG1NPC_Workspace\bg1npc-v18_working\bg1npc_18_prerelease\phase2\dlg\x#jaqu.d (5 hits)

Line 580: IF ~~ THEN DO ~AddexperienceParty(5000) GiveItemCreate("X#JACLUB",Player1,1,0,0) SetGlobal("SeniyadXP","GLOBAL",1) EraseJournalEntry(@163) Shout(3) EscapeArea()~ SOLVED_JOURNAL @169 EXIT

Line 595: IF ~~ THEN DO ~AddexperienceParty(5000) GiveItemCreate("X#JACLUB",Player1,1,0,0) SetGlobal("SeniyadXP","GLOBAL",1) EraseJournalEntry(@163) Shout(3) EscapeArea()~ SOLVED_JOURNAL @169 EXIT

Line 601: IF ~~ THEN DO ~AddexperienceParty(10000) GiveItemCreate("X#JACLUB",Player1,1,0,0) SetGlobal("SeniyadXP","GLOBAL",1) EraseJournalEntry(@163) Shout(3) EscapeArea()~ SOLVED_JOURNAL @169 EXIT

Line 611: IF ~~ THEN DO ~AddexperienceParty(5000) GiveItemCreate("X#JACLUB",Player1,1,0,0) SetGlobal("SeniyadXP","GLOBAL",1) EraseJournalEntry(@163) Shout(3) EscapeArea()~ SOLVED_JOURNAL @169 EXIT

Line 618: IF ~~ THEN DO ~AddexperienceParty(5000) GiveItemCreate("X#JACLUB",Player1,1,0,0) SetGlobal("SeniyadXP","GLOBAL",1) EraseJournalEntry(@163) Shout(3) EscapeArea()~ SOLVED_JOURNAL @169 EXIT

 

all instances repaired from 1,0,0 to 1,1,0

 

 

<li> <a href="http://forums.gibberlings3.net/index.php?s=&showtopic=18332&view=findpost&p=156885">aVENGER_(RR)'s repairs to Jaheira's Quest items and scripts</a> 09.17.2009 </li>

Link to comment
aVenger,

 

I hope you don't mind me partecipating to this thread by reporting an incompatibility issue between BG1 NPC and Item Revisions at this link:

 

http://forums.gibberlings3.net/index.php?s...st&p=156361

 

Thanks!

 

OK, though this really is a tough call - I like Item Revisions, but can't this kind of thing be fixed via install order?

 

Anyways, it is a small file to drop into place. Exported ~RING30.itm~ from a clean install and named it x#ringro.itm. New code:

 

  /* items */
 /* Ring of Human Influence */
 COPY_EXISTING ~BG1NPC/Phase1/ITM/X#RINGRO.itm~ ~override/X#RINGRO.itm~
SAY NAME1 @10
SAY NAME2 @11
SAY UNIDENTIFIED_DESC @12
SAY DESC @13
 BUT_ONLY_IF_IT_CHANGES

 

<li> <a href="http://forums.gibberlings3.net/index.php?s=&showtopic=18332&view=findpost&p=156887"> Item Revisions compatibility for the ring of Human Influence </a> 09.17.2009 </li>

Link to comment
Imoen's Artifact displays a "Polymoprh Other" string whenever it is used. Judging by the way the item is set up, I think that string should only be displayed when she polymorphs herself into a squirrel (5% chance) and not whenever she gets a dexterity boost (95% chance). To correct this, you might want to edit X#DEX.SPL and change its NAME1 strref into 2868 (Dexterity Increase).

 

Also, both X#DEX.SPL and X#POLY.SPL contain a reference to a non-existing sound file on BGT due to a prefixed underscore. You can safely drop the underscore here as the relevant sound file (CAS_M08.WAV) exists in unmodded BG2 and will therefore play just fine on both Tutu and BGT.

 

Repaired X#DEX.SPL NAME1 to 2868, Dexterity increase using Taimon's build of NI.

 

Rechecked on EasyTutu_ToB latest version - it looks like those resources are still intact. Hopefully, a "cannibal" install does not mess with this - but I think it does not. Macready was pretty darned careful with his work.

 

10th Lich, aVENGER_(RR), I am checking those casting sounds and resrefs,

BUT - it seems either I fixed this before, or something we are doing is not working, because I have the following already in the pre-release v18:

 

  COPY ~BG1NPC/Phase1/ITM/NUTKIN.EFF~ ~override~
 COPY ~BG1NPC/Phase1/ITM/X#DEX.SPL~ ~override~
WRITE_ASCII 0x10 ~CAS_M08~ #8	// casting sound
WRITE_ASCII 0x3a ~SPWI415C~ #8   // spell icon
WRITE_ASCII 0x76 ~SPWI415B~ #8   // ability #0 icon
WRITE_ASCII 0xDE ~EFF_P07~ #8	// resource

 COPY ~BG1NPC/Phase1/ITM/X#POLY.SPL~ ~override~
WRITE_ASCII 0x10 ~CAS_M08~ #8	// casting sound
WRITE_ASCII 0x3a ~SPWI415C~ #8   // spell icon
WRITE_ASCII 0x76 ~SPWI415B~ #8   // ability #0 icon
WRITE_ASCII 0xDE ~EFF_P07~ #8	// resource

 

I will recheck on the test install.

Link to comment
10th Lich, aVENGER_(RR), I am checking those casting sounds and resrefs,

BUT - it seems either I fixed this before, or something we are doing is not working, because I have the following already in the pre-release v18

 

Nice work! :)

 

BTW, the underscored sound file references aren't just in the casting sounds, they are also in opcode #174 (Play Sound Effect) inside the spells' extended headers.

Link to comment

Got it - checking... I can edit that in right away.

 

And by the way, I should have my ears boxed - I misunderstood your regexp. It was perfect - the clip from the debug,

 

Install Component [The BG1 NPC Project: Give Imoen her BG2 portrait.]?

nstall, or [N]ot Install or [Q]uit?

Installing [The BG1 NPC Project: Give Imoen her BG2 portrait.]

 

BGT detected: support at www.gibberlings3.net, Mega Installs check first at www.spellholdstudios.net.

Copying and patching 1 file ...

[bG1NPC/TRA/english/BG1NPC_tmp.tra] loaded, 83768 bytes

BG1NPC/TRA/english/BG1NPC.tra copied to bg1npc/backup/3/BG1NPC.tra, 82398 bytes

Copied [bG1NPC/TRA/english/BG1NPC_tmp.tra] to [bG1NPC/TRA/english/BG1NPC.tra]

loading 1 tra file

[bG1NPC/TRA/english/BG1NPC.tra] has 580 translation strings

Checking for required files ...

[override/X#BG1NPCCore.G3] found: 83 bytes

Copying and patching 10 files ...

Copied [iMOEN.CRE] to [override/IMOEN.CRE]

Copied [iMOEN1.CRE] to [override/IMOEN1.CRE]

[./override/IMOEN10.CRE] loaded, 2572 bytes

Copied [iMOEN2.CRE] to [override/IMOEN2.CRE]

Copied [iMOEN4.CRE] to [override/IMOEN4.CRE]

[./override/IMOEN6.CRE] loaded, 1256 bytes

Copied [iMOEN61.CRE] to [override/IMOEN61.CRE]

 

:)

Link to comment

For a future v19 Version:

 

Jaheira's portrait patch unfortunately assigns all those unnamed Harpers from her BG2 quest her own portraits.

 

At least for BGT it should only patch the following .cres, as these are her BG1 incarnations:

Jaheir, Jaheir2, Jaheir4 and Jaheir6.

 

Jaheir7, Jaheir8, Jahei12B and Jahei14 are BG2 cre-files.

 

Jahei1, Jahei2, Jahei3 and Jahei4 are unnamed Harpers.

 

Lich

Link to comment
For a future v19 Version:

 

Jaheira's portrait patch unfortunately assigns all those unnamed Harpers from her BG2 quest her own portraits.

 

I can confirm this. Here's the revised code:

 

/* Portrait Changes */
/* Edwin */
BEGIN @1022 /* The BG1 NPC Project: Give Edwin his BG2 portrait. */
 GROUP @1008  /* The BG1 NPC Project: Portrait Changes and Additions */
 REQUIRE_FILE ~override/X#BG1NPCCore.G3~ @1004 /* BG1 NPC Required Changes component is not installed. */
ACTION_FOR_EACH edwin IN edwin edwin2 edwin4 edwin6 _edwin _edwin2 _edwin4 _edwin6 BEGIN
 ACTION_IF FILE_EXISTS_IN_GAME "%edwin%.cre" BEGIN
COPY_EXISTING "%edwin%.cre" ~override~ // Edwin
  PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN // protects against invalid files
	WRITE_ASCII 0x34 ~NEDWINS~ #8 // small portrait
	WRITE_ASCII 0x3c ~NEDWINM~ #8 // medium portrait
  END
BUT_ONLY_IF_IT_CHANGES
 END
END

/* Imoen */
BEGIN @1023 /* The BG1 NPC Project: Give Imoen her BG2 portrait. */
 GROUP @1008  /* The BG1 NPC Project: Portrait Changes and Additions */
 REQUIRE_FILE ~override/X#BG1NPCCore.G3~ @1004 /* BG1 NPC Required Changes component is not installed. */
ACTION_FOR_EACH imoen IN imoen imoen1 imoen2 imoen4 imoen61 _imoen _imoen1 _imoen2 _imoen4 _imoen6 BEGIN
 ACTION_IF FILE_EXISTS_IN_GAME "%imoen%.cre" BEGIN
COPY_EXISTING "%imoen%.cre" ~override~
  PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN // protects against invalid files
	WRITE_ASCII 0x34 ~NIMOENS~ #8 // small portrait
	WRITE_ASCII 0x3c ~NIMOENM~ #8 // medium portrait
  END
BUT_ONLY_IF_IT_CHANGES
 END
END

/* Jaheira */
BEGIN @1024  /* The BG1 NPC Project: Give Jaheira her BG2 portrait. */
 GROUP @1008  /* The BG1 NPC Project: Portrait Changes and Additions */
 REQUIRE_FILE ~override/X#BG1NPCCore.G3~ @1004 /* BG1 NPC Required Changes component is not installed. */
ACTION_FOR_EACH jaheira IN jaheir jaheir2 jaheir4 jaheir6 _jaheir _jaheir2 _jaheir4 _jaheir6 BEGIN
 ACTION_IF FILE_EXISTS_IN_GAME "%jaheira%.cre" BEGIN
COPY_EXISTING "%jaheira%.cre" ~override~ // Jaheira
  PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN // protects against invalid files
	WRITE_ASCII 0x34 ~NJAHEIRS~ #8 // small portrait
	WRITE_ASCII 0x3c ~NJAHEIRM~ #8 // medium portrait
  END
BUT_ONLY_IF_IT_CHANGES
 END
END

/* Minsc */
BEGIN @1025 /* The BG1 NPC Project: Give Minsc his BG2 portrait. */
GROUP @1008  /* The BG1 NPC Project: Portrait Changes and Additions */
REQUIRE_FILE ~override/X#BG1NPCCore.G3~ @1004 /* BG1 NPC Required Changes component is not installed. */
ACTION_FOR_EACH minsc IN minsc minsc2 minsc4 minsc6 _minsc _minsc2 _minsc4 _minsc6 BEGIN
 ACTION_IF FILE_EXISTS_IN_GAME "%minsc%.cre" BEGIN
COPY_EXISTING "%minsc%.cre" ~override~ // Minsc
  PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN // protects against invalid files
	WRITE_ASCII 0x34 ~NMINSCS~ #8 // small portrait
	WRITE_ASCII 0x3c ~NMINSCM~ #8 // medium portrait
  END
BUT_ONLY_IF_IT_CHANGES
 END
END

/* Viconia */
BEGIN @1026  /* The BG1 NPC Project: Give Viconia her BG2 portrait. */
 GROUP @1008  /* The BG1 NPC Project: Portrait Changes and Additions */
 REQUIRE_FILE ~override/X#BG1NPCCore.G3~ @1004 /* BG1 NPC Required Changes component is not installed. */
ACTION_FOR_EACH viconia IN viconi viconi4 viconi61 _viconi _viconi4 _viconi6 BEGIN
 ACTION_IF FILE_EXISTS_IN_GAME "%viconia%.cre" BEGIN
COPY_EXISTING "%viconia%.cre" ~override~ // Viconia
  PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN // protects against invalid files
	WRITE_ASCII 0x34 "NVICONS" #8 // small portrait
	WRITE_ASCII 0x3c "NVICONM" #8 // medium portrait
  END
BUT_ONLY_IF_IT_CHANGES
 END
END

/* Kivan */
BEGIN @1027  /* The BG1 NPC Project: Kivan's "Kivan and Deheriana Companions" portrait */
GROUP @1008  /* The BG1 NPC Project: Portrait Changes and Additions */
REQUIRE_FILE ~override/X#BG1NPCCore.G3~ @1004 /* BG1 NPC Required Changes component is not installed. */
 COPY ~BG1NPC/Phase2/Portraits/P#KI2L.bmp~ ~override~
 COPY ~BG1NPC/Phase2/Portraits/P#KI2M.bmp~ ~override~
 COPY ~BG1NPC/Phase2/Portraits/P#KI2S.bmp~ ~override~
ACTION_FOR_EACH kivan IN kivan kivan4 kivan6 _kivan _kivan4 _kivan6 BEGIN
 ACTION_IF FILE_EXISTS_IN_GAME "%kivan%.cre" BEGIN
COPY_EXISTING "%kivan%.cre" ~override~ // Kivan
  PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN // protects against invalid files
	WRITE_ASCII 0x34 ~P#KI2S~ #8 // small portrait
	WRITE_ASCII 0x3c ~P#KI2M~ #8 // medium portrait
  END
BUT_ONLY_IF_IT_CHANGES
 END
END

 

Bonus feature: this should compile much faster than using COPY_EXISTING_REGEXP GLOB, especially on megamod installs. :)

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...