Jump to content

Let's put the Black Pits 1 into BGEE!


Recommended Posts

Rather than actually editing the dialog files, I suggest just cloning them and swapping the creatures' dialog files by script. I think this function should do it (tested, but not very extensively):

/*
Edits one of the BP storekeepers so that on BP-in-BG they use a new dialog file that 
references the new stores.
*/

DEFINE_ACTION_FUNCTION clone_bp_store
	STR_VAR cre=""
			new_dlg=""
			old1=""
			old2=""
			old3=""
			new1=""
			new2=""
			new3=""
BEGIN

// define the script extension
<<<<<<<<.../bpinbg-inline/script_add.baf
IF
	Global("dw-swapped-dialog","LOCALS",0)
	Global("bp-in-bg","GLOBAL",1) // set to whatever global variable controls which version we're in
	Name("%name%",Myself)
THEN
	RESPONSE #100
		SetGlobal("dw-swapped-dialog","LOCALS",1)
		SetDialog("%new_dlg%")
		Continue()
END
>>>>>>>>

// get the script name and old dialog
COPY_EXISTING - "%cre%.cre" nowhere
	READ_ASCII DIALOG old_dlg
	READ_ASCII DEATHVAR name (0x20) NULL

// add the script extension to the shared script 'bphuba' that all storekeeps have
EXTEND_TOP "bphuba.bcs" ".../bpinbg-inline/script_add.baf" EVALUATE_BUFFER

// make the new dialog
COPY_EXISTING "%old_dlg%.dlg" "override/%new_dlg%.dlg"
	DECOMPILE_AND_PATCH BEGIN
		REPLACE_TEXTUALLY "%old1%" "%new1%"
		REPLACE_TEXTUALLY "%old2%" "%new2%"
		REPLACE_TEXTUALLY "%old3%" "%new3%"
	END
END

 

Link to comment
Guest Graion@Work

Regarding the first question, it's a Global(X) vs a GlobalGT(X)... and the GT there means Greater Than. So 3 4 5 etc will all go GlobalGT there. That is the difference. I think your edit should work as well, but I'd doublecheck the result in NI.

Yes, the EET BG1 tlk offsets have that fixed 200000 offset and you can safely operate on that, it won't change (it's not like BGT where this is indeed dynamic).

Link to comment
1 hour ago, subtledoctor said:

Okay maybe some people with more experience can double-check what I'm doing here. In the dialogue with Bellows the gnome to open the Concocter's store (BPBELLOW.dlg), we see this:

THEN BEGIN 29 // from: 
  SAY #32142 /* ~Howdy, <CHARNAME>! What can I do ya fer?~ */
  IF ~  Global("OPENING","LOCALS",1) ~ 
  THEN REPLY #29312 /* ~I could use some more potions.~ */ DO ~StartStore("BPCONC01",LastTalkedToBy(Myself))~ 
  EXIT
  IF ~  Global("OPENING","LOCALS",2) ~ 
  THEN REPLY #29312 /* ~I could use some more potions.~ */ DO ~StartStore("BPCONC02",LastTalkedToBy(Myself))~ 
  EXIT
  IF ~  GlobalGT("OPENING","LOCALS",2) ~ 
  THEN REPLY #29312 /* ~I could use some more potions.~ */ DO ~StartStore("BPCONC03",LastTalkedToBy(Myself))~ 
  EXIT

First off, and  unimportantly, that seems wrong to me? Why are the conditions the same to open  BPCONC02.sto and BPCONC03.sto?

The check is fine. Response 2 checks for OPENING = 2. Response 3 checks for OPENING > 2.

 

1 hour ago, subtledoctor said:

Second, and more importantly, I want to add a condition to each response.

WeiDU provides a great number of functions to modify dialogs. Adding triggers to existing responses can be done with ADD_TRANS_TRIGGER.

// Adds trigger Global("MyNewTrigger","GLOBAL",0) to the three responses of state 29
ADD_TRANS_TRIGGER ~BPBELLOW~ 29 ~Global("MyNewTrigger","GLOBAL",1)~ DO 0 1 2

Put this line into your .d file and COMPILE it.

 

1 hour ago, subtledoctor said:

Also, can anyone confirm what i am seeing, that EET just adds 200,000 to every BG1/SoD .tlk strref? Can I safely operate on that assumption and just add a '2' to the beginning of the 5-digit strrefs in these .dlg files?

Correct. However, most of the time you use WeiDU's dialog functions to modify existing dialogs to avoid destructive changes.

Edited by argent77
Link to comment
1 hour ago, argent77 said:

Response 3 checks for OPENING > 2

Oops,  I didn't even notice that. So many triggers that need changing in these dialogue files, my eyes are getting bleary...

1 hour ago, argent77 said:

use WeiDU's dialog functions to modify existing dialogs to avoid destructive changes

Yeah, but that stuff is largely Greek to me, and I'll have this done far more quickly by simply [export to .d] --> [manually edit things] --> [compile .d and overwrite existing .dlg  and  tell players to install this first], versus learning all the Weidu commands to patch dialogues and then apply them with some semblance of competence. I know it's not great - I do. But honestly it might be the difference between actually making this mod, and not making this mod. :undecided:

1 hour ago, argent77 said:

Adding triggers to existing responses can be done with ADD_TRANS_TRIGGER.

I didn't phrase the question well. I only mean,

EDIT - I  see the answer now, yes dialogue responses seemingly can have multiple conditions, with triggers in the conjunctive or in the disjunctive using OR(2) like in a script.

Edited by subtledoctor
Link to comment
On 7/27/2022 at 10:32 AM, DavidW said:

Rather than actually editing the dialog files, I suggest just cloning them and swapping the creatures' dialog files by script.

Huh, that's a great idea. I didn't know you could do that - it might have saved me from manually editing 16 dialogue files that each seems to have a thousand StartStore actions :(  Perhaps in  a future version.

At any rate, I already did it the long way. It also now overwrites (sorry!) Baeloth's dialogue in SoD to prevent him from joining the party. I did not (yet?) add anything to the dialogue to reconcile the fact that Charname murdered him and they both should remember that.

I also added a little Readme! This is turning into a real thing! It is now installable on BGEE/SoD/EET, taking the party to the Black Pits and back. It alters the XP rewards, gold rewards, and store contents in each case, without changing the way the original BP standalone campaign behaves. It adds 60 level-appropriate items imported from IWDEE to the BP stores. It is, in short, installable and playable!  Call it a beta.

Not really that much left to do!

  • rebalance some fights (honestly, I think it would be enough to just replace some early creatures with other, harder creatures... swap tasloi for gnolls, gibberlings for orcs, etc.)
  • fine-tune gold rewards and item prices if necessary (I want to enable the party to  buy consumables to get through hard fights, but I don't want to enable them to Buy All The Loot)
  • deal with any consequences of party members not having the BPPLOT override script
  • improve/add to Baeloth's dialogue...?
  • change install method to patch dialogues rather than overwriting them

If anyone wants to check it out and doesn't mind the possibility of minor glitches and potential balance issues that might need adjusting... in short, if you want to play a beta... it is now in good shape to do that. In fact if someone wants to play through this and be in  touch with me about their thoughts on it, it would be really helpful. I don't want to make a proper announcement for it, even as a beta, until someone has successfully played through it.

Edited by subtledoctor
Link to comment
19 hours ago, Endarire said:

The infinite +1 ammo dispensers in vanilla seem very underpowered by the time they're available.  Everard's Sling (infinite +5 accuracy/+2 damage ammo) is available around the start of BG2, and with the vanilla BG assumption that pluses from ammo and weapons don't stack, and that +1 Shortbows & +1 Longbows are available at this point in the Pits with +1 Shortbows vanilla purchasable in Thunderhammer Smithy, letting people buy infinite +1 ammo at this point seems like a minor thing.

+1 ammo is magical. Non+1 isn't.

The difference is huge on this one, because normal weapon immunity on Vampire Wolves and the like is probably the biggest counter to the prevalent BGEE archerspam. Introducing a "fine" quiver would have had a lesser effect of balance (since they would still be nonenchanted arrows), but HQ arrows are also an IWD idea.

Link to comment
22 hours ago, subtledoctor said:

Does anyone know if there is a Weidu macro or something that makes it easy to patch numbers of items in .STO files? I only see functions for adding and removing stuff.

Searching the WeiDU documentation ... the function REPLACE_STORE_ITEM should do it. Just replace an item with itself, choosing a new number in stock and other information.

Link to comment
On 7/22/2022 at 5:40 PM, Endarire said:

Since the Sandrah Saga also includes Black Pits access through another means, should SD's BP1 in EET not install if Sandrah Saga is already installed?

Missed this. This is a bit of an issue. I have no idea how the Sandrah version of BP works. My BP_in_BG mod wants to be installed very very early; by contrast, Roxanne wants Sandrah to be installed very very late. So most compatibility issues would necessarily have to be handled in Roxanne's mod.

I will say this: BP_in_BG sets a global variable - "BPINBG" - to 1 when you teleport to the Black Pits. So Roxanne's mod could simply check for this variable, and disable her trip to the BP if it is 1 (i.e. if the party has already been there). And if Roxanne's mod has some similar variable to signify having been through BP already, I would be more than happy to use it in a check to disable the dialogue line that sends you there.

Unfortunately, Roxanne hasn't communicated with other modders in several years, so I don't expect much on the inter-mod compatibility front. Still, I'd be happy to share information with her or someone who knows how her mod works.

Link to comment

What do you mean by overwriting Baeloth's SoD dialog?  I thought people used WeiDU to alter dialog for mod compatibility.

While I know we could mind control Baeloth to have him join, what say you to allowing Baeloth to be persuaded into joining the party in SoD if the party clears the Black Pits?  Would BP be accessible in SoD if the party hasn't already done it?

Thankee!

Link to comment
On 7/27/2022 at 3:38 PM, subtledoctor said:

Also, can anyone confirm what i am seeing, that EET just adds 200,000 to every BG1/SoD .tlk strref? Can I safely operate on that assumption and just add a '2' to the beginning of the 5-digit strrefs in these .dlg files?

In case that wasn't answered: yes.

Link to comment
On 7/27/2022 at 4:32 PM, DavidW said:

Rather than actually editing the dialog files, I suggest just cloning them and swapping the creatures' dialog files by script.

May I ask why you are suggesting swapping the whole dialogue files? Is it because it's Black Pits material where supposedly no other mod already added lines and NPC reactions? I'm asking because in general, the modding community went a long way not to just double/replace dialogue states /dialogues of game characters for compatibility reasons, and here you are with a whole function for it.

 

Link to comment
6 hours ago, jastey said:

Is it because it's Black Pits material where supposedly no other mod already added lines and NPC reactions?

Well, right now, the Readme says "install this first," so for the moment it is okay to assume no other mod has added lines or NPC reactions.

The mod's "/data/bgee" folder contains the altered versions of each dialogue that gets overwritten; in the v0.6.2 commit I have added a "/data/original" folder with  the original dialogues, in .D form. So if anyone is inclined, hopefully this makes is easier to examine the changes and discuss the best way to achieves to goals of the mod. :)

Link to comment
10 hours ago, jastey said:

May I ask why you are suggesting swapping the whole dialogue files? Is it because it's Black Pits material where supposedly no other mod already added lines and NPC reactions? I'm asking because in general, the modding community went a long way not to just double/replace dialogue states /dialogues of game characters for compatibility reasons, and here you are with a whole function for it.

 

I thought it was simpler and somewhat more compatibility-friendly than the alternative being discussed, i.e. distributing hardcoded replacements. An alternative would have been to use a large number of .d commands, but SD indicated learning the .d format wasn’t an immediate option and in any case it risks a third-party mod adding extra blocks that add stores, which would be mod-breaking.

Ideally one would parse the dlg file and intelligently clone every block that references a store, but afaik (happy to be corrected) there is no native way to do it in weidu and coding a function to do it, while doable, would be very demanding - more demanding than I had time to do in a quick response to a forum post.

(edit: and no mod could (aiui) have added NPC reactions, because prior to this mod, you couldn’t have NPCs in TBP.)

 

 

 

Link to comment

I had initially made this Github repo in the G3 account, since as I said I want it to be a mod by the community, not a mod by Subtledoctor. But apparently the G3 account is only for finished mods that are officially accepted after application by the modder. I don't expect to make such an application since, again, I don't want to be the author of this mod. So it's a conundrum. For now, I moved the BP-in-BG repo to the UnearthedArcana account. This means that other G3 folks won't have write access to it, but I guess people can just fork it if they want to work on it. So, fork away!

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...