Jump to content

Duplicate gem bag bug


Recommended Posts

Existing fixpack code:

// Amkethran duplicate gem bag fix, part one of three (see amsmug02.sto, bago2j.sto)
ACTION_IF FILE_EXISTS_IN_GAME ~mel01.cre~ THEN BEGIN // ToB-only stuff check
 COPY_EXISTING ~bag02i.itm~ ~override/bag02j.itm~

// Amkethran duplicate gem bag fix, part two of three (see bago2j.itm, bago2j.sto)
 // Amkethran duplicate gem bag fix, part two of three (see bago2j.itm, bago2j.sto)
 COPY_EXISTING ~amsmug02.sto~ ~override~
READ_LONG 0x34 "4sale_off"
READ_LONG 0x38 "4sale_num"
WHILE ("%4sale_num%" > 0) BEGIN
  SET "4sale_num" = ("%4sale_num%" - 1)
  READ_ASCII ("%4sale_off%" + ("%4sale_num%" * 0x1c)) "item"
  PATCH_IF ("%item%" STRING_COMPARE_CASE "bag02i" = 0) BEGIN
	WRITE_ASCII ("%4sale_off%" + ("%4sale_num%" * 0x1c)) "bag02j"
  END
END
BUT_ONLY_IF_IT_CHANGES

 // Amkethran duplicate gem bag fix, part three of three (see amsmug02.sto, bago2j.itm)
 COPY_EXISTING ~bag02i.sto~ ~override/bag02j.sto~
END

This is silly (I know it's from Baldurdash, but that's no excuse :D). Bag02i is not the duplicate - it's bag02d (which appears at 3 stores in ToB - both Amkethran Smugglers and Arledrian). Also, you are copying the (wrong) bag to bag02j, which is used by RoT (thus making a non-duplicate in effect potentially a duplicate).

 

Code I'm using:

ACTION_IF FILE_EXISTS_IN_GAME ~amsmug02.sto~ THEN BEGIN //ToB
 COPY_EXISTING ~bag02d.itm~ ~override/t-bgem04.itm~ //Gem Bag
			~bag02d.itm~ ~override/t-bgem05.itm~
			~bag02d.itm~ ~override/t-bgem06.itm~
			~bag02d.sto~ ~override/t-bgem04.sto~
			~bag02d.sto~ ~override/t-bgem05.sto~
			~bag02d.sto~ ~override/t-bgem06.sto~

 COPY_EXISTING ~amsmug01.sto~ ~override~ //Amkethran Smugglers 1
PATCH_IF SOURCE_SIZE > 0x9b BEGIN
  REMOVE_STORE_ITEM ~t-bgem04~ ~bag02i~ ~bag02d~
  ADD_STORE_ITEM ~t-bgem04~ LAST #0 #0 #0 ~IDENTIFIED~ #1
END
 BUT_ONLY_IF_IT_CHANGES

 COPY_EXISTING ~amsmug02.sto~ ~override~ //Amkethran Smugglers 2
PATCH_IF SOURCE_SIZE > 0x9b BEGIN
  REMOVE_STORE_ITEM ~t-bgem06~ ~t-bgem05~ ~bag02j~ ~bag02i~ ~bag02d~
  ADD_STORE_ITEM ~t-bgem05~ LAST #0 #0 #0 ~IDENTIFIED~ #1
  ADD_STORE_ITEM ~t-bgem06~ LAST #0 #0 #0 ~IDENTIFIED~ #1
END
 BUT_ONLY_IF_IT_CHANGES
END

I've used my own namespace - feel free to use it or something else - anything that's not going to get duplicated. The redundant REMOVE_STORE_ITEMs are in case anyone's installed Baldurdash or another "fix" for this. (And somewhere along Baldurdash's history, RoT has "used" bag02i somewhere else, so let it...)

Link to comment

If we were going to be breaking saved game compatibility at this late date, it'd be with

  COPY_EXISTING 
 amsmug01.sto override
 amsmug02.sto override
REMOVE_STORE_ITEM bag02d
 BUT_ONLY

 

Bag02i is a late Bioware patch addition, if Region of Terror is trying to recycle it, it's that mod's own problem.

Link to comment

That would be the simplest way, sure. What with "developer intent" putting the gem bag in three different stores though, I think they "intended" to have it available in those 3 stores. Not that I care, because I fixed it in Unique Containers anyhow :thumbsup:. But if you *are* going to go with "intent" and clone the bag, at least clone it with a prefix and not to some generic resource other mods (RoT being just one example) might be using/overwriting.

Link to comment

Prefixing the new bags which the fixpack adds seems like the least intrusive solution.

 

// Amkethran duplicate gem bag fix, part one of four (see amsmug01.sto amsmug02.sto, cdbag02i.sto, cdbag02j.sto)
ACTION_IF FILE_EXISTS_IN_GAME ~mel01.cre~ THEN BEGIN // ToB-only stuff check
 COPY_EXISTING ~bag02i.itm~ ~override/cdbag02i.itm~
 COPY_EXISTING ~bag02i.itm~ ~override/cdbag02j.itm~
END

 // Amkethran duplicate gem bag fix, part two of four (see cdbag02i.itm, cdbag02j.itm, cdbag02i.sto, cdbag02j.sto)
 COPY_EXISTING ~amsmug01.sto~ ~override~
READ_LONG 0x34 "4sale_off"
READ_LONG 0x38 "4sale_num"
WHILE ("%4sale_num%" > 0) BEGIN
  SET "4sale_num" = ("%4sale_num%" - 1)
  READ_ASCII ("%4sale_off%" + ("%4sale_num%" * 0x1c)) "item"
  PATCH_IF ("%item%" STRING_COMPARE_CASE "bag02d" = 0) BEGIN
	WRITE_ASCII ("%4sale_off%" + ("%4sale_num%" * 0x1c)) "cdbag02i"
  END
END
BUT_ONLY_IF_IT_CHANGES

 // Amkethran duplicate gem bag fix, part three of four (see cdbag02i.itm, cdbag02j.itm, cdbag02i.sto, cdbag02j.sto)
 COPY_EXISTING ~amsmug02.sto~ ~override~
READ_LONG 0x34 "4sale_off"
READ_LONG 0x38 "4sale_num"
WHILE ("%4sale_num%" > 0) BEGIN
  SET "4sale_num" = ("%4sale_num%" - 1)
  READ_ASCII ("%4sale_off%" + ("%4sale_num%" * 0x1c)) "item"
  PATCH_IF ("%item%" STRING_COMPARE_CASE "bag02d" = 0) BEGIN
	WRITE_ASCII ("%4sale_off%" + ("%4sale_num%" * 0x1c)) "cdbag02j"
  END
END
BUT_ONLY_IF_IT_CHANGES

 // Amkethran duplicate gem bag fix, part four of four (see amsmug01.sto, amsmug02.sto, cdbag02i.itm, cdbag02j.itm)
 COPY_EXISTING ~bag02i.sto~ ~override/cdbag02i.sto~
 COPY_EXISTING ~bag02i.sto~ ~override/cdbag02j.sto~

Link to comment

Archived

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

×
×
  • Create New...