Jump to content

BG1 Tweak Pack


Guest grogerson

Recommended Posts

I have a question: Will the tweakpack assign override scripts to the BioWare NPCs that have so far none? I am asking because I would like to know what would be the "standard" names for these scripts, if assigned by a mod (and hopefully all mods using the same names). As far as I know, the following NPCs do not have override scripts: Alora, Branwen, Faldorn, Garrick, Imoen, Skie and Xan.

Alora and Imoen already have scripts alora.bcs and imoen.bcs, although not as override scripts. Would it be save to assume that the script names for Branwen, Faldorn, Garrick, Skie and Xan would be Branwen.bcs, Faldorn.bcs, Garrick.bcs, Skie.bcs and Xan.bcs? What would be the approriate names for override scripts for Imoen and Alora?

That was three questions, actually. :)

My familiarity with coding is weak, to say the least. The only component which might would be the Make Khalid a Fighter-Mage, though I don't believe it does. And coding for this component needs Cam's gentle touch to work. Its beyond me.

 

I am a bit confused here: I distinctly remember you testing Xan friendship for BG1 for me(and, yes, I see you in the list of playtesters), because I was very happy to have people test things on BG1 install, and it worked. But I was EXTEND-ing a script already: xan.bcs.

 

EXTEND_TOP ~xan.bcs~ ~XanBG1Friend/Scripts/xan.baf~

 

So Xan must already have a script, right? Otherwise Xan's friendship for straight BG1(not Tutu/BGT) wouldn't work. I'm a little confused here.

The only component that does anything with scripts is the Happy Patch, and that does EXTEND_TOP to the .baf files of only those NPC's that would otherwise turn on each other. Our depressed and depressing mage is protected in this regard.

Link to comment

I rechecked: The NPCs, that do not have any script assigned that has their name, are Imoen, Garrick, Skie, Branwen, Xan, (EDIT: forgot Faldorn, end EDIT) and for all, the override script slot is empty.

Kulyok: I am not surprised that I (a playtester) don't know Xan's code, but I would expect the modder to know that Xan's friendship mod patches xan.cres for BG1 (wink grin smiley):

(taken from the xan friendship tp2)

COPY_EXISTING ~XAN.CRE~ ~override~

~XAN4.CRE~ ~override~

~XAN6.CRE~ ~override~

WRITE_EVALUATED_ASCII 0x248 ~Xan~ #8

BUT_ONLY_IF_IT_CHANGES

 

EXTEND_TOP ~xan.bcs~ ~XanBG1Friend/Scripts/xanbg.baf~

 

grogerson: My actual question was, whether the tweak pack feels like introducing a component that patches the NPC cres with their override scripts, but it seems that it doesn't. It would have been a tweak for modders, not players, so to say, and, since tweak pack assumingly is to be installed last, my question was totally uaseless. :)

 

Sorry about the confusion..

Link to comment
I rechecked: The NPCs, that do not have any script assigned that has their name, are Imoen, Garrick, Skie, Branwen, Xan, (EDIT: forgot Faldorn, end EDIT) and for all, the override script slot is empty.

Something for the BG Fixpack, definitely.

Link to comment

Cam:

 

Been looking over the Make Khalid a Fighter-Mage files again. This time I moved from the setup-bg1tweaks.tp2 and onto the .cre files. P#Khali1.cre listed Tutu items rather than BG1 items, and one spell (SPWI120 - reflected image) referencing a BG2 file. These fixed (SPWI120 replaced with SPWI212), it still failed to install. Further looking showed four Effects without references.

 

Effect 233 is Modify Proficiency in BG2. No such Effect exists in BG1. Could this be the problem?

Link to comment

I would suggest a redoing of the BG2 Tweaks .cres using a vanilla BG1 .cre, and dropping the effects checking for walking speeds (unless walking speeds is going to be included, which doesn't make any sense :) )

 

I will go poke around for BG ./cre references to soundset, but basically,

 

COPY_EXISTING ~KHALID2.cre~ ~override/NewFlagName.g3~
// READ_ASCII 0xa4 "soundset" (396) // copies existing soundset // looking it up

COPY ~BG2_Tweaks/cre/g#khali1.cre~ ~override/khalid.cre~
~BG2_Tweaks/cre/g#khali2.cre~ ~override/khalid2.cre~
~BG2_Tweaks/cre/g#khali3.cre~ ~override/khalid4.cre~
~BG2_Tweaks/cre/g#khali4.cre~ ~override/khalid6.cre~
SAY NAME1 <<BG strref>> //need
SAY NAME2 <<BG strref>> //need
// WRITE_EVALUATED_ASCII 0xa4 "%soundset%" #396 // looking it up
SAY BIO <<BG strref>>
WRITE_ASCII 0x280 ~khalid~   // death variable
WRITE_ASCII 0x248 ~khalid~  // override script
WRITE_ASCII 0x250 ~shout~   // class script
WRITE_ASCII 0x260 ~wtasight~ // general script
WRITE_ASCII 0x268 ~dplayer~ // default script
WRITE_ASCII 0x2cc ~khalid~  // dialogue file
ADD_CRE_ITEM ~bow03~  #0  #0 #0 ~IDENTIFIED~ ~WEAPON2~ EQUIP TWOHANDED
ADD_CRE_ITEM ~arow01~ #40 #0 #0 ~IDENTIFIED~ ~QUIVER2~
ADD_CRE_ITEM ~helm01~ #0  #0 #0 ~IDENTIFIED~ ~HELMET~
ADD_CRE_ITEM ~sw1h01~ #0  #0 #0 ~IDENTIFIED~ ~INV5~
ADD_CRE_ITEM ~potn08~ #0  #0 #0 ~IDENTIFIED~ ~QITEM1~
 PATCH_IF (~%DEST_RES%~ STRING_EQUAL ~khalid6~) THEN BEGIN
	  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~
 END ELSE PATCH_IF (~%DEST_RES%~ STRING_EQUAL ~khalid4~) THEN BEGIN
	  ADD_CRE_ITEM ~brac03~ #0 #0 #0 ~IDENTIFIED~ ~GLOVES~
	  ADD_CRE_ITEM ~clck14~ #0 #0 #0 ~IDENTIFIED~ ~CLOAK~   
 END ELSE PATCH_IF (~%DEST_RES%~ STRING_EQUAL ~khalid2~) THEN BEGIN
	  ADD_CRE_ITEM ~brac03~ #0 #0 #0 ~IDENTIFIED~ ~GLOVES~ 
 END

 

For the spells, do the ADD_MEMORIZED_SPELL the same way, I think...

Link to comment

Thanks, cmorgan. I presume I make a copy of the Khalid#.cre files in a separate directory and modify them?

 

I've looked over Domi's and Dudleyville's versions, so I see XP, GP, HP, classes, levels and spells known are handled in the revised .cre's. Equipment and memorization is done by the .tp2. Since Effect (233) Modify Proficiencies doesn't exist in BG1, will it also need to be set in the .cre's?

Link to comment
Thanks, cmorgan. I presume I make a copy of the Khalid#.cre files in a separate directory and modify them?

 

I've looked over Domi's and Dudleyville's versions, so I see XP, GP, HP, classes, levels and spells known are handled in the revised .cre's. Equipment and memorization is done by the .tp2. Since Effect (233) Modify Proficiencies doesn't exist in BG1, will it also need to be set in the .cre's?

All of it could be done in the tp2 if you really wished it to be (but it'll be easiest to follow the method already in place).

Also, since effect #233 doesn't exist in bg1 it can't be used at all. There might be another way around it, but I'm not sure.

 

I'm feeling a little saucy at the moment. I think I'll take a look at this and see what I can come up with....

 

EDIT:

Okay, after a quick look: Effect #233 is for weapon proficiencies in the bg2 engine. For bg1 these are done within the cre file. Looking only at p#khali1.cre in the tweak pack and khalid.cre in bg1 here are the changes to make:

 

For 1st effect: Long Bow 104 set to 2

Change offset: 0x0070 from 1 to 2

 

For 2nd effect: Axe 92 set to 0

Change offset: 0x0074 from 1 to 0

 

For 3rd effect: Long Sword 90 set to 0

For 4th effect: Bastard Sword 89 set to 2

Leave offset 0x006e alone at a value of 2

 

Hope that helps ya out. Should be enough to give you an idea on what to do for the other versions of khalid.

Link to comment

Thanks, plainab. It looks like I've a problem before that, though.

 

ERROR: illegal 4045-byte read from offset 164 of 1216-byte file khalid2.cre

 

Offset 164 is in the dialogs. Looking at it leads me to some questions. In Domi's versions all the dialogs say "No such index" with Stringrefs starting at 88244. Offset 164 has a stringref of 2147483647. Is this because of BGT references, and do I need to change them. Or do I go back to my previous post - make copies of the BG1 Khalid .cre's to straighten this out?

 

And now I'm becoming nervous about the functionality/necessity of the p#khalid.d and p#khalid.tra files.

 

Help would be appreciated greatly... :)

Link to comment
Thanks, plainab. It looks like I've a problem before that, though.

 

ERROR: illegal 4045-byte read from offset 164 of 1216-byte file khalid2.cre

 

Offset 164 is in the dialogs. Looking at it leads me to some questions. In Domi's versions all the dialogs say "No such index" with Stringrefs starting at 88244. Offset 164 has a stringref of 2147483647. Is this because of BGT references, and do I need to change them. Or do I go back to my previous post - make copies of the BG1 Khalid .cre's to straighten this out?

 

And now I'm becoming nervous about the functionality/necessity of the p#khalid.d and p#khalid.tra files.

 

Help would be appreciated greatly... :)

Since the bg2tweaks modifies their own new files, I'll have to install that component on either bg2 or tutu and then compare the finalized khalid f/m files to the bg1 files.

 

I'll see what I can do....

Link to comment

Okay, I looked into making khalid a fighter/mage.

 

Note that this code does not do anything with soundsets as those sounds that can be played in bg1 are already setup and identical to what was in the bg2/tutu tweaks file. Also note, that khalid's inventory is modified during tutu installation and so bg2/tutu tweaks used that as a base. I instead used khalid's bg1 inventory as a base and worked around them...

 

This should give you something to start with for the other versions of the cre file. The file opens fine in NI and DLTCEP without errors but I've not tested it in game.

 

Here is the code:

BEGIN ~Make Khalid A Fighter Mage~
COPY_EXISTING ~khalid.cre~ ~override~
PATCH_IF (%SOURCE_SIZE% > 724) BEGIN //ensure file is at least header size
 WRITE_LONG 0x10 0	//wipe out all class flags
 WRITE_LONG 0x18 4888 //raise XP
 WRITE_LONG 0x1c 0	//remove gold
 WRITE_SHORT 0x24 8   //current hp
 WRITE_SHORT 0x26 8   //max hp
 WRITE_BYTE 0x2c 30   //change metal color
 WRITE_BYTE 0x2d 47   //change minor color
 WRITE_BYTE 0x2e 49   //change major color
 WRITE_BYTE 0x30 23   //change leather color
 WRITE_BYTE 0x32 0	//change hair color
 WRITE_BYTE 0x44 110  //add reputation value
 WRITE_BYTE 0x52 19   //lower thac0
 WRITE_BYTE 0x66 3	//lower lore
 WRITE_BYTE 0x70 2	//raise longbow prof
 WRITE_BYTE 0x74 0	//remove axe prof
 WRITE_BYTE 0x234 2   //1st class level
 WRITE_BYTE 0x235 1   //2nd class level
 WRITE_BYTE 0x236 0   //remove 3rd class level
 WRITE_BYTE 0x23a 15  //increase intelligence
 WRITE_BYTE 0x242 1   //change moral recovery
 WRITE_BYTE 0x273 7   //change class to fighter/mage
 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
  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
 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~
ADD_KNOWN_SPELL ~SPWI114~ #0 ~wizard~
ADD_KNOWN_SPELL ~SPWI120~ #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~
//I'm not going to do what original bg2tweaks did.
//I'm replacing existing longsword with bastard sword and adding
//the bow and arrows that bg2tweaks did.
//However, I'm leaving the helmet, potion, splint mail and medium shield alone
//Tutu changes Khalid's item inventory from that of BG1
REPLACE_CRE_ITEM ~bow03~ #0 #0 #0 ~IDENTIFIED~ ~WEAPON2~
REPLACE_CRE_ITEM ~arow01~ #0 #0 #0 ~IDENTIFIED~ ~QUIVER1~
REPLACE_CRE_ITEM ~sw1h01~ #0 #0 #0 ~IDENTIFIED~ ~WEAPON1~ EQUIP
BUT_ONLY_IF_IT_CHANGES

Link to comment

Thanks for the help, plainab. I've got a nearly working tweak for Khalid now. Two problems remain, however, and I'm studying your code for one of them.

 

There are four Khalid .cre's, you gave for only the first (Khalid.cre, not Khalid2.cre).

 

First, for the other .cre's I've yet to work out setting the memorizable spell slots and the spells memorized (ADD_MEMORIZED_SPELL ...).

 

Second, it's necessary to remove items from the .cre before adding them. REPLACE doesn't appear to be working. Do I need to REMOVE or DESTROY the items, and how do I do it?

 

This is working without copying any files from the tweak package, so far...

Link to comment

Archived

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

×
×
  • Create New...