Jump to content

BG1 Tweak Pack


Guest grogerson

Recommended Posts

Edit: I added the following line to Identify All Items and it appears to be working (skipped installing with Gems and Potions Have Lore):

REQUIRE_PREDICATE NOT ((FILE_EXISTS_IN_GAME ~cdb01060.g3~) OR (FILE_EXISTS_IN_GAME ~cdb02070.g3~) OR (FILE_EXISTS_IN_GAME ~cdb02071.g3~) OR (FILE_EXISTS_IN_GAME ~cdb02072.g3~)) @9

 

 

REQUIRE_PREDICATE NOT(FILE_EXISTS ~nolore.b1t~) ~Identify All component has been installed. Skipping...~

//some people rename an in game file I prefer to use and inlined empty file.

<<<<<<<< blank.file

>>>>>>>>

COPY blank.file override/gprqlore.b1t /*use whatever naming convention you want so long as you are consistent */

Ugh. Please use REQUIRE_PREDICATE NOT MOD_IS_INSTALLED ~mymod.tp2~ 123 when dealing with your own mod rather than loading unnecessary junk into the override.

Don't know if I agree with your MOD_IS_INSTALLED, Miloch. Sounds like you're skipping the entire mod. I'm just checking for installed components (which create marker files), so I'll stick with FILE_EXISTS_IN_GAME. I've also tagged Gems and Shopkeepers to detect Identify All. I can just see someone installing the latter, then trying to install one of the former...

 

Of course, your way may be better, but I've no knowledge how the two detection methods differ.

Link to comment

Maybe there is another way around it.

 

Force a designated component number and make sure that it won't possibly ever get used in a natural count of the other components. You'll have to pick something high, but the next component counts from there on. So if you designate again you'll have to make sure that it is even higher. Here's the example.

 

BEGIN ~Gem and potions require lore~
DESIGNATED 1000000
FORBID_COMPONENT ~setup-bg1tweaks.tp2~ ~2000000~ ~Identify All Items installed. Skipping Gem and Potions Require Lore~

SUBCOMPONENT ~Shopkeepers Identify by Lore~
BEGIN ~Mages/bards only~
PRINT ~If you choose to install this component and later install the component Identify All items you will be making this component pointless. Installation of this component will continue once you press enter....~
ACTION_READLN ~continue~

BEGIN ~Lore based~
SUBCOMPONENT ~Shopkeepers Identify by Lore~
PRINT ~If you choose to install this component and later install the component Identify All items you will be making this component pointless. Installation of this component will continue once you press enter....~
ACTION_READLN ~continue~

BEGIN ~Hybrid of both~
SUBCOMPONENT ~Shopkeepers Identify by Lore~
PRINT ~If you choose to install this component and later install the component Identify All items you will be making this component pointless. Installation of this component will continue once you press enter....~
ACTION_READLN ~continue~

BEGIN ~Identify All~
DESIGNATED 2000000
FORBID_COMPONENT ~setup-bg1tweaks.tp2~ ~1000000~ ~Gem and Potions Require Lore installed. Skipping Identify All.~
PRINT ~Installation of this component will make useless any changes made in the Shopkeepers Identify by Lore component. Installation of this component will proceed once you press enter....~
ACTION_READLN ~continue~

Note the prints and the readln commands. Those are in there to give them the heads up. It's stupid to modify the identification at stores and then identify all items. But they aren't going to conflict so just giving warnings in the readme and once again during installation should be fine. The ones that conflict are the gems and potions and identify all. So those two get designated so that we will always know what numbers they are and forbid them accordingly....

 

That's the clearest mud I've ever seen.... :)

Link to comment
Force a designated component number
Same thing as what I said, though FORBID_COMPONENT is slightly cleaner. You don't need some stupid-high component numbering system though - just DESIGNATE all components and keep it fairly simple (10, 20, 30... 100, 110 etc.). Then FORBID_COMPONENT or NOT MOD_IS_INSTALLED have the same effect as bogus junk file checking.

 

I wouldn't put the PRINTs and READLNs in though - that sort of thing can go in the readme. Just SUBCOMPONENT and FORBID or REQUIRE things as relevant. If in doubt, look it up in the WeiDU document.

Link to comment
Specifically see if the unidentified potions can be equipped in the quick slot and then used. That was an issue I found with the BG2 version. I made a fix for that, but now that I look at things, I'm not too sure about it. It will have to be revisited anyway to make sure it's accurate for the BG1 engine. Anywho, unidentified items (including potions) aren't supposed to be equipped or used is my understanding.

Yes and yes. I'll check the usability of unidentified items tomorrow. Just reinstalled my BG1 games (without and with TotSC) and modded them.

 

Miloch and plainab, I think I'll keep it my way for now, using REQUIRE_PREDICATE NOT FILE_EXISTS_IN_GAME. The readme is also updated to indicate the skipping if an incompatible component is already installed. And any new components should be added at the end of the section it belongs in, not in the middle, so the component code (cdb0####) should not change. Besides, this is a beta, not v1.

Link to comment

Here's the Khalid tweak code:

 

/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////                                                  \\\\\
///// Make Khalid a Fighter-Mage                       \\\\\
/////                                                  \\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\

BEGIN @406000 DESIGNATED 4060
GROUP @4

// this file does nothing, it just allows other mods to detect this component
COPY_EXISTING ~khalid.cre~ ~override/cdb04060.g3~

COPY_EXISTING ~khalid.cre~ ~override~
             ~khalid2.cre~ ~override~
             ~khalid4.cre~ ~override~
             ~khalid6.cre~ ~override~
PATCH_IF (%SOURCE_SIZE% > 724) BEGIN //ensure file is at least header size
 // WRITE_LONG 0x10 0    // remove all class flags
 WRITE_BYTE 0x70 2    // raise longbow prof
 WRITE_BYTE 0x74 0    // remove axe prof
 WRITE_BYTE 0x236 0   // remove 3rd class level
 WRITE_BYTE 0x23a 15  // increase intelligence
 WRITE_BYTE 0x273 7   // change class to fighter/mage
 REMOVE_CRE_ITEM ~CHAN04~
 REMOVE_CRE_ITEM ~SHLD03~
 REMOVE_CRE_ITEM ~BOW03~
 REPLACE_CRE_ITEM ~SW1H01~ #0  #0 #0 ~IDENTIFIED~ ~WEAPON1~
 REPLACE_CRE_ITEM ~BOW03~  #0  #0 #0 ~IDENTIFIED~ ~INV2~ EQUIP TWOHANDED
 REPLACE_CRE_ITEM ~AROW01~ #40 #0 #0 ~IDENTIFIED~ ~QUIVER1~
READ_LONG 0x2a8 memoff
READ_LONG 0x2ac memnum

FOR (x=0;x<%memnum%;x+=1) BEGIN
 READ_SHORT (%memoff% + (0x10 * %x%) + 0x0) level
 READ_SHORT (%memoff% + (0x10 * %x%) + 0x6) type
 PATCH_IF ((%level% = 0) AND (%type% = 1)) BEGIN //add info to have a mem spell slot available
   WRITE_SHORT (%memoff% + (0x10 * %x%) + 0x2) 1
   WRITE_SHORT (%memoff% + (0x10 * %x%) + 0x4) 1
 END
[i][b]  PATCH_IF (%x% = 16) BEGIN
   DELETE_BYTES (%memoff% + (0x10 * %x%)) 0x10 //removes innate mem info slot
   WRITE_LONG 0x2ac (%memnum% - 1)  //legalize mem info number
   SET x = %memnum%
 END[/b][/i]
END

READ_LONG 0x2b0 memspellsoff
 PATCH_IF (%memspellsoff% >= %memoff%) BEGIN
   WRITE_LONG 0x2b0 (%memspellsoff% - 0x10)
 END
READ_LONG 0x2b8 itemslots
 PATCH_IF (%itemslots% >= %memoff%) BEGIN
   WRITE_LONG 0x2b8 (%itemslots% - 0x10)
 END
READ_LONG 0x2bc itemoff
 PATCH_IF (%itemoff% >= %memoff%) BEGIN
   WRITE_LONG 0x2bc (%itemoff% - 0x10)
 END
READ_LONG 0x2c4 fxoff
 PATCH_IF (%fxoff% >= %memoff%) BEGIN
   WRITE_LONG 0x2c4 (%fxoff% - 0x10)
 END
END
BUT_ONLY_IF_IT_CHANGES

// add in spells and items
// PATCH_IF (~%SOURCE_RES%~ STRING_EQUAL_CASE ~khalid.cre~) BEGIN
COPY_EXISTING ~khalid.cre~ ~override~
 WRITE_LONG 0x18 4888  // raise XP
 WRITE_SHORT 0x24 8    // current hp
 WRITE_SHORT 0x26 8    // max hp
 WRITE_BYTE 0x52 19    // lower thac0
 WRITE_BYTE 0x66 3     // lower lore
 WRITE_BYTE 0x234 2    // 1st class level
 WRITE_BYTE 0x235 1    // 2nd class level
 ADD_KNOWN_SPELL ~SPWI114~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI116~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI108~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI112~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI119~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI110~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI102~ #0 ~wizard~
 ADD_MEMORIZED_SPELL ~SPWI102~ #0 ~wizard~ (1)
// END ELSE PATCH_IF (~%SOURCE_RES%~ STRING_EQUAL_CASE ~khalid2.cre~) THEN BEGIN
COPY_EXISTING ~khalid2.cre~ ~override~
 WRITE_LONG 0x18 9944  // raise XP
 WRITE_SHORT 0x24 12   // current hp
 WRITE_SHORT 0x26 12   // max hp
 WRITE_BYTE 0x52 18    // lower thac0
 WRITE_BYTE 0x54 13    // improve save (khalid2)
 WRITE_BYTE 0x66 6     // lower lore
 WRITE_BYTE 0x72 1     // raise blunt prof (khalid2, 4, 6)
 WRITE_BYTE 0x234 3    // 1st class level
 WRITE_BYTE 0x235 2    // 2nd class level
 ADD_CRE_ITEM ~brac03~ #0 #0 #0 ~IDENTIFIED~ ~GLOVES~
 ADD_KNOWN_SPELL ~SPWI114~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI116~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI108~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI112~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI119~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI110~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI102~ #0 ~wizard~
 ADD_MEMORIZED_SPELL ~SPWI102~ #0 ~wizard~ (1)
 ADD_MEMORIZED_SPELL ~SPWI112~ #0 ~wizard~ (1)
// END ELSE PATCH_IF (~%SOURCE_RES%~ STRING_EQUAL_CASE ~khalid4.cre~) THEN BEGIN
COPY_EXISTING ~khalid4.cre~ ~override~
 WRITE_LONG 0x18 18822 // raise XP
 WRITE_SHORT 0x24 14   // current hp
 WRITE_SHORT 0x26 14   // max hp
 WRITE_BYTE 0x66 9     // lower lore
 WRITE_BYTE 0x6e 2     // lower large sword prof (khalid4, 6)
 WRITE_BYTE 0x72 1     // raise blunt prof (khalid2, 4, 6)
 WRITE_BYTE 0x234 4    // 1st class level
 WRITE_BYTE 0x235 3    // 2nd class level
 ADD_CRE_ITEM ~brac03~ #0 #0 #0 ~IDENTIFIED~ ~GLOVES~
 ADD_CRE_ITEM ~clck14~ #0 #0 #0 ~IDENTIFIED~ ~CLOAK~
 ADD_KNOWN_SPELL ~SPWI114~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI116~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI108~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI112~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI119~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI110~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI102~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI212~ #0 ~wizard~
 ADD_MEMORIZED_SPELL ~SPWI102~ #0 ~wizard~ (1)
 ADD_MEMORIZED_SPELL ~SPWI112~ #0 ~wizard~ (1)
 ADD_MEMORIZED_SPELL ~SPWI212~ #1 ~wizard~ (1)
// END ELSE PATCH_IF (~%SOURCE_RES%~ STRING_EQUAL_CASE ~khalid6.cre~) THEN BEGIN
COPY_EXISTING ~khalid6.cre~ ~override~
 WRITE_LONG 0x18 43588 // raise XP
 WRITE_SHORT 0x24 20   // current hp
 WRITE_SHORT 0x26 20   // max hp
 WRITE_BYTE 0x52 16    // lower thac0
 WRITE_BYTE 0x66 15    // lower lore
 WRITE_BYTE 0x6e 2     // lower large sword prof (khalid4, 6)
 WRITE_BYTE 0x72 1     // raise blunt prof (khalid2, 4, 6)
 WRITE_BYTE 0x234 5    // 1st class level
 WRITE_BYTE 0x235 5    // 2nd class level
 ADD_CRE_ITEM ~ring06~ #0 #0 #0 ~IDENTIFIED~ ~LRING~
 ADD_CRE_ITEM ~brac03~ #0 #0 #0 ~IDENTIFIED~ ~GLOVES~
 ADD_CRE_ITEM ~clck14~ #0 #0 #0 ~IDENTIFIED~ ~CLOAK~
 ADD_KNOWN_SPELL ~SPWI114~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI116~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI108~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI112~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI119~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI110~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI102~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI212~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI213~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI303~ #0 ~wizard~
 ADD_MEMORIZED_SPELL ~SPWI102~ #0 ~wizard~ (1)
 ADD_MEMORIZED_SPELL ~SPWI112~ #0 ~wizard~ (3)
 ADD_MEMORIZED_SPELL ~SPWI212~ #1 ~wizard~ (1)
 ADD_MEMORIZED_SPELL ~SPWI213~ #1 ~wizard~ (1)
 ADD_MEMORIZED_SPELL ~SPWI303~ #2 ~wizard~ (1)
// END

I removed the code in bold italics and it got rid of the CTD at the FAI. My problem now is that Khalid loses everything not ADD_CRE_ITEM. Any ideas what's wrong? Getting late, so I'm quitting for now.

 

@plainab: Looks like some items can be readied/worn/used even if unidentified.

Link to comment

I'm going to edit the code and put in comments. I'll explain my reasoning there. Okay? Here we go....

Here's the Khalid tweak code:

 

/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\

/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\

///// \\\\\

///// Make Khalid a Fighter-Mage \\\\\

///// \\\\\

/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\

/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\

 

BEGIN @406000 DESIGNATED 4060

GROUP @4

 

// this file does nothing, it just allows other mods to detect this component

COPY_EXISTING ~khalid.cre~ ~override/cdb04060.g3~

 

COPY_EXISTING ~khalid.cre~ ~override~

~khalid2.cre~ ~override~

~khalid4.cre~ ~override~

~khalid6.cre~ ~override~

PATCH_IF (%SOURCE_SIZE% > 724) BEGIN //ensure file is at least header size

// WRITE_LONG 0x10 0 // remove all class flags

WRITE_BYTE 0x70 2 // raise longbow prof

WRITE_BYTE 0x74 0 // remove axe prof

WRITE_BYTE 0x236 0 // remove 3rd class level

WRITE_BYTE 0x23a 15 // increase intelligence

WRITE_BYTE 0x273 7 // change class to fighter/mage

REMOVE_CRE_ITEM ~CHAN04~

REMOVE_CRE_ITEM ~SHLD03~

REMOVE_CRE_ITEM ~BOW03~

/*Try putting a quantity in as in this bolded example

in fact I would assign a quantity to ALL add_cre_item entries as well as replace_cre_item, but that is me. I think add_cre_item defaults to one if left blank, but replace_cre_item may not. You remove the bow and then add it back in? Drop armor and shield is understandable to me.*/

REPLACE_CRE_ITEM ~SW1H01~ #1 #0 #0 ~IDENTIFIED~ ~WEAPON1~

REPLACE_CRE_ITEM ~BOW03~ #1 #0 #0 ~IDENTIFIED~ ~INV2~ EQUIP TWOHANDED

// REPLACE_CRE_ITEM ~SW1H01~ #0 #0 #0 ~IDENTIFIED~ ~WEAPON1~

// REPLACE_CRE_ITEM ~BOW03~ #0 #0 #0 ~IDENTIFIED~ ~INV2~ EQUIP TWOHANDED

REPLACE_CRE_ITEM ~AROW01~ #40 #0 #0 ~IDENTIFIED~ ~QUIVER1~

READ_LONG 0x2a8 memoff

READ_LONG 0x2ac memnum

 

FOR (x=0;x<%memnum%;x+=1) BEGIN

READ_SHORT (%memoff% + (0x10 * %x%) + 0x0) level

READ_SHORT (%memoff% + (0x10 * %x%) + 0x6) type

PATCH_IF ((%level% = 0) AND (%type% = 1)) BEGIN //add info to have a mem spell slot available

WRITE_SHORT (%memoff% + (0x10 * %x%) + 0x2) 1

WRITE_SHORT (%memoff% + (0x10 * %x%) + 0x4) 1

END

// took out the offending code so we don't get confused later

END

 

READ_LONG 0x2b0 memspellsoff

PATCH_IF (%memspellsoff% >= %memoff%) BEGIN

WRITE_LONG 0x2b0 (%memspellsoff% - 0x10)

END

READ_LONG 0x2b8 itemslots

PATCH_IF (%itemslots% >= %memoff%) BEGIN

WRITE_LONG 0x2b8 (%itemslots% - 0x10)

END

READ_LONG 0x2bc itemoff

PATCH_IF (%itemoff% >= %memoff%) BEGIN

WRITE_LONG 0x2bc (%itemoff% - 0x10)

END

READ_LONG 0x2c4 fxoff

PATCH_IF (%fxoff% >= %memoff%) BEGIN

WRITE_LONG 0x2c4 (%fxoff% - 0x10)

END

END

BUT_ONLY_IF_IT_CHANGES

 

// add in spells and items

// PATCH_IF (~%SOURCE_RES%~ STRING_EQUAL_CASE ~khalid.cre~) BEGIN

COPY_EXISTING ~khalid.cre~ ~override~

WRITE_LONG 0x18 4888 // raise XP

WRITE_SHORT 0x24 8 // current hp

WRITE_SHORT 0x26 8 // max hp

WRITE_BYTE 0x52 19 // lower thac0

WRITE_BYTE 0x66 3 // lower lore

WRITE_BYTE 0x234 2 // 1st class level

WRITE_BYTE 0x235 1 // 2nd class level

ADD_KNOWN_SPELL ~SPWI114~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI116~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI108~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI112~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI119~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI110~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI102~ #0 ~wizard~

ADD_MEMORIZED_SPELL ~SPWI102~ #0 ~wizard~ (1)

// END ELSE PATCH_IF (~%SOURCE_RES%~ STRING_EQUAL_CASE ~khalid2.cre~) THEN BEGIN

COPY_EXISTING ~khalid2.cre~ ~override~

WRITE_LONG 0x18 9944 // raise XP

WRITE_SHORT 0x24 12 // current hp

WRITE_SHORT 0x26 12 // max hp

WRITE_BYTE 0x52 18 // lower thac0

WRITE_BYTE 0x54 13 // improve save (khalid2)

WRITE_BYTE 0x66 6 // lower lore

WRITE_BYTE 0x72 1 // raise blunt prof (khalid2, 4, 6)

WRITE_BYTE 0x234 3 // 1st class level

WRITE_BYTE 0x235 2 // 2nd class level

ADD_CRE_ITEM ~brac03~ #0 #0 #0 ~IDENTIFIED~ ~GLOVES~

ADD_KNOWN_SPELL ~SPWI114~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI116~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI108~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI112~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI119~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI110~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI102~ #0 ~wizard~

ADD_MEMORIZED_SPELL ~SPWI102~ #0 ~wizard~ (1)

ADD_MEMORIZED_SPELL ~SPWI112~ #0 ~wizard~ (1)

// END ELSE PATCH_IF (~%SOURCE_RES%~ STRING_EQUAL_CASE ~khalid4.cre~) THEN BEGIN

COPY_EXISTING ~khalid4.cre~ ~override~

WRITE_LONG 0x18 18822 // raise XP

WRITE_SHORT 0x24 14 // current hp

WRITE_SHORT 0x26 14 // max hp

WRITE_BYTE 0x66 9 // lower lore

WRITE_BYTE 0x6e 2 // lower large sword prof (khalid4, 6)

WRITE_BYTE 0x72 1 // raise blunt prof (khalid2, 4, 6)

WRITE_BYTE 0x234 4 // 1st class level

WRITE_BYTE 0x235 3 // 2nd class level

ADD_CRE_ITEM ~brac03~ #0 #0 #0 ~IDENTIFIED~ ~GLOVES~

ADD_CRE_ITEM ~clck14~ #0 #0 #0 ~IDENTIFIED~ ~CLOAK~

ADD_KNOWN_SPELL ~SPWI114~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI116~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI108~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI112~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI119~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI110~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI102~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI212~ #0 ~wizard~

ADD_MEMORIZED_SPELL ~SPWI102~ #0 ~wizard~ (1)

ADD_MEMORIZED_SPELL ~SPWI112~ #0 ~wizard~ (1)

ADD_MEMORIZED_SPELL ~SPWI212~ #1 ~wizard~ (1)

// END ELSE PATCH_IF (~%SOURCE_RES%~ STRING_EQUAL_CASE ~khalid6.cre~) THEN BEGIN

COPY_EXISTING ~khalid6.cre~ ~override~

WRITE_LONG 0x18 43588 // raise XP

WRITE_SHORT 0x24 20 // current hp

WRITE_SHORT 0x26 20 // max hp

WRITE_BYTE 0x52 16 // lower thac0

WRITE_BYTE 0x66 15 // lower lore

WRITE_BYTE 0x6e 2 // lower large sword prof (khalid4, 6)

WRITE_BYTE 0x72 1 // raise blunt prof (khalid2, 4, 6)

WRITE_BYTE 0x234 5 // 1st class level

WRITE_BYTE 0x235 5 // 2nd class level

ADD_CRE_ITEM ~ring06~ #0 #0 #0 ~IDENTIFIED~ ~LRING~

ADD_CRE_ITEM ~brac03~ #0 #0 #0 ~IDENTIFIED~ ~GLOVES~

ADD_CRE_ITEM ~clck14~ #0 #0 #0 ~IDENTIFIED~ ~CLOAK~

ADD_KNOWN_SPELL ~SPWI114~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI116~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI108~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI112~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI119~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI110~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI102~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI212~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI213~ #0 ~wizard~

ADD_KNOWN_SPELL ~SPWI303~ #0 ~wizard~

ADD_MEMORIZED_SPELL ~SPWI102~ #0 ~wizard~ (1)

ADD_MEMORIZED_SPELL ~SPWI112~ #0 ~wizard~ (3)

ADD_MEMORIZED_SPELL ~SPWI212~ #1 ~wizard~ (1)

ADD_MEMORIZED_SPELL ~SPWI213~ #1 ~wizard~ (1)

ADD_MEMORIZED_SPELL ~SPWI303~ #2 ~wizard~ (1)

// END

I removed the code in bold italics and it got rid of the CTD at the FAI. My problem now is that Khalid loses everything not ADD_CRE_ITEM. Any ideas what's wrong? Getting late, so I'm quitting for now.

 

@plainab: Looks like some items can be readied/worn/used even if unidentified.

Yeah, only player characters can't use unidentified items. How else would the player pick up an unidentified item from some thug they killed?
Link to comment

Thanks, plainab. I'll check it out tonight. I viewed the .cre in NI, and they have the proper items in the proper place, so why they get replaced with gold (1-8gp per item) is curious. The gold a minor nuisance, but being without weapons... :)

Link to comment
Thanks, plainab. I'll check it out tonight. I viewed the .cre in NI, and they have the proper items in the proper place, so why they get replaced with gold (1-8gp per item) is curious. The gold a minor nuisance, but being without weapons... :)
That's weird....
Link to comment

Sorry, but your modification didn't work, plainab. I took another look at the .cre files in NI. I was wrong. Strange things were happening with the inventory. Lots of "none" and "##.itm" thingies. I did find a way to make things work, however.

 

// this file does nothing, it just allows other mods to detect this component
COPY_EXISTING ~khalid.cre~ ~override/cdb04060.g3~

COPY_EXISTING ~khalid.cre~ ~override~
             ~khalid2.cre~ ~override~
             ~khalid4.cre~ ~override~
             ~khalid6.cre~ ~override~
PATCH_IF (%SOURCE_SIZE% > 724) BEGIN //ensure file is at least header size
 WRITE_BYTE 0x70 2    // raise longbow prof
 WRITE_BYTE 0x74 0    // remove axe prof
 WRITE_BYTE 0x236 0   // remove 3rd class level
 WRITE_BYTE 0x23a 15  // increase intelligence
 WRITE_BYTE 0x273 7   // change class to fighter/mage
[i][b]// removed the item changes from here, this was part of the problem[/b][/i]
READ_LONG 0x2a8 memoff
READ_LONG 0x2ac memnum
FOR (x=0;x<%memnum%;x+=1) BEGIN
 READ_SHORT (%memoff% + (0x10 * %x%) + 0x0) level
 READ_SHORT (%memoff% + (0x10 * %x%) + 0x6) type
 PATCH_IF ((%level% = 0) AND (%type% = 1)) BEGIN //add info to have a mem spell slot available
   WRITE_SHORT (%memoff% + (0x10 * %x%) + 0x2) 1
   WRITE_SHORT (%memoff% + (0x10 * %x%) + 0x4) 1
 END
 [i][b]// removed this bad block of code that caused the CTD at the FAI[/b][/i]
END

READ_LONG 0x2b0 memspellsoff
 PATCH_IF (%memspellsoff% >= %memoff%) BEGIN
   WRITE_LONG 0x2b0 (%memspellsoff% - 0x10)
 END
READ_LONG 0x2b8 itemslots
 PATCH_IF (%itemslots% >= %memoff%) BEGIN
   WRITE_LONG 0x2b8 (%itemslots% - 0x10)
 END
READ_LONG 0x2bc itemoff
 PATCH_IF (%itemoff% >= %memoff%) BEGIN
   WRITE_LONG 0x2bc (%itemoff% - 0x10)
 END
READ_LONG 0x2c4 fxoff
 PATCH_IF (%fxoff% >= %memoff%) BEGIN
   WRITE_LONG 0x2c4 (%fxoff% - 0x10)
 END
END
BUT_ONLY_IF_IT_CHANGES

// add in spells and items
COPY_EXISTING ~khalid.cre~ ~override~
 WRITE_LONG 0x18 4888  // raise XP
 WRITE_SHORT 0x24 8    // current hp
 WRITE_SHORT 0x26 8    // max hp
 WRITE_BYTE 0x52 19    // lower thac0
 WRITE_BYTE 0x66 3     // lower lore
 WRITE_BYTE 0x234 2    // 1st class level
 WRITE_BYTE 0x235 1    // 2nd class level
[i][b] // had to add items individually, like spells, for each .cre
 REMOVE_CRE_ITEMS
 ADD_CRE_ITEM ~helm01~ #1  #0 #0 ~IDENTIFIED~ ~HELMET~
 ADD_CRE_ITEM ~sw1h01~ #1  #0 #0 ~IDENTIFIED~ ~WEAPON1~
 ADD_CRE_ITEM ~bow03~  #1  #0 #0 ~IDENTIFIED~ ~WEAPON2~ EQUIP TWOHANDED
 ADD_CRE_ITEM ~arow01~ #40 #0 #0 ~IDENTIFIED~ ~QUIVER1~
 ADD_CRE_ITEM ~potn08~ #1  #0 #0 ~IDENTIFIED~ ~QITEM1~[/b][/i]
 ADD_KNOWN_SPELL ~SPWI114~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI116~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI108~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI112~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI119~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI110~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI102~ #0 ~wizard~
 ADD_MEMORIZED_SPELL ~SPWI102~ #0 ~wizard~ (1)
COPY_EXISTING ~khalid2.cre~ ~override~
 WRITE_LONG 0x18 9944  // raise XP
 WRITE_SHORT 0x24 12   // current hp
 WRITE_SHORT 0x26 12   // max hp
 WRITE_BYTE 0x52 18    // lower thac0
 WRITE_BYTE 0x54 13    // improve save (khalid2)
 WRITE_BYTE 0x66 6     // lower lore
 WRITE_BYTE 0x72 1     // raise blunt prof (khalid2, 4, 6)
 WRITE_BYTE 0x234 3    // 1st class level
 WRITE_BYTE 0x235 2    // 2nd class level
[i][b]  REMOVE_CRE_ITEMS
 ADD_CRE_ITEM ~helm01~ #1  #0 #0 ~IDENTIFIED~ ~HELMET~
 ADD_CRE_ITEM ~sw1h01~ #1  #0 #0 ~IDENTIFIED~ ~WEAPON1~
 ADD_CRE_ITEM ~bow03~  #1  #0 #0 ~IDENTIFIED~ ~WEAPON2~ EQUIP TWOHANDED
 ADD_CRE_ITEM ~arow01~ #40 #0 #0 ~IDENTIFIED~ ~QUIVER1~
 ADD_CRE_ITEM ~potn08~ #1  #0 #0 ~IDENTIFIED~ ~QITEM1~
 ADD_CRE_ITEM ~brac03~ #0  #0 #0 ~IDENTIFIED~ ~GLOVES~[/b][/i]
 ADD_KNOWN_SPELL ~SPWI114~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI116~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI108~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI112~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI119~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI110~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI102~ #0 ~wizard~
 ADD_MEMORIZED_SPELL ~SPWI102~ #0 ~wizard~ (1)
 ADD_MEMORIZED_SPELL ~SPWI112~ #0 ~wizard~ (1)
COPY_EXISTING ~khalid4.cre~ ~override~
 WRITE_LONG 0x18 18822 // raise XP
 WRITE_SHORT 0x24 14   // current hp
 WRITE_SHORT 0x26 14   // max hp
 WRITE_BYTE 0x66 9     // lower lore
 WRITE_BYTE 0x6e 2     // lower large sword prof (khalid4, 6)
 WRITE_BYTE 0x72 1     // raise blunt prof (khalid2, 4, 6)
 WRITE_BYTE 0x234 4    // 1st class level
 WRITE_BYTE 0x235 3    // 2nd class level
[i][b]  REMOVE_CRE_ITEMS
 ADD_CRE_ITEM ~helm01~ #1  #0 #0 ~IDENTIFIED~ ~HELMET~
 ADD_CRE_ITEM ~sw1h01~ #1  #0 #0 ~IDENTIFIED~ ~WEAPON1~
 ADD_CRE_ITEM ~bow03~  #1  #0 #0 ~IDENTIFIED~ ~WEAPON2~ EQUIP TWOHANDED
 ADD_CRE_ITEM ~arow01~ #40 #0 #0 ~IDENTIFIED~ ~QUIVER1~
 ADD_CRE_ITEM ~potn08~ #1  #0 #0 ~IDENTIFIED~ ~QITEM1~
 ADD_CRE_ITEM ~brac03~ #0  #0 #0 ~IDENTIFIED~ ~GLOVES~
 ADD_CRE_ITEM ~clck14~ #0  #0 #0 ~IDENTIFIED~ ~CLOAK~[/b][/i]
 ADD_KNOWN_SPELL ~SPWI114~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI116~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI108~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI112~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI119~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI110~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI102~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI212~ #0 ~wizard~
 ADD_MEMORIZED_SPELL ~SPWI102~ #0 ~wizard~ (1)
 ADD_MEMORIZED_SPELL ~SPWI112~ #0 ~wizard~ (1)
 ADD_MEMORIZED_SPELL ~SPWI212~ #1 ~wizard~ (1)
COPY_EXISTING ~khalid6.cre~ ~override~
 WRITE_LONG 0x18 43588 // raise XP
 WRITE_SHORT 0x24 20   // current hp
 WRITE_SHORT 0x26 20   // max hp
 WRITE_BYTE 0x52 16    // lower thac0
 WRITE_BYTE 0x66 15    // lower lore
 WRITE_BYTE 0x6e 2     // lower large sword prof (khalid4, 6)
 WRITE_BYTE 0x72 1     // raise blunt prof (khalid2, 4, 6)
 WRITE_BYTE 0x234 5    // 1st class level
 WRITE_BYTE 0x235 5    // 2nd class level
[i][b]  REMOVE_CRE_ITEMS
 ADD_CRE_ITEM ~helm01~ #1  #0 #0 ~IDENTIFIED~ ~HELMET~
 ADD_CRE_ITEM ~sw1h01~ #1  #0 #0 ~IDENTIFIED~ ~WEAPON1~
 ADD_CRE_ITEM ~bow03~  #1  #0 #0 ~IDENTIFIED~ ~WEAPON2~ EQUIP TWOHANDED
 ADD_CRE_ITEM ~arow01~ #40 #0 #0 ~IDENTIFIED~ ~QUIVER1~
 ADD_CRE_ITEM ~potn08~ #1  #0 #0 ~IDENTIFIED~ ~QITEM1~
 ADD_CRE_ITEM ~ring06~ #0  #0 #0 ~IDENTIFIED~ ~LRING~
 ADD_CRE_ITEM ~brac03~ #0  #0 #0 ~IDENTIFIED~ ~GLOVES~
 ADD_CRE_ITEM ~clck14~ #0  #0 #0 ~IDENTIFIED~ ~CLOAK~[/b][/i]
 ADD_KNOWN_SPELL ~SPWI114~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI116~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI108~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI112~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI119~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI110~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI102~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI212~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI213~ #0 ~wizard~
 ADD_KNOWN_SPELL ~SPWI303~ #0 ~wizard~
 ADD_MEMORIZED_SPELL ~SPWI102~ #0 ~wizard~ (1)
 ADD_MEMORIZED_SPELL ~SPWI112~ #0 ~wizard~ (3)
 ADD_MEMORIZED_SPELL ~SPWI212~ #1 ~wizard~ (1)
 ADD_MEMORIZED_SPELL ~SPWI213~ #1 ~wizard~ (1)
 ADD_MEMORIZED_SPELL ~SPWI303~ #2 ~wizard~ (1)

It may not be as clean as was originally intended, but it works now. All items are in their place, and no gold floating around his inventory. :)

 

Now all I need to do is replace his biography (offset 1cc) with what is in the Setup.tra, @406001.

Link to comment
Oh, the tweak pack seemed to install okay. But we need to put in checks or rearrange things because it's possible to install gems and potions require lore and then have all items identified. The second makes the first useless so we either put in a check OR we combine the two into subcomponents of the same component.
If you want to do this and get me a revised version, I'll host that instead. Like I said, I'm a bit busy to do a lot of testing, but hosting isn't a problem. And add Icen's code if you want, though it'd help if someone actually tested that (preferably whoever coded it :laugh:).

@ Miloch - Looks like I've completed this thing now, the Khalid tweak included. I've e-mailed you the most current package, cleaned of all unnecessary codes and files. If you're still willing to host it, this is the Beta that should be available for download. It would be appreciated. Now to talk to whoever here to make it available at G3...

 

List of Tweaks:

Cosmetic Changes

Remove Helmet Animations

Weapon Animation Tweaks

Icewind Dale Casting Graphics

Disable Portrait Icons Added by Equipped Items

Icon Improvements

Force All Dialogue to Pause

Content Changes

Make Cloakwood Areas Available Before Completing the Bandit Camp

Multi-Player Kick-Out Dialogs

Reveal City Maps

Stores Sell Larger Stacks of Items

Gems and Potions Require Identification (will be skipped if “Identify All Items†component is already installed)

Friendly Arm Inn Hidden Container Restoration (Ascension64) (for BG1 without Tales of the Sword Coast installed)

Rule Changes

Two-Handed Bastard Swords

Universal Clubs

Description Updates for Universal Clubs Component (Requires Universal Clubs)

Change Experience Point Cap

Allow Stealth and Thieving Abilities in Heavy Armor per P&P

Allow Arcane Spellcasting in Armor

Wear Multiple Protection Items

Shopkeepers Have Limited Identification Ability (untested) (will be skipped if “Identify All Items†component is already installed)

Multi-Class Grand Mastery

Baldur's Gate II Grand Mastery

Change Magically Created Weapons to Zero Weight

Un-Nerfed THAC0 Table

Alter Mage Spell Progression Table

Alter Bard Spell Progression Table

Alter Cleric Spell Progression Table

Druids Use Cleric Level and Spell Progression

Paladins and Rangers Use IWD-HoW Spell Progression

Druids Use 3e Alignment Restrictions

Loosen Item Restrictions for Multi- and Dual-Class Clerics and Druids

Add Save Penalties for Spells Cast by High-Level Casters (untested)

Convenience Tweaks and/or Cheats

Higher HP on Level Up

Maximum HP Creatures

Identify All Items (will be skipped if “Gems and Potions Require Identification†or "Shopkeepers Have Limited Identification Ability" components already installed)

Easy Spell Learning

Shut Up “You must gather your party...â€Â

Change Effect of Reputation on Store Prices

Unlimited Ammo Stacks

Unlimited Jewelry and Gem Stacks

Unlimited Potion Stacks

Unlimited Scroll Stacks

Happy Patch

Neutral Characters Make Happy Comments at Mid-Range Reputation

No Traps or Locks

Rest Anywhere

Sellable Items

Minimum Stats Cheat

Joinable NPC Tweaks

Adjust Evil Joinable NPC Reactions (untested)

Give Edwin His BG2 Stats

Give Jaheira His BG2 Stats

Change Jaheira to Neutral Good Alignment

Give Minsc His BG2 Stats

Give Viconia Her BG2 Stats

Make Khalid a Fighter-Mage (plainab/grogerson)

Give Kagain a Legal Constitution Score of 19

Link to comment

Do you want this? If not, there are other tweak packs I can offer it to...

It was a request in the BG Fixpack workroom, however I do too much to qualify it as a fix. It makes changes that could cause conflict with mods that might depend upon default methods.

 

Problem: Vanilla bandit scalps can be placed in the quick item slot.

Tests have shown that:

it is an issue with vanilla

not an issue with saga

we do not know about vanilla + totsc

 

By dropping the ability header I can remove them from quick slot usage, however they can not be stacked (they may stack, if the stack amount is greater than 1, but there is no way to know how many you have).

 

By trying to change the use location and attack type of the ability header, I am unable to prevent the quick slot usage. I believe that item type 0x00 book/misc is hard coded to allow quick slot usage. Why? All items of that type which do not allow quick slot usage do not stack and have no ability header. Everything else of that item type can be placed in the quick slots.

 

So problem is solved by changing the item type from 0x00 to 0x3b furs/pelts, but then Officer Vai's store has to be changed to accept the new item type and in case Officer Vai has left, Feldposts' Inn needs to be adjusted as well.

 

You can see where this might be considered too much of a tweak, than a fix. Also, there is no harm in the scalps being able to be placed in the quick item slot. I actually take advantage of it some times.

 

Tests also show that this code does work in vanilla and in saga...

Here is the code:

//this was a request. It's a tweak, but it still needs to be checked.  Will probably pass it on to bg1tweaks by grogerson
//vanilla issue only.
BEGIN ~Remove Quick Slot Usage from Bandit Scalps~
COPY_EXISTING ~misc86.itm~ ~override~ //Bandit Scalp
PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN
 WRITE_SHORT 0x1c 0x003b //Fur/pelt and now bandit scalp
END
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~stovai.sto~ ~override~
				 ~inn3351.sto~ ~override~
PATCH_IF (%SOURCE_SIZE% > 156) BEGIN
 READ_LONG 0x2c itmpuroff
 READ_LONG 0x30 itmpurnum
 SET change=0
 FOR (x=0;x<%itmpurnum%;x+=1) BEGIN
  READ_LONG (%itmpuroff% + (%x% * 4)) itmtype
  PATCH_IF (%itmtype% = 0x3b) BEGIN
SET change=1
  END
 END
 PATCH_IF (%change% !=1) BEGIN
  INSERT_BYTES (%itmpuroff% + (%itmpurnum% * 4)) 4
  WRITE_LONG (%itmpuroff% + (%itmpurnum% * 4)) 0x3b //furs/pets
  WRITE_LONG 0x30 (%itmpurnum% + 1)
  READ_LONG 0x34 itmsaleoff
  READ_LONG 0x4c drinksoff
  READ_LONG 0x70 curesoff
  PATCH_IF (%itmsaleoff% > %itmpuroff%) BEGIN
WRITE_LONG 0x34 (%itmsaleoff% + 4)
  END
  PATCH_IF (%drinksoff% > %itmpuroff%) BEGIN
WRITE_LONG 0x4c (%drinksoff% + 4)
  END
  PATCH_IF (%curesoff% > %itmpuroff%) BEGIN
WRITE_LONG 0x70 (%curesoff% + 4)
  END
 END
END
BUT_ONLY_IF_IT_CHANGES

 

EDIT: Seems I forgot what my saga tester had to say...

Remove Quick Slot Usage from Bandit Scalps

Couldn't test. Seems to be a Vanilla problem only...

 

Officer Vai Fix

Couldn't test. Seems to be a Vanilla problem only... However your fix description is exactly how it works in totsc.

Link to comment
Afraid you'll have to go in to more detail on this, plainab. Are you saying that bandit scalps can be placed in the quick item slots? That's a new one on me...

 

Edit: Maybe the pack at CoM might take it in...

In the vanilla version of BG1 the bandit scalps can be placed into the quick item slots. According to my Original Saga tester (for the fixpack) the bandit scalps can not go into the quick item slots.

 

That's all there really is to say... I've got no problem with the current behavior for the vanilla version. It causes no issues in game, so it's not broken. It's just an odd behavior that one person wanted to see modified...

 

I will check with the tweak pack over at CoM. I was going to check with them, if you didn't want it. I can understand not wanting to use it. It doesn't affect all versions of the game, makes it hard to test and maintain...

Link to comment

Archived

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

×
×
  • Create New...