Jump to content

Reflections - Let's Make a Mod for EET


Recommended Posts

Guest Jesse

Thoroughly enjoying this thread to see the process unfold to improve a rather significant blemish on an otherwise solid D&D game.  The last chapter's tone is a bizarre departure from the earlier ones, and honestly I was a bit surprised to discover how little in the modding group seemed to care to address it (out of respect or something?).  Anyway, this mod sounds like a must-install for me.  Thanks for investing the time!

Link to comment
Posted (edited)
2 hours ago, mickabouille said:

Yeah, I'm probably a bit prejudiced because the fact that I don't believe a criminal organization of this kind can be severely injured by any police operation, as heavy-handed as they may be.

As I have been thinking about it: it makes sense, IF Sarevok specifically ordered Angelo to target the Thieves’ Guild, because he specifically wanted access to that staircase that leads to the Undercity. It is almost the only explanation that makes sense, because it is not otherwise an important plot point (players will miss it entirely if they don’t happen upon Rededge and Silence), and there is no obvious reason why the entrance to the Undercity should be there in the first place.

But even if that explanation makes sense… Bioware did not express anything like that in the game itself. We are left with the weird situation where the staircase is unusable for most of the game, located in the Guild for no stated reason, and Angelo happened to be cruel to the thieves for no stated reason, and Belt knows exactly where the Thieves’ Guild is and blithely teleports you there with no advance warning, even if Charname is a paladin or something…!

It’s all a bit crazy. It should be at least a bit more sensible/satisfying with this mod. Not perfectly satisfying - “I heard a rumor there might be a warded entrance in the Thieves’ Guild; take this wardstone in case the rumor is true” - and lo and behold, the rumor is true. With more time and energy, I might try to set up a more open-ended investigation… like, maybe make it so Alatos has the only wardstone, and you need to find him. 

But at the moment I am just trying improve the situation with a few quick dialogues, and that too-convenient rumor serves our purpose well enough. At least for now. 

Edited by subtledoctor
Link to comment

I always saw this as Sarevok wanting to neutralize all groups able to challenge his future iron fist rule on the city (Rededge says adventurers and all competent sword and magic wielders are also targeted).

It's one stone two birds : strengthen his grip on the city, and also make it more focused on the war against Amn, with no outlaws weakening the war efforts. 

Link to comment
Posted (edited)

Almost done with Part 7. This is probably the trickiest bit, as it involves cut scenes that can direct the game to different campaigns. 

Just having a bit of difficulty with the transition to SoD: when I trigger the cut scene with the MoveToCampaign() action, it plops me down in Korkasz’ dungeon. But of course we have already finished that. I want to skip to the palace kidnapping attempt. 

But I don’t necessarily want to change CAMPAIGN.2da, because if players start a brand new SoD game, I want it to start in Korlasz’ dungeon as usual. I want my changes to only take effect when playing through the end of BG1

This is a bit complicated. I begin to understand why EndlessBG1 adds a whole new campaign when moving Korlasz’ dungeon forward into the BG1 game (just not as far forward as I am bringing it). But I don’t fully understand how EndlessBG1 uses that new campaign. Is it only for the section that includes Korlasz’ dungeon? So the ‘SoD’ campaign begins with the kidnapping? Or does ‘SoD’ work as normal, and the new campaign just shunts you ahead of the SoD prologue? I need to understand that mod better. 

As I see it now, there are three options:

1. Just remove Korlasz’ dungeon from SoD altogether, so the SoD campaign will begin with the kidnapping scene even when starting a new campaign. (How much does this matter? How many people skip BG1 and play SoD by itself? I imagine the number is close to zero…

2. Learn what EndlessBG1 does with its added ‘campaign’ and try to do the same thing.

3. Let the MoveToCampaign action put you in Korlasz’ dungeon, but before it even fades in from black, have that area script jump you forward to the kidnapping scene. 

#3 sounds like the easiest way; #2 sounds like the hardest, but maybe best for compatibility…? Maybe. 

EDIT - I have a working version of #3. Probably will go with that. 

Edited by subtledoctor
Link to comment
Posted (edited)

Part 7: Choose a Side

Okay! When last we left off, Sarevok was killed, but the game did not end. You have to return to the Ducal Palace to let them know that Sarevok is defeated at long last. The dukes specifically instructed you to find Sarevok, not to fight him. And they specifically instructed you to preserve his body if he dies, so that they can get the palace necromancers working on interrogating him. But we know from the wonderful 1998 CGI movie that Sarevok's body disintegrated, and the energy flowed to some great hall deep in the earth, or in another plane of existence, or whatever, hinting at all the other Bhaalspawn out there. (The prophecy says "a score" but this movie makes it seem like hundreds!) Telling people bad news is always unpleasant, so if you want to run away to a deserted island across the sea, or something, this is a perfectly good time.

I should note, some things come up in each stage of this that require slight revisions to earlier stages. In this case, I went back to the Dukes and they were not acknowledging that Sarevok was dead, because a dialogue trigger needed to be updated. But I am not going to go back and update the old posts here, because these end up being a bit different from the mod's actual code. All the fixes go into the Github project though.

At any rate, here again, first we prep a journal entry for the end of the campaign:

Spoiler
ADD_JOURNAL TITLE (@30036) ~The Hunt for Sarevok
Sarevok and his followers are defeated at long last, his murderous schemes fully unraveled. Your foster father, Gorion, has been avenged. With the exception of your friend Imoen, those who helped you thwart your half-brother's schemes drift away from you, returning to their lives. For the first time since you left Candlekeep, you have the opportunity to reflect on the astonishing turns your life has taken.
Though you are fêted by the rulers of Baldur's Gate, a sense of unease plagues you. You can't help but hear whispers, hinting that you killed your half-brother not for the good of the city, but so you could usurp his place and his power. For the moment, however, your persecutors' voices are drowned out by an ever-growing number of others with more immediate concerns.
Every day, more refugees driven from their homes by the servants of Caelar Argent arrive at the city gates. Many have stories of the Shining Lady's grace; all have tales of her followers' wrath.
You retire to your chamber in the Ducal Palace, your thoughts troubled. You wonder what effect Caelar's crusade will have on Baldur's Gate, little knowing how close at hand the answer is...~

This is a modified version of the text scrawl from SoD when you finish Korlasz' dungeon. With a few small adjustments it fits very well here.

Then we adjust the cut scene script that handles the transition from the BG1 campaign to the SoD campaign. This is taken whole from EndlessBG1, for maximum compatibility.

Spoiler
// SoD + EET: patch bdsodtrn.bcs so the BG1 Endmovie doesn't show twice 
COPY_EXISTING ~bdsodtrn.BCS~ ~override~
	DECOMPILE_AND_PATCH BEGIN
		SPRINT textToReplace ~Wait(1)[%newline%]*StartMovie("ENDMOVIE")[%newline%]*FadeToColor(\[1\.0\],0)~
		COUNT_REGEXP_INSTANCES ~%textToReplace%~ num_matches
		PATCH_IF (num_matches > 0) BEGIN
			REPLACE_TEXTUALLY ~%textToReplace%~ ~~
			PATCH_PRINT ~Patching: %num_matches% matches found in %SOURCE_FILESPEC% for REPLACE_TEXTUALLY: %textToReplace%~
		END ELSE BEGIN
			PATCH_WARN ~WARNING: could not find %textToReplace% in %SOURCE_FILESPEC%~
		END
	END
BUT_ONLY

Then we will set up our own cut scene for the end of BG1 that will glide into the base game's campaign-change cut scene. This will handle Imoen's status at the point of transition. This is adapted from a script in EndlessBG1, but is slightly different. It is okay that they differ, because if both are installed, the dialogue will point to mine:

Spoiler
// cutscene for transition to SoD, including handling of Imoen's stuff. 
<<<<<<<< .../d5st2so2.baf
/* move the group to some area so Imoen's stuff can be handled. I'll take the PC's room for now. (There is an Imoen in bd0103 already so we can't do it there.) */
IF
	AreaCheck("%NBaldursGate_DucalPalace_L1%")
THEN
	RESPONSE #100
        CutSceneId(Player1)
		FadeToColor([1.0],0)
		SaveGame(2)
		SmallWait(1)
		ActionOverride(Player2,LeaveAreaLUA("%NBaldursGate_DucalPalace_L3%","",[315.1390],S))
		ActionOverride(Player3,LeaveAreaLUA("%NBaldursGate_DucalPalace_L3%","",[315.1390],S))
		ActionOverride(Player4,LeaveAreaLUA("%NBaldursGate_DucalPalace_L3%","",[315.1390],S))
		ActionOverride(Player5,LeaveAreaLUA("%NBaldursGate_DucalPalace_L3%","",[315.1390],S))
		ActionOverride(Player6,LeaveAreaLUA("%NBaldursGate_DucalPalace_L3%","",[315.1390],S))
		LeaveAreaLUAPanic("%NBaldursGate_DucalPalace_L3%","",[315.1390],SW)
		LeaveAreaLUA("%NBaldursGate_DucalPalace_L3%","",[315.1390],SW)
		MultiPlayerSync()
		Wait(1)		
		StartCutSceneEx("d5st2so2",TRUE)
END

/* if in group, let her leave the group */
IF
	AreaCheck("%NBaldursGate_DucalPalace_L3%")
	InPartyAllowDead("%IMOEN_DV%")
	InMyArea("%IMOEN_DV%")	
	Global("C#EBG1_MoveImoenStuff","MYAREA",0)
THEN
	RESPONSE #100
        CutSceneId(Player1)
		SetGlobal("C#EBG1_MoveImoenStuff","MYAREA",1)
		ActionOverride("%IMOEN_DV%",LeaveParty())
		SmallWait(10)
		StartCutSceneEx("d5st2so2",TRUE)
END

/* for all cases: move her stuff into the chest and let her disappear */
IF
	AreaCheck("%NBaldursGate_DucalPalace_L3%")
	InMyArea("%IMOEN_DV%")
	GlobalLT("C#EBG1_MoveImoenStuff","MYAREA",2)
THEN
	RESPONSE #100
		SetInterrupt(FALSE)
        CutSceneId(Player1)
		SetGlobal("C#EBG1_MoveImoenStuff","MYAREA",2)
		ActionOverride("Container 4",TakeCreatureItems("%IMOEN_DV%",ALL)) //BACKPACK
		Wait(1)
		StartCutSceneEx("d5st2so2",TRUE)
END

/* for all cases: let Imoen disappear */
IF
	AreaCheck("%NBaldursGate_DucalPalace_L3%")
	InMyArea("%IMOEN_DV%")
	Global("C#EBG1_MoveImoenStuff","MYAREA",2)
THEN
	RESPONSE #100
		SetInterrupt(FALSE)
        CutSceneId(Player1)
		SetGlobal("C#EBG1_MoveImoenStuff","MYAREA",3)
		ActionOverride("%IMOEN_DV%",DestroySelf())
		SmallWait(10)
		StartCutSceneEx("d5st2so2",TRUE)
END

/* after Imoen is done, start transition to SoD */
IF
	AreaCheck("%NBaldursGate_DucalPalace_L3%")	
	OR(2)
		Global("C#EBG1_MoveImoenStuff","MYAREA",0)
		Global("C#EBG1_MoveImoenStuff","MYAREA",3)
THEN
	RESPONSE #100
        CutSceneId(Player1)
		SetGlobal("C#EBG1_MoveImoenStuff","MYAREA",4)
		SetGlobal("bd_npc_camp_chapter","global",0)
		SetGlobal("chapter","global",7)
		SetGlobal("DREAM","GLOBAL",7)
		SetGlobal("sprite_is_deadsafana","GLOBAL",0)
		SetGlobal("sprite_is_deaddynaheir","GLOBAL",0)
		SetGlobal("sprite_is_deadminsc","GLOBAL",0)
		SetGlobal("sprite_is_deadrasaad","GLOBAL",0)
		TakeObjectGoldGlobal("BD_TAKEN_GOLD","GLOBAL",Player1)
		SetGlobal("BD_EXTRA_GOLD","GLOBAL",17)
		SetGlobal("BD_SAFEHOUSE_DONE","GLOBAL",1)
		ChangeAIScript("bdplayer",OVERRIDE)
		SmallWait(2)
		StartCutSceneEx("BDSODTRN",TRUE)
		SetGlobal("d5st2so2","GLOBAL",2)
END
>>>>>>>>
COPY ~.../d5st2so2.baf~ ~weidu_external/%MOD_FOLDER%/compile/d5st2so2.baf~
COMPILE EVALUATE_BUFFER ~weidu_external/%MOD_FOLDER%/compile/d5st2so2.baf~ 

Then three script additions: the first two just add some compatibility for optional EndlessBG1 components; the third makes sure Entar is in the palace with Belt and Liia when you return from Sarevok.

Spoiler
// cross-compatibility with component "Sarevok's Sword": we add script to remove Sarevok's Sword to BG1 area, too 

ACTION_IF (MOD_IS_INSTALLED ~c#endlessbg1.tp2~ ~4~) BEGIN

<<<<<<<< .../ar0110_remove_Sarevoks_sword.baf
/* Sarevok's Sword will be stolen after PC returns from Korlasz' Dungeon */
IF
  GlobalGT("bd_plot","GLOBAL",1)
  Global("C#st_RemoveSwordPCChest","MYAREA",0)
  HasItem("c#stsrvs","Container1")
THEN
  RESPONSE #100
    ActionOverride("Container1",DestroyItem("c#stsrvs"))
    SetGlobal("C#st_RemoveSwordPCChest","MYAREA",1)
END
>>>>>>>>
COPY ~.../ar0110_remove_Sarevoks_sword.baf~ ~weidu_external/%MOD_FOLDER%/compile/ar0110_remove_Sarevoks_sword.baf~
EXTEND_BOTTOM ~%NBaldursGate_DucalPalace_L3%.bcs~ ~weidu_external/%MOD_FOLDER%/compile/ar0110_remove_Sarevoks_sword.baf~ EVALUATE_BUFFER 

END	//	end EBG1 #4

// cross-compatibility with component "Short Hero Tribute Scene": set a variable so the dialogue can trigger the cut scene 

ACTION_IF (MOD_IS_INSTALLED ~c#endlessbg1.tp2~ ~2~) BEGIN

<<<<<<<< d5/hero108.baf
IF
	Global("D5HeroSceneInstalled","GLOBAL",0)
THEN
	RESPONSE #100
		SetGlobal("D5HeroSceneInstalled","GLOBAL",1)
		Continue()
END
>>>>>>>>
COPY ~d5/hero108.baf~ ~weidu_external/%MOD_FOLDER%/compile/hero108.baf~
EXTEND_TOP ~%bg1_area_prefix%0108.BCS~ ~weidu_external/%MOD_FOLDER%/compile/hero108.baf~

END	//	end EBG1 #2

// put Entar in the palace for the last dialogues

<<<<<<<< d5/ar108+7.baf
IF
	Dead("Sarevok")
	!InMyArea("BDENTAR")
THEN
	RESPONSE #100
		CreateCreature("BDENTAR",[810.365],SW)
		Continue()
END
>>>>>>>>
COPY ~d5/ar108+7.baf~ ~weidu_external/%MOD_FOLDER%/compile/ar108+7.baf~
EXTEND_TOP ~%bg1_area_prefix%0108.BCS~ ~weidu_external/%MOD_FOLDER%/compile/ar108+7.baf~

Then, all the dialogue additions. A long (and rather wordy, might need to be trimmed a bit) interchange between Charname, Belt, Liia, and Entar. With a potential interjection by Skie, perpetually embarrassed by her boomer dad.

Spoiler
<<<<<<<< d5/transit+.d
APPEND BELT

IF ~Global("D5EntarCut","GLOBAL",7) Dead("SAREVOK")~ BEGIN d5beltsd_0
  SAY ~<CHARNAME>! We did not expect you so quickly. Did you find passage to the Undercity? Do you have information on Sarevok's whereabouts? I have asked Captain Gregson of the Flaming Fist to have a company of soldiers and battlemages prepared to apprehend him. Not as many as I would like - the Crusade is gathering strength in the north and most of our armed forces are assembling to march in that direction. Never mind that, though - tell us what you have learned.~
  IF ~~ REPLY ~Sarevok is dead. I trailed him to an old temple of Bhaal, where he had arranged some kind of magical trap. The entire place was glowing with some kind of energy. I could not escape.~ GOTO d5beltsd_1
  IF ~~ REPLY ~It is Sarevok who has learned the hardest of lessons. He trapped me and thought he could best me, but he was very wrong. He and his last followers fell to my onslaught.~ GOTO d5beltsd_1
END

IF ~~ BEGIN d5beltsd_1
  SAY ~What! Are you- well obviously you survived. Tell us what happened.~
  IF ~~ REPLY ~We had no choice but to fight. It was that, or die. He had some kind of ritual planned, but in the end it came to naught. He and his associates fell, and his very body crumbled to nothing.~ GOTO d5beltsd_2
  IF ~~ REPLY ~Sarevok was overconfident, and fell to my power. In the end there was nothing left of him.~ GOTO d5beltsd_2
END

IF ~~ BEGIN d5beltsd_2
  SAY ~What do you mean 'nothing?' Please tell me that you safeguarded his remains. Dead or not, we need to interrogate him. There is still the matter of the attack against Duke Silvershield, and several other loose threads.~
  IF ~~ EXTERN LIIA d5liiasd_1
END

IF ~~ BEGIN d5beltsd_3
  SAY ~Entar. I sympathize with what you went through, but I disagree about that course of action. I have had accounts from the Flaming Fist about <CHARNAME>'s performance rooting out Korlasz, working with our men to defeat her while showing mercy where appropriate.~
  IF ~~ GOTO d5beltsd_5
END

IF ~~ BEGIN d5beltsd_4
  SAY ~Entar. I sympathize with what you went through, but I disagree about that course of action. I have had accounts from the Flaming Fist about <CHARNAME>'s performance rooting out Korlasz, working with our men to soundly defeat her and all of her followers.~
  IF ~~ GOTO d5beltsd_5
END

IF ~~ BEGIN d5beltsd_5
  SAY ~The threat of the Crusade is too great not to use all of our resources. <CHARNAME> has failed to follow our instructions, but ultimately, the outcome is the one we desired: Sarevok is no more. We should focus on the real, very visible threat to our city, rather than imagined threats. And what better way for <CHARNAME> to prove <PRO_HISHER> loyalty and good faith than by putting <PRO_HISHER> skills to use on the field of battle, in the name of Baldur's Gate?~
  IF ~~ EXTERN LIIA d5liiasd_3
END

IF ~~ BEGIN d5beltsd_6
  SAY ~We thank you for your honesty. It strikes me that may be a particularly sensitive thing to admit, so I appreciate your openness. If anything, I think this helps your case, since you easily could have remained in silence. You are acting like a true ally, which is to your benefit. I suppose, now that we know about Sarevok and that the time mentioned in the prophecy is upon us, every foundling child will be suspect. Er, no offense, of course.~
  IF ~~ GOTO d5beltsd_7
END

IF ~~ BEGIN d5beltsd_7
  SAY ~Ultimately, however, it changes little in the short term. I also would like to hear what you propose to do. Will you prove yourself by joining our campaign in the north? Or will you do so by tracking down the last threads of Sarevok's scheming and find out the truth of Duke Entar's murder?~
  IF ~Alignment(Player1,MASK_GOOD)~ REPLY ~I want to be a force for good in Baldur's Gate. Let me prove myself. I have had enough of Sarevok's schemes and shapechangers. The man is dead; the damage he caused will fade over time. Let me join the city's armed forces and put a stop to this crusade, as I put a stop to Sarevok.~ GOTO d5beltsd_8
  IF ~Alignment(Player1,MASK_GENEUTRAL)~ REPLY ~I want to be a force for good in Baldur's Gate. Let me prove myself. I have had enough of Sarevok's schemes and shapechangers. The man is dead; the damage he caused will fade over time. Let me join the city's armed forces and put a stop to this crusade, as I put a stop to Sarevok.~ GOTO d5beltsd_8
  IF ~Alignment(Player1,MASK_EVIL)~ REPLY ~In truth, I am not feeling very welcome in this city, and being here has become less and less fun. But this crusade sounds like an interesting challenge. Very well, I will join your army, and see about this threat in the north.~ GOTO d5beltsd_9
  IF ~~ REPLY ~I am not a soldier, and I would not know what to do among an army. Even if the Crusade interested me, it does not sound like an area where my skills can be effective. My place is here in the city. If someone or something out there is wearing my face, I need to know who, and why. Send your troops to face the crusade without me.~ GOTO d5beltsd_10
END

IF ~~ BEGIN d5beltsd_8 // chose SoD !evil
  SAY ~Are you sure that is your choice? There will be no going back: this will require you to rest up and then leave Baldur's Gate post-haste with the city's armed forces. Any unfinished business you have here will have to be left behind.~
  IF ~~ REPLY ~Yes, I am sure.~ GOTO d5beltsd_12
  IF ~~ REPLY ~Wait, let me reconsider.~ GOTO d5beltsd_11
END

IF ~~ BEGIN d5beltsd_9 // chose SoD evil
  SAY ~Are you sure that is your choice? There will be no going back: this will require you to rest up and then leave Baldur's Gate post-haste with the city's armed forces. Any unfinished business you have here will have to be left behind.~
  IF ~~ REPLY ~Yes, I am sure.~ GOTO d5beltsd_13
  IF ~~ REPLY ~Wait, let me reconsider.~ GOTO d5beltsd_11
END

IF ~~ BEGIN d5beltsd_10 // chose clone
  SAY ~Are you sure that is your choice? There will be no catching up: the city's armed forces need to march as soon as possible, and cannot wait for you. Whatever is happening at Castle Dragonspear will not be your concern; your business will be to the south.~
  IF ~~ REPLY ~Yes, I am sure.~ GOTO d5beltsd_18 // go to clone cut scene
  IF ~~ REPLY ~Wait, let me reconsider.~ GOTO d5beltsd_11
END

IF ~~ BEGIN d5beltsd_11
  SAY ~Well, what is it to be then? This is your one chance to make a choice as to where your future lies: north toward Dragonspear, or here in the south. Choose well.~
  IF ~Alignment(Player1,MASK_GOOD)~ REPLY ~I want to be a force for good in Baldur's Gate. Let me prove myself. I have had enough of Sarevok's schemes and shapechangers. The man is dead; the damage he caused will fade over time. Let me join the city's armed forces and put a stop to this crusade, as I put a stop to Sarevok.~ GOTO d5beltsd_8
  IF ~Alignment(Player1,MASK_GENEUTRAL)~ REPLY ~I want to be a force for good in Baldur's Gate. Let me prove myself. I have had enough of Sarevok's schemes and shapechangers. The man is dead; the damage he caused will fade over time. Let me join the city's armed forces and put a stop to this crusade, as I put a stop to Sarevok.~ GOTO d5beltsd_8
  IF ~Alignment(Player1,MASK_EVIL)~ REPLY ~In truth, I am not feeling very welcome in this city, and being here has become less and less fun. But this crusade sounds like an interesting challenge. Very well, I will join your army, and see about this threat in the north.~ GOTO d5beltsd_9
  IF ~~ REPLY ~I am not a soldier, and I would not know what to do among an army. Even if the Crusade interested me, it does not sound like an area where my skills can be effective. My place is here in the city. If someone or something out there is wearing my face, I need to know who, and why. Send your troops to face the crusade without me.~ GOTO d5beltsd_10
END

IF ~~ BEGIN d5beltsd_12 // chose SoD !evil
  SAY ~I am glad to hear it. As I say, you have proven your value, and after our recent travails, the city needs all the help it can muster to face the Crusade. From our reports, the crusaders have the wild energy of berserkers. And, unfortunately, the same disregard for innocents.~
  IF ~~ GOTO d5beltsd_14
END

IF ~~ BEGIN d5beltsd_13 // chose SoD evil
  SAY ~Well, you will have to chance to wet your blades, but mark well they are pointed at crusaders! I cannot say I enjoy your attitude, but fortunately our interests are aligned in this matter. And mark you well, you will be subject to army discipline, so be careful not to step out of line.~
  IF ~~ GOTO d5beltsd_14
END

IF ~~ BEGIN d5beltsd_14
  SAY ~You have a short time to rest before the army marches.~
  IF ~Global("C#st_HeroCutScene","GLOBAL",0) Global("D5HeroSceneInstalled","GLOBAL",1)~ GOTO d5beltsd_15 // hero tribute diversion
  IF ~Global("D5HeroSceneInstalled","GLOBAL",0)~ GOTO d5beltsd_16
  IF ~Global("C#st_HeroCutScene","GLOBAL",1)~ GOTO d5beltsd_16
END

IF ~~ BEGIN d5beltsd_15
  SAY ~But first, we must let the people of the city know that order has been restored. They need to know that the villain is defeated, slain by a hero. Whether or not that is what you really are, the fact is you did stop Sarevok. The whispers about you have already started; it would be prudent to make sure the less kind ones do not become dominant. Come: you will be presented as the 'Hero of Baldur's Gate.'~
  IF ~~ DO ~SetGlobal("C#st_HeroCutScene","GLOBAL",1)
	ClearAllActions()
	StartCutSceneMode()
	StartCutSceneEx("c#stcut1",FALSE)~ EXIT // ... out to tribute cut scene
END

IF ~~ BEGIN d5beltsd_16
  SAY ~The forces of Baldur's Gate are mustering as we speak. We will provide you with quarters here in the palace until it is time to leave. Rest well, we will speak again in the morning.~
  IF ~~ DO ~SetInterrupt(FALSE)
	ClearAllActions()
	StartCutSceneMode()
	StartCutSceneEx("d5st2so2",TRUE)
	SetInterrupt(TRUE)~ EXIT 
END

IF ~Global("C#st_HeroCutScene","GLOBAL",1)~ BEGIN d5beltsd_17
  SAY ~The forces of Baldur's Gate are mustering as we speak. We will provide you with quarters here in the palace until it is time to leave. Rest well, we will speak again in the morning.~
  IF ~~ DO ~SetInterrupt(FALSE)
	ClearAllActions()
	StartCutSceneMode()
	StartCutSceneEx("d5st2so2",TRUE)
	SetInterrupt(TRUE)~ EXIT // ... back from hero cut scene, out to start SoD
END

IF ~~ BEGIN d5beltsd_18
  SAY ~Very well. I shall inform Corporal Duncan and Captain Corwin that they should make ready to leave at once, and not wait for you.~
  IF ~~ DO ~SetGlobal("D5GregsonPalace","GLOBAL",1) ActionOverride("Player1",DisplayStringHead(Myself,@70045))~ EXIT // ... clone cut scene
END

END

APPEND LIIA

IF ~Global("D5EntarCut","GLOBAL",7) Dead("SAREVOK")~ BEGIN d5beltsd_0
  SAY ~<CHARNAME>! We did not expect you so quickly. Did you find passage to the Undercity? Do you have information on Sarevok's whereabouts? I have asked Captain Gregson of the Flaming Fist to have a company of soldiers and battlemages prepared to apprehend him. Not as many as I would like - the Crusade is gathering strength in the north and most of our armed forces are assembling to march in that direction. Never mind that, though - tell us what you have learned.~
  IF ~~ REPLY ~Sarevok is dead. I trailed him to an old temple of Bhaal, where he had arranged some kind of magical trap. The entire place was glowing with some kind of energy. I could not escape.~ EXTERN BELT d5beltsd_1
  IF ~~ REPLY ~It is Sarevok who has learned the hardest of lessons. He trapped me and thought he could best me, but he was very wrong. He and his last followers fell to my onslaught.~ EXTERN BELT d5beltsd_1
END

IF ~~ BEGIN d5liiasd_1
  SAY ~This is a serious matter. We must know whether any remnants of his supporters may still threaten the city. The ranks of the crusade are swelling in the north, to the point where it may present an existential threat to nearby cities. We cannot have our attention divided between the threat without and a threat within.~
  IF ~~ REPLY ~I tell you, on my honor, Sarevok is dead and will trouble the city no more. The bodies of Tazok, Angelo, and another mage are still there. But Sarevok... he just disappeared in a swirl of some kind of glowing motes. Given where were, and what we know of him, I suppose it may have had something to do with the ritual he had planned? It is hard to say. But he is truly dead, and beyond returning. I know it. In my bones.~ EXTERN BDENTAR d5entarsd_1
  IF ~~ REPLY ~What do you want me to say? He's gone. Good riddance.~ EXTERN BDENTAR d5entarsd_1
END

IF ~~ BEGIN d5liiasd_2
  SAY ~That seems unlikely. The circumstances would have to be pretty convoluted for that to be the case. If <CHARNAME> were- ~
  IF ~~ EXTERN BDENTAR d5entarsd_2
END

IF ~~ BEGIN d5liiasd_3
  SAY ~I do not know... Since Sarevok's attack I have immersed myself in research about Bhaal's actions during the Time of Troubles, and the prophecies surrounding Sarevok and others of his ilk. Sarevok was not alone; there are scores of these... "Bhaal-spawned" individuals in the world. Prophecy holds that they will converge on the Sword Coast. Alaundo did not predict when it would happen, but what if Sarevok's actions have lit the flame that draws these beings to us, with chaos in their wake?~
  IF ~~ GOTO d5liiasd_4
END

IF ~~ BEGIN d5liiasd_4
  SAY ~This crusade in the north - do you think it is unrelated? Coincidental? Its leader, Caelar Argent... she is from a well-known family, but who is to say what may have happened. What if the concerns inside our city and outside it are connected? I fear the peril faced by our city has not ended, but will only intensify.~
  IF ~~ GOTO d5liiasd_5
END

IF ~~ BEGIN d5liiasd_5
  SAY ~<CHARNAME>, I would like to hear from you. Obviously we are not entirely happy with how your hunt for Sarevok resolved itself. I think it unlikely that you were in league with him, but your coin is on edge at the moment. You would do well to demonstrate that you have the interests of Baldur's Gate at heart, and not some other agenda. So, what would you propose? Will you stay and prove your innocence to Duke Silvershield? Or would you ride out with the forces of Baldur's Gate, and prove your worth by fighting for the city? I am afraid, under the circumstances, that there is no third option.~
  IF ~Alignment(Player1,MASK_GOOD)~ REPLY ~I want to be a force for good in Baldur's Gate. Let me prove myself. I have had enough of Sarevok's schemes and shapechangers. The man is dead; the damage he caused will fade over time. Let me join the city's armed forces and put a stop to this crusade, as I put a stop to Sarevok.~ EXTERN BELT d5beltsd_8
  IF ~Alignment(Player1,MASK_GENEUTRAL)~ REPLY ~I want to be a force for good in Baldur's Gate. Let me prove myself. I have had enough of Sarevok's schemes and shapechangers. The man is dead; the damage he caused will fade over time. Let me join the city's armed forces and put a stop to this crusade, as I put a stop to Sarevok.~ EXTERN BELT d5beltsd_8
  IF ~Alignment(Player1,MASK_EVIL)~ REPLY ~In truth, I am not feeling very welcome in this city, and being here has become less and less fun. But this crusade sounds like an interesting challenge. Very well, I will join your army, and see about this threat in the north.~ EXTERN BELT d5beltsd_9
  IF ~~ REPLY ~I am not a soldier, and I would not know what to do among an army. Even if the Crusade interested me, it does not sound like an area where my skills can be effective. My place is here in the city. If someone or something out there is wearing my face, I need to know who, and why. Send your troops to face the crusade without me.~ EXTERN BELT d5beltsd_10 // go to clone cut scene
  IF ~~ REPLY ~Duke Liia, Belt... I feel it would be best if I tell you this. When I went to Candlekeep, on the trail of the Iron Throne, I found a letter from Gorion. Apparently when I was a baby, he took me from a temple of Bhaal, right after the Time of Troubles. He believes I am also... one of the children sired by the god. It sounds crazy to even say it out loud. But that is what the letter. And it make sense. Gorion never hinted at such a thing. Evidently he wanted to shield me from the events of the prophecy. Or maybe, somehow, prevent it? I don't know. But it is who I am, and you should know that.~ EXTERN BDENTAR d5entarsd_4
END

IF ~~ BEGIN d5liiasd_6
  SAY ~That is... unexpected. Though, from everything I now know, perhaps unsurprising. And you never knew, until recently? Fascinating. Whatever your parentage, you are clearly not cut from the same cloth as Sarevok. Your actions heretofore have aptly proven that. There are debates among sages about whether direct divine influence in a mortal's blood would overpower them, or whether their own soul can retain its independence. I suppose we are seeing this question play out, in real time. My own opinion is that mortal souls are wondrous and powerful things, that even gods cannot subsume. That is, of course, why the gods need mortal flocks. But that is just supposition. To have a true test case...~
  IF ~~ EXTERN BELT d5beltsd_6
END

IF ~~ BEGIN d5liiasd_7
  SAY ~That is... unexpected. Though, from everything I now know, perhaps unsurprising.I am not sure how to feel about this revelation. I have noticed your tendency to put your concern for yourself above others. On its own, this is not a problem; heavens know many, many other people have similar tendencies! And whatever the shade of your moral fiber, you are clearly not cut from the same cloth as Sarevok. You are, as I say, balancing on a knife's edge at the moment. Your next move will be telling.~
  IF ~~ EXTERN BELT d5beltsd_6
END

END

APPEND BDENTAR

IF ~Global("D5EntarCut","GLOBAL",7) Dead("SAREVOK")~ BEGIN d5entarsd_0
  SAY ~<CHARNAME>! We did not expect you so quickly. Did you find passage to the Undercity? Do you have information on Sarevok's whereabouts? I have asked Captain Gregson of the Flaming Fist to have a company of soldiers and battlemages prepared to apprehend him. Not as many as I would like - the Crusade is gathering strength in the north and most of our armed forces are assembling to march in that direction. Never mind that, though - tell us what you have learned.~
  IF ~~ REPLY ~Sarevok is dead. I trailed him to an old temple of Bhaal, where he had arranged some kind of magical trap. The entire place was glowing with some kind of energy. I could not escape.~ EXTERN BELT d5beltsd_1
  IF ~~ REPLY ~It is Sarevok who has learned the hardest of lessons. He trapped me and thought he could best me, but he was very wrong. He and his last followers fell to my onslaught.~ EXTERN BELT d5beltsd_1
END

IF ~~ BEGIN d5entarsd_1
  SAY ~This is unbelievable! How do we know any of that even happened? I have heard the reports - Sarevok was said to be immensely powerful. Are we to believe this... this upstart could have defeated him and his top lieutenants, in his place of power? For all we know they could have been working together the whole time! Sarevok may be running to meet with Caelar Argent, then to march against the city at the head of a wildling army!~
  IF ~!IsValidForPartyDialogue("SKIE")~ EXTERN LIIA d5liiasd_2
  IF ~IsValidForPartyDialogue("SKIE")~ EXTERN SKIE d5skiesd_0
END

IF ~~ BEGIN d5entarsd_2
  SAY ~I am not interested in conjecture! I am interested in what can be proven! This has been a disaster for the city. Our iron was poisoned, our military readiness reduced, our trading costers brutally attacked, ONE of us was assassinated and the other three were nearly killed as well. And <CHARNAME> has been tangled up in it from the beginning!~
  IF ~~ GOTO d5entarsd_3
END

IF ~~ BEGIN d5entarsd_3
  SAY ~And he has still not answered for my murder. I tell you, it was no doppelganger. That would make no sense anyway; Sarevok left evidence connecting the murder to the Shadow Thieves, so why would the murderer not take the form of a Shadow Thief? I tell you, something about this stinks. I demand that <CHARNAME> submit to our custody until we can get to the bottom of it. <PRO_HESHE> should be subject to divination and interrogation.~
  IF ~!Dead("PORIOS")~ EXTERN BELT d5beltsd_3
  IF ~Dead("PORIOS")~ EXTERN BELT d5beltsd_4
END

IF ~~ BEGIN d5entarsd_4
  SAY ~You... what?? Are you all hearing this? <CHARNAME> is a chaos agent, just like Sarevok. Now more than ever, the Council must heed my concerns! Another Bhaal-child. And what of the others? Maybe it is a whole company of them! Who knows what danger they pose?~
  IF ~!IsValidForPartyDialogue("SKIE") Alignment(Player1,MASK_GOOD)~ EXTERN LIIA d5liiasd_6
  IF ~!IsValidForPartyDialogue("SKIE") Alignment(Player1,MASK_GENEUTRAL)~ EXTERN LIIA d5liiasd_6
  IF ~!IsValidForPartyDialogue("SKIE") Alignment(Player1,MASK_EVIL)~ EXTERN LIIA d5liiasd_7
  IF ~IsValidForPartyDialogue("SKIE")~ EXTERN SKIE d5skiesd_1
END

END

APPEND SKIE

IF ~~ BEGIN d5skiesd_0
  SAY ~Daddy, really, what are you talking about?~
  IF ~~ EXTERN LIIA d5liiasd_2
END

IF ~~ BEGIN d5skiesd_1
  SAY ~Oh my gods. Have you noticed, I am in this company? Ugh, this is so embarrassing!~
  IF ~Alignment(Player1,MASK_GOOD)~ EXTERN LIIA d5liiasd_6
  IF ~Alignment(Player1,MASK_GENEUTRAL)~ EXTERN LIIA d5liiasd_6
  IF ~Alignment(Player1,MASK_EVIL)~ EXTERN LIIA d5liiasd_7
END

END
>>>>>>>> 
COPY ~d5/transit+.d~ ~weidu_external/%MOD_FOLDER%/compile/transit+.d~
COMPILE ~weidu_external/%MOD_FOLDER%/compile/transit+.d~

And finally, because the campaign transition script sends you to the beginning of Korlasz' dungeon - which we want to retain, in case player begin a brand new campaign in SoD - we will add a block to the Korlasz Dungeon area script that will check if you have already completed it and that Sarevok is dead, and if so, shunt you forward to the palace kidnapping scene. Also slightly change the text crawl pop-up screen, to match our end-of-Sarevok journal entry.

Spoiler
ACTION_IF (GAME_IS ~bgee~) BEGIN
  STRING_SET 65221 @70045
  STRING_SET 70019 @70045
END
ACTION_IF (GAME_IS ~eet~) BEGIN
  STRING_SET 265221 @70045
  STRING_SET 270019 @70045
END

<<<<<<<< d5/bd120+7.baf
IF
	Global("D5KorlaszDone","GLOBAL",1)
	Dead("Sarevok")  // Sarevok
THEN
	RESPONSE #100
		SetGlobal("bd_Imoen_farewell","bd0120",2)
		TakeObjectGoldGlobal("BD_TAKEN_GOLD","GLOBAL",Player1)
		SetGlobal("BD_EXTRA_GOLD","GLOBAL",17)
		SetGlobal("BD_SAFEHOUSE_DONE","GLOBAL",1)
		SmallWait(5)
		ActionOverride(Player2,LeaveAreaLUA("bd0103","",[131.485],E))
		ActionOverride(Player3,LeaveAreaLUA("bd0103","",[152.510],NE))
		ActionOverride(Player4,LeaveAreaLUA("bd0103","",[179.544],NE))
		ActionOverride(Player5,LeaveAreaLUA("bd0103","",[202.567],NE))
		ActionOverride(Player6,LeaveAreaLUA("bd0103","",[239.581],N))
		ActionOverride(Player1,LeaveAreaLUAPanic("bd0103","",[215.396],SE))
		ActionOverride(Player1,LeaveAreaLUA("bd0103","",[215.396],SE))
END
>>>>>>>>
COPY ~d5/bd120+7.baf~ ~weidu_external/%MOD_FOLDER%/compile/bd120+7.baf~

ACTION_IF (FILE_EXISTS_IN_GAME ~bd0120.bcs~) BEGIN
  EXTEND_TOP ~bd0120.bcs~ ~weidu_external/%MOD_FOLDER%/compile/bd120+7.baf~
END

And that's it for Part 7!

So far, we added a new artifact, and an unsolved mystery at High Hedge, and added a bunch of content and general breathing room in chapter 7 of the BG1 campaign. Where the original game literally teleports you to the final fight with no explanation, now we have several new NPCs, and a whole dungeon to fight through, and a bunch of dialogue that addresses the isues and gives a narrative framework for the transition to SoD. The added dialogue here in Part 7 actually gives you a chance to tell the dukes "listen, I feel I should let you know, I am your father a Bhaalspawn." And the different dukes have different reactions to that, and to your actions in general. There are no overt consequences to that admission, but at least now the player has agency to role-play it as they see fit. And it creates the opportunity to change things later, in SoD, to be responsive to this choice.

The transition to SoD happens right from Belt's dialogue, you say "I want to rest up and then march out with the army" and it gives the closure of the journal entry and text screen about the end of the fight against Sarevok, and then fades in to the early morning attack in which Imoen gets poisoned. So this is now fully playable if you choose the path that goes to SoD!

On the other hand, you can tell the dukes "the Crusade is not my concern, go handle it without me, I need to investigate Entar's report that there is a murderer in the city with my face." Right now this alternative choice just has a placeholder action. In Part 8 we will add a cut scene with Captain Gregson running into the palace, and then have everyone go to the Flaming Fist jail cells. This avenue will tie into the Mirror Shard/Netherese Bracers mystery and send you to a modified version of the SoD ambush scene. That bit at least will be easier than Part 4, because we won't care about what comes afterward. The main difficulty there will be handling the alternate possibilities of actually going into BG2 (if you are playing EET and the SoA campaign is present), or just ending the game with a cinematic and final save (if you are playing BGEE/SoD and need an exported final save to import into BG2EE).

Part 9 will jump back to the first path, where you actually play through SoD. This will insert the Mirror Shard cut scenes from Part 8 into the very end of SoD, and tie it all into SoD's Skie plot.

And after that we'll address compatibility with EndlessBG1. And then, release!

Edited by subtledoctor
Link to comment

Small update to reassure folks I haven't forgotten this. Part 8 is proving to be a bit tricky. It needs to get you from the palace, to the jail, and then out to the secret sewer exit. Basically through a long series of dialogues and cut scenes. A lot of little things need to be arranged, and my free time has been quite limited in the last few weeks. But I think I at least have the framework laid out. Now I just need to write up the various little cut scene scripts and the dialogue entries. (The dialogue will be substantially shorter than the stuff in Part 7.)

So basically I just need to do a bunch of writing and a bunch of scripting. It will get done eventually.

Link to comment
Posted (edited)

Muahahahaha... I have this fully working! I combined part 8, "Man in the Mirror," with Part 9, "the Great Escape," and successfully completed the transition to BG2 from BG1, skipping SoD, in an EET game. Well, mostly successfully - the game is acting a bit weird in Chateau Irenicus, Charname is still purple-circle like from the ambush scene and I cannot select her or move her. But I don't think that is related to this mod; this mod should not really be capable of making that happen. Unless EET expects some particular variables to be set, or something? I will look at how EndlessBG1 handles that transition. It might also be related to the ridiculous test run I did to get my character to the transition point - never taking any party members, and ctrl-Y'ing every enemy in the game. Hard to tell what the problem it.

Meantime, I just need to install the mod on a non-EET SoD game to make sure it all works there. Then I'll post the last update and, maybe, release it as an open beta for others to play it and give feedback.

Edited by subtledoctor
Link to comment

The transition to BGII in EET is very sensitive. EndlessBG1 uses as much of EET's original transition as possible, because I ran into problems of all sorts, too. Meaning, even if SoD is skipped, the group is teleported to the last SoD area so the normal transition can trigger.

Link to comment
Posted (edited)
14 hours ago, jastey said:

The transition to BGII in EET is very sensitive. EndlessBG1 uses as much of EET's original transition as possible, because I ran into problems of all sorts, too. Meaning, even if SoD is skipped, the group is teleported to the last SoD area so the normal transition can trigger.

Yes: currently I made clones of the FF HQ and the sewers/cave map, but the exit from my custom cave map sends you to BD6200.are, where Imoen is waiting and she takes you to J/K/M/D. I have not modified that area at all

Actually now that I think about it, in my test game I only have EET and Reflections installed - I forgot to install EET_End after Reflections. I’m willing to bet that is the problem. 

The only issue I am seeing on a SoD game is that, with an ending party of Imoen/Jaheira/Khalid, only Imoen, Minsc, and Dynaheir show up in BD6200. Imoen is not an issue because I think “IMOEN” was in my party while “BDIMOEN” appears in BD6100.are. So something is happening where of the other four, the ones in my party for the Sarevok fight are not showing up for the ambush. Probably just some variable needs to be set - I‘ll look at the scripts in BD6200. Also, Imoen’s dialogue in BD6200 needs to be adjusted very slightly.

But those are the only three things on my to-do list. As soon as I square those things away I can work on EndlessBG1 compatibility, and maybe release an open beta. Maybe not in that order? We’ll see. 

I have ideas for two, maybe three components addressing story stuff in SoD proper… but that is further down the road. I need a break for a bit. 

EDIT - oh, and I am not currently happy with my Timestop cut scene. It only visually simulates a Timestop, but the NPCs are all doing their idle animations and I’m not sure how to stop them. Maybe need to, like, ApplySpellRES() each one with a spell applying op165? Or maybe need an invisible creature to cast an area-effect spell? I had a version where Charname is scripted to cast an area-effect spell, but even with ReallyForceSpell and casting time 0, it has a casting animation, which I don’t want. So, four things on the to-do list. 

EDIT - cripes. Why is there a MakeaUnselectable() script action but no MakeSelectable() script action??

I can't figure out why Charname is remaining unselectable when the game moves to BG2. Relatedly, I can't figure out how Imoen/Jaheira/Minsc are made selectable when moved to AR0602.

Edited by subtledoctor
Link to comment
Posted (edited)

Part 8: Man in the Mirror

Okay! This bit was suuuper fiddly. In Part 7 we handled the modified transition from the end of BG1 into SoD; here we handle the alternative path, if you choose by dialogue to skip SoD and stay in Baldur's Gate, in which case a series of unfortunate events cut scenes will take you to the very last scenes of SoD, and thence directly into BG2. This is primarily a mod for EET, and the goal is to really integrate this transition into the game. In the old days, playing BG1 and then BG2, there was this wide gulf between the two games. What was happening in between? How much time passed? But here, I want it to be really seamless. Playing through this transition should feel like you are just playing more of BG1: some events happen out of your control, and you are falsely arrested, and you end up gathering your friends in a dungeon and fighting your way out. That is basically exactly what happens in Candlekeep -  Imoen even refers back to that, saying "we'll get out and clear our names, just like we did in Candlekeep!" Just as the mod brings part of SoD forward into BG1, it should feel like it brings Chateau Irenicus forward into BG1 - thereby adding narrative 'oomph' to the moment you emerge in Waukeen's Promenade in Athkatla and realize everything has changed, and there is no way back home.

I also tested compatibility with EndlessBG1 here, which added to the fiddly-ness. I made changes to earlier Parts for compatibility, but it is not easy to amend the posts in this thread, so I will let those stand for now. The updated code is in the Github repository.

I will outline what is happening here with the plot, but I'll put it in spoiler tags in case any readers want to play the mod and find out in-game:

Spoiler

If you tell the Dukes you don't want to go on the SoD campaign, Captain Gregson will run in and tell everyone that you have confessed to Entar Silvershield's murder and you are in custody. Except, obviously you are not. The first thought on everyone's mind is, doppelgangers. So you and the dukes travel to the FF headquarters to find out. When you get there, you find a perfect copy of Charname in a holding cell. Liia casts some divination spells, and she determines that it is not a doppelganger or other shapeshifter, and not an illusionary effect. It appears to actually be... you! While this is going on, a Timestop spell is cast, and you and the clone abruptly switch places. Suddenly you are in the cell, with no equipment and no party members, and everyone thinks you are the clone and the clone is you. They leave and offer to give the clone lodgings in the Ducal Palace, leaving you alone and imprisoned.

After a while, Imoen appears and is flustered. She says you have a attacked the guards in the palace, trying to reach the dukes. They thought the clone was left in the cell but now everyone is confused. You convince Imoen you are really you (with a kind of silly callback... er, call-ahead?... to the BG2 Harper Base plot) and she springs you from jail. You must escape the Flaming Fist, and then hopefully when the dust settles you can clear your name. So you travel through the sewers to the city exterior, where you meet Jaheira/Khalid/Minsc/Dynaheir, and then the six of you are ambushed. After that, well, it's time for more...experiments.

I removed the final mustache-twirling conversation with the Hooded Man, in part because it doesn't work here - there are voiced lines referring to Skie's death - and in part because i don't think it makes sense for Irenicus to expose his plans so readily. As I said above playing this way sends you fairly immediately into Chateau Irenicus, where you will find Rielev, cloning tanks, a crazed copy of Ellesime, and a demon knight with a shard of the Mirror of Opposition. I'm not planning to spell everything out, but rather just leave some breadcrumbs that can make you realize that there have been hints of this happening since mid-BG1. Irenicus has been working on this plan for longer than you realized.

So: first thing, we need to copy in a bunch of stuff:

Spoiler
ACTION_IF !(GAME_IS ~eet~) BEGIN
  COPY ~%MOD_FOLDER%/data/switcheroo/d50104.are~ ~override~
  COPY ~%MOD_FOLDER%/data/switcheroo/d50105.are~ ~override~
  COPY ~%MOD_FOLDER%/data/switcheroo/d56000.are~ ~override~
END
ACTION_IF (GAME_IS ~eet~) BEGIN
  COPY ~%MOD_FOLDER%/data/switcheroo/d50104_eet.are~ ~override/d50104.are~
  COPY ~%MOD_FOLDER%/data/switcheroo/d50105_eet.are~ ~override/d50105.are~
  COPY ~%MOD_FOLDER%/data/switcheroo/d56000_eet.are~ ~override/d56000.are~
END
COPY ~%MOD_FOLDER%/data/switcheroo/d5bdimo.cre~ ~override~
COPY ~%MOD_FOLDER%/data/switcheroo/d5chrnam.cre~ ~override~
COPY ~%MOD_FOLDER%/data/switcheroo/d5telbgt.cre~ ~override~
COPY ~%MOD_FOLDER%/data/switcheroo/d5bracs.itm~ ~override~
COPY ~%MOD_FOLDER%/data/switcheroo/d5_div.spl~ ~override~
COPY ~%MOD_FOLDER%/data/switcheroo/d5pause.spl~ ~override~
COPY ~%MOD_FOLDER%/data/switcheroo/d5pausx.spl~ ~override~

COPY ~%MOD_FOLDER%/data/switcheroo/d50104.baf~ ~weidu_external/%MOD_FOLDER%/compile/d50104.baf~
COMPILE ~weidu_external/%MOD_FOLDER%/compile/d50104.baf~
COPY ~%MOD_FOLDER%/data/switcheroo/d50105.baf~ ~weidu_external/%MOD_FOLDER%/compile/d50105.baf~
COMPILE ~weidu_external/%MOD_FOLDER%/compile/d50105.baf~
COPY ~%MOD_FOLDER%/data/switcheroo/d56000.baf~ ~weidu_external/%MOD_FOLDER%/compile/d56000.baf~
COMPILE ~weidu_external/%MOD_FOLDER%/compile/d56000.baf~ EVALUATE_BUFFER
COPY ~%MOD_FOLDER%/data/switcheroo/d5bdimo.baf~ ~weidu_external/%MOD_FOLDER%/compile/d5bdimo.baf~
COMPILE ~weidu_external/%MOD_FOLDER%/compile/d5bdimo.baf~
COPY ~%MOD_FOLDER%/data/switcheroo/d5cut64.baf~ ~weidu_external/%MOD_FOLDER%/compile/d5cut64.baf~
COMPILE ~weidu_external/%MOD_FOLDER%/compile/d5cut64.baf~
COPY ~%MOD_FOLDER%/data/switcheroo/d5telbgt.baf~ ~weidu_external/%MOD_FOLDER%/compile/d5telbgt.baf~
COMPILE ~weidu_external/%MOD_FOLDER%/compile/d5telbgt.baf~ EVALUTATE_BUFFER

The .ARE files are copies of BD0104, BD0105, and BD6000 which are the Flaming Fist headquarters and sewers/cave from the end of SoD. I made clones with a few adjustments (a guard in a different place here, a different container there) so that the original SoD areas will work perfectly if you play through SoD. After reporting Sarevok's death, if you tell the dukes you want to stay in the city and skip SoD, a cut scene will bring you to my modified areas; but after passing through the sewers and underground lake, you will go to the actual SoD exterior area and do the normal transition from SoD to BG2.

I made different versions of the areas for BGEE/SoD and for EET, only because a few info points had strings that are not super easy to modify on the fly. D50104.baf, D50105.baf, and D56000.baf are just slightly modified versions of the area scripts for the original 'BD' versions of those ares. The only additions are a cut scene in D50104, which I will outline a bit later, and some handling for Imoen in D50105 and D56000. D5CUT64.baf is a slightly modified version of BDCUT64.bcs, and D5TELBGT.baf is a modified version of K#TELBGT.bcs, which is a helper creature and associated script created by k4thos for EET's transition from SoD to the BG2 campaign.

Next we will modify the Ducal Palace are script, again (I think that has happened about five different times in the course of this), to trigger two cut scenes: one where Captain Gregson enters, and one where everyone leaves and goes to the FF HQ:

Spoiler
<<<<<<<< d5/ar108+8.baf
IF
	Global("D5GregsonCut","GLOBAL",0)
	Global("D5GregsonPalace","GLOBAL",1)
THEN
	RESPONSE #100
		SetGlobal("D5GregsonCut","GLOBAL",1)
		SetGlobal("SOD_fromimport","global",0)
		SetGlobal("ENDOFBG1","GLOBAL",1)
		CreateCreature("D5GREGS",[520.615],E)
		ClearAllActions()
		StartCutSceneMode()
		StartCutScene("D5GRCUT1")
END

IF
	Global("D5CloneCut","GLOBAL",1)
	Global("D5GregsonPalace","GLOBAL",1)
THEN
	RESPONSE #100
		CreateCreature("D5TELBGT",[670.465],W)
		SetGlobal("D5CloneCut","GLOBAL",2)
		ClearAllActions()
		StartCutSceneMode()
		StartCutScene("D5CLCUT1")
END
>>>>>>>>
COPY ~d5/ar108+8.baf~ ~weidu_external/%MOD_FOLDER%/compile/ar108+8.baf~
EXTEND_TOP ~%bg1_area_prefix%0108.BCS~ ~weidu_external/%MOD_FOLDER%/compile/ar108+8.baf~

// grcut1 = gregson run in and say charname is in custody

<<<<<<<< d5/d5grcut1.baf
IF
	True()
THEN
	RESPONSE #100
		CutSceneId("D5GREGS")  // Captain Gregson
		DisplayStringHead(Myself,"Lord Entar! You must come quickly! Oh, hello everyone...")  // Lord Entar! You must come quickly! Oh, hello everyone...
		MoveToPoint([640.465])
		Wait(1)
		SetGlobal("D5CloneCut","GLOBAL",1)
		EndCutSceneMode()
		ActionOverride("D5GREGS",StartDialogueNoSet(Player1))
END
>>>>>>>>
COPY ~d5/d5grcut1.baf~ ~weidu_external/%MOD_FOLDER%/compile/d5grcut1.baf~
COMPILE ~weidu_external/%MOD_FOLDER%/compile/d5grcut1.baf~

// clcut1 = everyone leave the palace
 
<<<<<<<< d5/d5clcut1.baf
IF
	True()
THEN
	RESPONSE #100
		CutSceneId(Player1)
		ActionOverride("D5GREGS",EscapeAreaObject("Door0200"))
		ActionOverride("BDENTAR",EscapeAreaObject("Door0200"))
		ActionOverride("BELT",EscapeAreaObject("Door0200"))
		ActionOverride("LIIA",EscapeAreaObject("Door0200"))
		Wait(1)
		MoveToPoint([460.715])
		FadeToColor([20.0],0)
		LeaveAreaLUAPanic("d50104","",[805.760],S)
		LeaveAreaLUA("d50104","",[805.760],S)
		EndCutSceneMode()
END
>>>>>>>>
COPY ~d5/d5clcut1.baf~ ~weidu_external/%MOD_FOLDER%/compile/d5clcut1.baf~
COMPILE ~weidu_external/%MOD_FOLDER%/compile/d5clcut1.baf~

That gets Gregson, the dukes, and Charname to the Flaming Fist jail; notably, all other party members are left behind in the palace.

Once in the jail a series of cut scenes need to be string together, connected by dialogues: everyone walks to the relevant cell, then discusses the matter, then Liia casts a divination spell, then there is the Timestop, then more dialogue and another divination, and then finally everyone walks away, leaving you alone:

Spoiler
<<<<<<<< d5/d5clcut2.baf
IF
	True()
THEN
	RESPONSE #100
		CutSceneId(Player1)
		OpenDoor("door03")
		CreateCreatureCopyPoint("D5CHRNAM",Player1,[410.340]) 
		CreateCreature("D5GREGS",[745.680],W)  
		CreateCreature("BDENTAR",[775.700],W) 
		CreateCreature("BELT",[855.705],W) 
		CreateCreature("LIIA",[810.720],W) 
//		GiveItemCreate("D5BRACS","D5CHRNAM",1,0,0) 
//		XEquipItem("D5BRACS","D5CHRNAM",SLOT_GAUNTLETS,EQUIP) 
		FadeFromColor([20.0],0)
//		MoveViewPoint([805.760],INSTANT)
		SmallWait(9)
		MoveViewPoint([345.450],VERY_FAST)
		ActionOverride("D5GREGS",MoveToPoint([315.425]))
		SmallWait(7)
		ActionOverride("BDENTAR",MoveToPoint([260.455]))
		SmallWait(10)
		ActionOverride("LIIA",MoveToPoint([345.445]))
		Wait(1)
		ActionOverride("BELT",MoveToPoint([380.460]))
		Wait(1)
		MoveToPoint([330.470])
		Wait(1)
		EndCutSceneMode()
		ActionOverride("BELT",StartDialogueNoSet(Player1))
END
>>>>>>>>
COPY ~d5/d5clcut2.baf~ ~weidu_external/%MOD_FOLDER%/compile/d5clcut2.baf~
COMPILE ~weidu_external/%MOD_FOLDER%/compile/d5clcut2.baf~

// clcut3 = liia casts a divination spell

<<<<<<<< d5/d5clcut3.baf
IF
	True()
THEN
	RESPONSE #100
		CutSceneId(Player1)
		Wait(2)
		ActionOverride("LIIA",ForceSpellRES("D5_DIV","D5CHRNAM"))  // No such index
		Wait(2)
		CreateVisualEffectObject("SPSTRENH","D5CHRNAM")  // No such index
		Wait(2)
		EndCutSceneMode()
		ActionOverride("LIIA",StartDialogueNoSet(Player1))
END
>>>>>>>>
COPY ~d5/d5clcut3.baf~ ~weidu_external/%MOD_FOLDER%/compile/d5clcut3.baf~
COMPILE ~weidu_external/%MOD_FOLDER%/compile/d5clcut3.baf~

// clcut4 = timestop and switch places, followed by another liia divination
/*
<<<<<<<< d5/d5clcut4.baf
IF
	True()
THEN
	RESPONSE #100
		CutSceneId(Player1)
		Wait(2)
		ApplySpellRES("D5PAUSE","D5GREGS") 
		ApplySpellRES("D5PAUSE","BELT") 
		ApplySpellRES("D5PAUSE","LIIA") 
		ApplySpellRES("D5PAUSE","BDENTAR") 
		AddAreaFlag(DREAMAREA)
		ActionOverride(Player2,MakeUnselectable(1))
		ActionOverride(Player3,MakeUnselectable(1))
		ActionOverride(Player4,MakeUnselectable(1))
		ActionOverride(Player5,MakeUnselectable(1))
		ActionOverride(Player6,MakeUnselectable(1))
		Wait(3)
		JumpToPoint([420.340])
		MoveViewPoint([405.360],INSTANT)
		ActionOverride("D5CHRNAM",JumpToPoint([320.490]))
		ActionOverride("K#ImportContainer",TakeCreatureItems(Player1,ALL))
		Wait(2)
		RemoveAreaFlag(DREAMAREA)
		Wait(1)
		ApplySpellRES("D5PAUSX","BDFF1002") 
		ApplySpellRES("D5PAUSX","D5GREGS") 
		ApplySpellRES("D5PAUSX","BELT") 
		ApplySpellRES("D5PAUSX","LIIA") 
		ApplySpellRES("D5PAUSX","BDENTAR") 
		Wait(1)
		ActionOverride("LIIA",DisplayStringHead(Myself,@80035))  // Apologies, whoever you are, this might sting a bit.
		Wait(1)
		ActionOverride("LIIA",ForceSpellRES("D5_DIV",Player1))
		Wait(2)
		CreateVisualEffectObject("ICGLYPTI",Myself)
		Wait(1)
		PlayDead(15)
		Wait(1)
		CreateCreature("D5TELBGT",[445.320],W)
		EndCutSceneMode()
		ActionOverride("LIIA",StartDialogueNoSet(Player1))
END
>>>>>>>>
COPY ~d5/d5clcut4.baf~ ~weidu_external/%MOD_FOLDER%/compile/d5clcut4.baf~
COMPILE ~weidu_external/%MOD_FOLDER%/compile/d5clcut4.baf~
*/

// clcut5 = everyone leaves, you are stuck

<<<<<<<< d5/d5clcut5.baf
IF
	True()
THEN
	RESPONSE #100
		CutSceneId(Player1)
		Wait(1)
		ActionOverride("D5GREGS",EscapeAreaNoSee())
		ActionOverride("BDENTAR",EscapeAreaNoSee())
		ActionOverride("BELT",EscapeAreaNoSee())
		ActionOverride("LIIA",EscapeAreaNoSee())
		ActionOverride("D5CHRNAM",EscapeAreaNoSee())
		Wait(1)
		ActionOverride("witness",DestroySelf())
		ActionOverride("witness_guard",DestroySelf())
		ActionOverride("bdbence",DestroySelf())
		ActionOverride("bence_guard",DestroySelf())
		ActionOverride("bdeltan",DestroySelf())
		ActionOverride("Entar Guard 1",DestroySelf())
		ActionOverride("Entar Guard 2",DestroySelf())
		PlaySound("AMBDLBOO")
		Wait(2)
		MultiPlayerSync()
		Wait(1)
		CloseDoor("door01")
		CloseDoor("door02")
		CloseDoor("door07")
		CloseDoor("door08")
		Lock("door02")
		Lock("door07")
		Lock("door08")
		TriggerActivation("InfoBDStairs",FALSE)
		TriggerActivation("Infobdstairs_epilogue",TRUE)
		TriggerActivation("TrD50105",TRUE)
		AddAreaType(CANRESTOTHER)
		ReallyForceSpellRES("bdremove",Myself)  // No such index
		SmallWait(5)
		CreateCreature("bdrefuge",[344.619],NE)  // Refugee
		CreateCreature("bdrefgm2",[472.677],NE)  // Refugee
		CreateCreature("bdclara",[600.738],NE)  // Clara
		CreateCreature("bdrefgf1",[648.474],SW)  // Refugee
		CreateCreature("bdrefgf2",[762.545],SW)  // Refugee
		SetGlobal("bd_plot","global",605)
		SetGlobal("D5CloneCut","GLOBAL",10)
		EndCutSceneMode()
END
>>>>>>>>
COPY ~d5/d5clcut5.baf~ ~weidu_external/%MOD_FOLDER%/compile/d5clcut5.baf~
COMPILE ~weidu_external/%MOD_FOLDER%/compile/d5clcut5.baf~

// imoen in sewer cave

<<<<<<<< d5/d5clcut6.baf
IF
	True()
THEN
	RESPONSE #100
		CutSceneId(Player1)
		SmallWait(9)
		ActionOverride("D5BDIMO",ForceSpellRES("SPWI206",Myself))  // Invisibility
		Wait(1)
		SetGlobal("bd_plot","global",641)
		ActionOverride("D5BDIMO",EscapeAreaNoSee())
		Wait(1)
		EndCutSceneMode()
END
>>>>>>>>
COPY ~d5/d5clcut6.baf~ ~weidu_external/%MOD_FOLDER%/compile/d5clcut6.baf~
COMPILE ~weidu_external/%MOD_FOLDER%/compile/d5clcut6.baf~

You can see I commented out CLCUT4.baf - the Timestop sequence cannot work as a cut scene, so instead I added it to the D50104 area script, using the SetCutSceneLite() script action:

Spoiler
IF
	Global("D5CloneCut","GLOBAL",6)
THEN
	RESPONSE #100
		SetGlobal("D5CloneCut","GLOBAL",7)
		ClearAllActions()
		SetCutSceneLite("true")
		Wait(2)
		ApplySpellRES("D5PAUSE","BDFF1002") 
		ApplySpellRES("D5PAUSE","d5gregs") 
		ApplySpellRES("D5PAUSE","BELT") 
		ApplySpellRES("D5PAUSE","LIIA") 
		ApplySpellRES("D5PAUSE","BDENTAR")
		SmallWait(5)
		AddAreaFlag(DREAMAREA)
		ActionOverride(Player2,MakeUnselectable(1))
		ActionOverride(Player3,MakeUnselectable(1))
		ActionOverride(Player4,MakeUnselectable(1))
		ActionOverride(Player5,MakeUnselectable(1))
		ActionOverride(Player6,MakeUnselectable(1))
		Wait(3)
		ActionOverride(Player1,JumpToPoint([420.340]))
		MoveViewPoint([405.360],INSTANT)
		ActionOverride("D5CHRNAM",JumpToPoint([320.490]))
		ActionOverride("K#ImportContainer",TakeCreatureItems(Player1,ALL))
		Wait(2)
		RemoveAreaFlag(DREAMAREA)
		Wait(1)
		ApplySpellRES("D5PAUSX","BDFF1002") 
		ApplySpellRES("D5PAUSX","D5GREGS") 
		ApplySpellRES("D5PAUSX","BELT") 
		ApplySpellRES("D5PAUSX","LIIA") 
		ApplySpellRES("D5PAUSX","BDENTAR") 
		Wait(1)
		ActionOverride("LIIA",DisplayStringHead(Myself,@80035))  // Apologies, whoever you are, this might sting a bit.
		Wait(1)
		ActionOverride("LIIA",ForceSpellRES("D5_DIV",Player1))
		Wait(2)
		CreateVisualEffectObject("ICGLYPTI",Myself)
		Wait(1)
		PlayDead(15)
		Wait(1)
		CreateCreature("D5TELBGT",[445.320],W)
		SetCutSceneLite("false")
		Wait(1)
		ActionOverride("LIIA",StartDialogueNoSet(Player1))
END

Very similar, but slightly different. The D5TELBGT creature runs an override script that moves all party inventory items into a container to be imported to BG2 as appropriate, and removes everyone from the party, leaving you alone.

Now we have the dialogues. Here again, I put everyone's added lines into a single .D file, so that the EXTERN references can all find each other. Here even more than earlier, most of the dialogue is expository in nature, with the NPCs talking among themselves and the player clicking through but not having much part in it.

Spoiler
<<<<<<<< d5/switch+.d
ADD_STATE_TRIGGER BELT 0 ~Global("D5CloneCut","GLOBAL",0)~

APPEND BELT

IF ~GlobalGT("D5GregsonCut","GLOBAL",0) Global("D5CloneCut","GLOBAL",0)~ BEGIN d5beltsw_0
  SAY  ~Calm down, man. Tell us what news is so urgent, and what is confusing you.~
  IF ~~ EXTERN D5GREGS d5gregsw_2
END

IF ~~ BEGIN d5beltsw_1
  SAY ~<CHARNAME> has been here with us for some time now. And came here after reportedly dispatching Sarevok <PRO_HIMHER>self.~
  IF ~~ EXTERN BDENTAR d5entarsw_1
END

IF ~~ BEGIN d5beltsw_2
  SAY ~Agreed. <CHARNAME>, you will accompany us. It would be in your own best interest, as well as ours, to clear this matter up once and for all.~
  IF ~~ REPLY ~Very well, we will travel there together.~ DO ~SetGlobal("D5CloneCut","GLOBAL",1)~ EXIT
END

IF ~Global("D5CloneCut","GLOBAL",3)~ BEGIN d5beltsw_4
  SAY ~By Helm! Gregson, you were not wrong. There are two of <PRO_HIMHER>!~
  IF ~~ EXTERN BDENTAR d5entarsw_2
END

IF ~~ BEGIN d5beltsw_5
  SAY ~Come now, <CHARNAME> has been dealing with us for some time now and has not indicated any hostility or danger to us. If I heard right, you yourself admitted to quite savagely murdering Lord Silvershield here.~
  IF ~~ EXTERN LIIA d5liiasw_1
END

IF ~~ BEGIN d5beltsw_6
  SAY ~By all means.~
  IF ~~ DO ~SetGlobal("D5CloneCut","GLOBAL",4)~ EXIT
END

IF ~Global("D5CloneCut","GLOBAL",7)~ BEGIN d5beltsw_7
  SAY ~Agreed. This is troubling. But nevertheless the matter seems in hand. We have some time to figure it out. Let us return to the palace. <CHARNAME>, we will give you lodgings there for the time being. We must impose on you to remain in our custody for a short time longer.~
  IF ~~ EXTERN D5CHRNAM d5chrnam_1
END

IF ~~ BEGIN d5beltsw_8
  SAY ~And as for that thing, it will stay here for now. The bars are strong, and the magical wards stronger. As <PRO_HESHE> surrendered and confessed, we will not take rash action. Once we know what <PRO_HESHE> is, we will decide <PRO_HISHER> fate.~
  IF ~~ DO ~SetGlobal("D5CloneCut","GLOBAL",8)~ EXIT
END

END

APPEND BDENTAR

IF ~Global("D5GregsonCut","GLOBAL",1)~ BEGIN d5entarsw_0
  SAY ~What? Who made that confession? Where is this person now? Out with it, man!~
  IF ~~ EXTERN D5GREGS d5gregsw_3
END

IF ~~ BEGIN d5entarsw_1
  SAY ~If we are to trust that report!~
  IF ~~ EXTERN LIIA d5liiasw_0
END

IF ~Global("D5CloneCut","GLOBAL",3)~ BEGIN d5entarsw_2
  SAY ~What kind of plot is this?? <CHARNAME>, explain yourself! Doppelgangers take faces after killing, they would not risk being caught out in the presence of their live victim.~
  IF ~~ REPLY @80026 EXTERN D5CHRNAM d5chrnam_0
END

END

APPEND LIIA

IF ~Global("D5GregsonCut","GLOBAL",1) GlobalLT("D5CloneCut","GLOBAL",3)~ BEGIN d5liiasw_0
  SAY ~Gentlemen. Rather than wonder and fight, I suggest we all go to the Flaming Fist headquarters and see for ourselves. Surely we will have this mystery solved in short order.~
  IF ~~ EXTERN BELT d5beltsw_2
END

IF ~Global("D5CloneCut","GLOBAL",3)~ BEGIN d5liiasw_1
  SAY ~Hm, most curious. This is indeed quite unlike the typical behavior of doppelgangers. If you gentlemen will indulge me, I have some divinations prepared which may shed light on the matter.~
  IF ~~ EXTERN BELT d5beltsw_6
END

IF ~Global("D5CloneCut","GLOBAL",5)~ BEGIN d5liiasw_2
  SAY ~This is perplexing indeed. The person in the cell is no shapeshifter, and does not appear illusionary or phantasmal in nature. I sense no magic at all; <PRO_HESHE> appears to be perfectly natural. <CHARNAME>, do you have a twin you never mentioned?~
  IF ~Global("D5heritageRevealed","GLOBAL",0)~ REPLY ~Definitely not. The closest thing I have to a sibling is Imoen.~ GOTO d5liiasw_3
  IF ~Global("D5heritageRevealed","GLOBAL",1)~ REPLY ~Definitely not. The closest thing I have to a sibling is, I suppose, Sarevok.~ GOTO d5liiasw_3
END

IF ~~ BEGIN d5liiasw_3
  SAY ~Hm. Let me try something a bit more involved. The body may give no answers, but I have a more powerful spell that can inspect <PRO_HISHER> aura, giving some indication of <PRO_HISHER> mind and soul. Apologies, whoever you are, this might sting a bit.~
@80035  = ~Apologies, whoever you are, this might sting a bit.~
  IF ~~ DO ~SetGlobal("D5CloneCut","GLOBAL",6)~ EXIT
END

IF ~Global("D5CloneCut","GLOBAL",7)~ BEGIN d5liiasw_4
  SAY ~I am beginning to be frustrated. All my divinations are telling me that this person IS, fully, <CHARNAME>. Not a mimic of any sort, nor even an identical twin. But of course that cannot be. Belt, we should consult with the priests of Helm, and I can look into whether we have any scrolls of some rarer divination that might penetrate... whatever this is.~
  IF ~~ EXTERN BELT d5beltsw_7
END

END

APPEND D5GREGS

IF ~Global("D5GregsonCut","GLOBAL",1)~ BEGIN d5gregsw_0
  SAY ~Lord Entar! You must come quickly! Oh, hello everyone...~
  IF ~~ GOTO d5gregsw_1
END

IF ~~ BEGIN d5gregsw_1
  SAY ~Wait - what is <CHARNAME> doing here?? I just saw you...~
  IF ~~ EXTERN BELT d5beltsw_0
END

IF ~~ BEGIN d5gregsw_2
  SAY ~Alright, sir. I rushed here to find Lord Entar, to tell you that someone has confessed to the attack on your person, that, um, killed you. Temporarily, I suppose. But still.~
  IF ~~ EXTERN BDENTAR d5entarsw_0
END

IF ~~ BEGIN d5gregsw_3
  SAY ~Well, that's the thing, sir. It... well, it is <CHARNAME>. Walked right into Headquarters, said something about the scheme being undone with Sarevok dead, and <PRO_HESHE> wanted to repent. I put <PRO_HIMHER> into a cell, and came straight here to inform you. Only, now I see <CHARNAME> before me... but how? That cell is warded against magical escape!~
  IF ~~ EXTERN BELT d5beltsw_1
END

END

BEGIN ~D5CHRNAM~

IF ~~ BEGIN d5chrnam_0
  SAY ~Grand Dukes! What are you doing with that pretender! Your lives are in danger! You must believe me, I have voluntarily surrendered myself!~
  IF ~~ EXTERN BELT d5beltsw_5
END

IF ~Global("D5CloneCut","GLOBAL",7)~ BEGIN d5chrnam_1
  SAY ~Of course, Lord Belt. I understand completely and I will comply.~
  IF ~~ REPLY @80039 EXTERN BELT d5beltsw_8
END

BEGIN ~D5BDIMO~

IF ~Global("D5CloneCut","GLOBAL",11)~ BEGIN d5imoensw_0
  SAY ~<CHARNAME>! I had to come... I had to see. I - please, tell me, what is going on here? Which one are you?~
  IF ~Alignment(Player1,MASK_GOOD)~ REPLY ~I am me!~ GOTO d5imoensw_1
  IF ~Alignment(Player1,MASK_GENEUTRAL)~ REPLY ~I am me!~ GOTO d5imoensw_1
  IF ~Alignment(Player1,MASK_EVIL)~ REPLY~I am me!~ GOTO d5imoensw_2
END

IF ~~ BEGIN d5imoensw_1
  SAY ~That's what the other one said too! But now <PRO_HESHE> is slaughtering the palace guards. It's not like you, it makes no sense! Why attack the dukes now?~
  IF ~~ REPLY ~Imoen, what do you mean? What is happening at the palace? Get me out of here, I can help!~ GOTO d5imoensw_3
END

IF ~~ BEGIN d5imoensw_2
  SAY ~That's what the other one said too! But now <PRO_HESHE> is slaughtering the palace guards. You could always be violent, but this makes no sense! Why attack the dukes now?~
  IF ~~ REPLY ~What are you talking about? What is happening at the palace? Help me, I need to get out of here!~ GOTO d5imoensw_3
END

IF ~~ BEGIN d5imoensw_3
  SAY ~I wish I could believe you, really. But how can I be sure? Everything is crazy! Please <CHARNAME>, help me believe you. Tell me something no one else would know! Wait - what's me favorite color? What did I tell you when we were little? Please...~
  IF ~~ REPLY ~I remember. You told me you love pink, but you also love black. You said you like them together, how deep black will take in the surrounding colors, but it makes the pink next to it brighter, stronger. I always though that was a weird thing for a little kid to say.~ GOTO d5imoensw_4
END

IF ~~ BEGIN d5imoensw_4
  SAY ~Yeah, well I was a smart kid! Oh <CHARNAME>, it really is you! Thank Tymora! But, huh. How did you get in there in the first place?? Ooooh... did you kill Entar?? Wait, then who killed Sarevok?~
  IF ~~ REPLY ~I did! I mean, the Sarevok part. Imoen, I don't know what happened. I switched places, somehow, earlier today. I was over there, and I blinked, and I was here. I didn't feel myself teleporting or anything like that. Just, one moment I was there and the next moment the whole world was turned upside-down. What could do that?~ GOTO d5imoensw_5
END

IF ~~ BEGIN d5imoensw_5
  SAY ~Whoa. That's weird. I've read a little about super-strong reality-bending magic. Like, stuff from Netheril. But I've never seen anyone actually use it? As much power as we've attained, we're still not even close to that level of magic.~
  IF ~~ GOTO d5imoensw_6
END

IF ~~ BEGIN d5imoensw_6
  SAY ~But listen, we can figure it out later. There are people calling for your head. We need to get out of here, and regroup somewhere safe, then we can clear your name. Just like Candlekeep! You did it once, you can do it again.~
  IF ~~ REPLY ~Can you help me escape? These bars are enchanted, they are too strong for me no matter what I do.~ GOTO d5imoensw_7
END

IF ~~ BEGIN d5imoensw_7
  SAY ~Of course, you old buffle-head! This cell may be locked and magicked, but you know that can't stop me! I'll open the cell, then follow me. There's a secret passage into the sewers, right in this building. It's, well, don't ask me how I found it out. Just follow me. We can talk more after we get away.~
  IF ~~ DO ~OpenDoor("Door04") SetGlobal("D5CloneCut","GLOBAL",12)~ EXIT
END

IF ~Global("D5CloneCut","GLOBAL",12) AreaCheck("d50104")~ BEGIN d5imoensw_8
  SAY ~Come on, we have to get to the basement. Hurry up!~
  IF ~~ EXIT
END

IF ~GlobalLT("bd_plot","global",625) Global("D5CloneCut","GLOBAL",12) AreaCheck("d50105")~ BEGIN d5imoensw_9
  SAY ~Here's the secret passage. Let's go!~
  IF ~~ EXIT
END

IF ~GlobalLT("bd_plot","global",641) Global("D5CloneCut","GLOBAL",12) AreaCheck("d56000")~ BEGIN d5imoensw_10
  SAY ~I'm going to scout ahead. Supposedly we have to go through a waterfall. Or maybe, over a waterfall? Hopefully it's a small one! Anyway, just follow the water and get to the outside. I'll meet you at the exit.~
  IF ~~ DO ~SetGlobal("D5ImoenCaveCut","GLOBAL",1)~ EXIT
END

ALTER_TRANS BDIMOEN // file name
  BEGIN 92 END // state number
  BEGIN 3 END // transition number
  BEGIN "TRIGGER" ~Global("D5SkipSoD","GLOBAL",0)~ END

ALTER_TRANS BDIMOEN // file name
  BEGIN 100 END // state number
  BEGIN 0 1 2 3 4 END // transition number
  BEGIN "TRIGGER" ~Global("D5SkipSoD","GLOBAL",0)~ END
>>>>>>>>
COPY ~d5/switch+.d~ ~weidu_external/%MOD_FOLDER%/compile/switch+.d~

We use a copy of Imoen to guide you through my custom areas, but you meet the vanilla BDIMOEN.cre once you get out of the sewers; the final ALTER_TRANS commands there are some slight modifications to BDImoen's dialogue lines to exclude reference to Castle Dragonspear.

Also note, in that quoted code I have not yet COMPILE'd the .D file! That is because some adjustments need to be made if EndlessBG1 is installed:

Spoiler
// compatibility with EBG1 

ACTION_IF (MOD_IS_INSTALLED ~c#endlessbg1.tp2~ ~0~) BEGIN

 OUTER_SET liia_ebg1_10 = STATE_WHICH_SAYS 10 IN ~c#endlessbg1/translations/%s/dialogues.tra~ FROM ~LIIA~

 PRINT ~the state we want NOW is # %liia_ebg1_10%~

 APPEND_OUTER ~weidu_external/%MOD_FOLDER%/compile/switch+.d~ ~~~~~
 ADD_STATE_TRIGGER LIIA %liia_ebg1_10% ~Global("D5GregsonExist","GLOBAL",0)~
~~~~~
 
END	//	end EBG1 #0

//  now compile the dialogues

COMPILE ~weidu_external/%MOD_FOLDER%/compile/switch+.d~

EndlessBG1's main component adds a dialogue line to Liia that can interrupt our Timestop cut scene. This code finds that dialogue line using STATE_WHICH_SAYS, and then adds a conditional trigger to it such that it will stay out of the way of this mod's content. I have a habit: rather than just writing .BAF scripts and applying COMPILE commands, I copy the uncompiled .BAF file to a working directory in /weidu_external. This way 1) I can find and read the script without having to decompile it or open it in NI; and 2)  I can APPEND_OUTER various things to the script as needed, with ACTION_IF conditions in Weidu. Then I compile the .D file. As I said, I have added a couple instance of similar treatment to earlier parts of the mod - I think Part 5 and Part 7? And I am happy to say that, at least as of my testing last night, this is compatible with most of EndlessBG1!

Finally, a couple odds and ends. Some of the dialogue in the ambush scene needs to be rewritten to exclude mention of Skie or Dragonspear; and something about this transition to the BG2 campaign might preempt k4thos' script to un-fatigue Charname in Chateau Irenicus, so I will add an extra bit of scripted insurance there:

Spoiler
// clean up people's dialogue at ambush

ACTION_IF (GAME_IS ~bgee~) BEGIN
  STRING_SET 39703 ~I'm sorry, <CHARNAME>. I shouldn't have let you get into this kind of trouble. But now we're together again, I'm sure we will clear everything up.~
  STRING_SET 39716 ~Do not th-think I'm pleased to be here, <CHARNAME>. What I do, I do for Gorion and Imoen.~
  STRING_SET 39706 ~You make it sound as though I went looking for trouble.~
END
ACTION_IF (GAME_IS ~eet~) BEGIN
  STRING_SET 239703 ~I'm sorry, <CHARNAME>. I shouldn't have let you get into this kind of trouble. But now we're together again, I'm sure we will clear everything up.~
  STRING_SET 239716 ~Do not th-think I'm pleased to be here, <CHARNAME>. What I do, I do for Gorion and Imoen.~
  STRING_SET 239706 ~You make it sound as though I went looking for trouble.~
END


// make sure charname is not overly fatigued in Chateau Irenicus

ACTION_IF (GAME_IS ~eet~) BEGIN
 <<<<<<<< d5/d5nu602.baf
 IF
	CheckStatGT(Player1,30,0)
	Global("P1RestFix","GLOBAL",0)
 THEN
	RESPONSE #100
		SetGlobal("P1RestFix","GLOBAL",1)
		ActionOverride(Player1,Rest())
 END
 >>>>>>>>
 COPY ~d5/d5nu602.baf~ ~weidu_external/%MOD_FOLDER%/compile/d5nu602.baf~

 ACTION_IF (FILE_EXISTS_IN_GAME ~ar0602.bcs~) BEGIN
  EXTEND_TOP ~ar0602.bcs~ ~weidu_external/%MOD_FOLDER%/compile/d5nu602.baf~
 END
END

And that's it! In the Github repo, I have combined parts 2 through 8 into a single component, and the mod is fully playable and compatible with most of the components of EndlessBG1. I tested with EndlessBG1 components:

  • #0 main component
  • #1 more flavor hero of baldur's gate
  • #2 short public hero tribute
  • #3 sarevok's unique items
  • #4 sarevok's sword
  • #6 duke eltan is in the palace
  • #8/9 elminster makes an appearance
  • #10 first refugees in baldur's gate
  • #11 ophyllis is in the palace
  • #12 denkod comments on sarevok's death
  • #13 skip the maze after sarevok's death
  • #15 fenster is in the palace
  • #16 corwin is in the palace

Note, however, that some EndlessBG1 content will be preempted by this mod. For example, some of EndlessBG1's dialogue has the dukes really fawning over you as the big hero; with this mod, they are more ambivalent about you and don't fully trust you. So in EndlessBG1 Belt says something like “let us celebrate the hero of Baldur’s Gate!” and then has the tribute cut scene; with EndlessBG1 + this mod, Belt says “I don’t know if you are really a hero, but the people need a hero so you can play the part” and then it kicks out to the EndlessBG1 tribute scene. The dialogue is a bit different but the mod content is retained and integrated. 

I do not recommend, and have not tested, EBG1 #5 "Imoen and Duke Jannath," since this mod take great pains to bring Imoen into the palace and install her there with Liia Jannath. There is no need for another mod to do something similar. You can probably install #7 "Flaming Fist after Sarevok Fight" but it will not make much sense because a plot point in this mod is that the dukes do not have access to the Undercity Temple and do not really know what happened in that fight. And it makes no sense to install #14 "Korlasz' Dungeon in BG1" since this mod does the same thing.

Honestly, I think I am going to write up a Readme and release this as an open beta. There is one more thing I would like to do: alter the end of SoD so that it uses this Part 8 transition to BG2 instead of the way it works in vanilla SoD. And I have a small idea to modify the scene with the feyr at the top of Bridgefort. But for now, limiting the scope to what happens at the end of the BG1 campaign, this is basically feature-complete. So why not let people kick the tires.

Thanks for following along! Cheers.

Edited by subtledoctor
Link to comment

Could you summarize in a nutschell what the actual content of the mod is - or link me to a post where it is summarized, and sorry that I missed it. I thought this is about putting the SoD content / Caelar etc. as quests into the end of BG1, but now you mention a transition to SoD, so I am confused.

And, kudos to making it compatible with EndlessBG1.

Link to comment
Posted (edited)
6 hours ago, jastey said:

Could you summarize in a nutschell what the actual content of the mod is - or link me to a post where it is summarized, and sorry that I missed it. I thought this is about putting the SoD content / Caelar etc. as quests into the end of BG1, but now you mention a transition to SoD, so I am confused

 

  1. It adds some content (mostly dialogue) to stretch out the end of BG1;
  2. It brings some existing SoD content forward into BG1 for the same purpose; and
  3. It offers a dialogue option to skip SoD and go right to BG2, with added story content to make that work with BG2’s description of leaving Baldur’s Gate “under circumstances much darker than anyone would have believed" and leave hints of Irenicus' involvement earlier than the vanilla game would suggest.

Consequently, the transitions from the BG1 campaign to SoD and to BG2 need to be modified to make sure those 3 things work. 

I’m working on a Readme now with a proper description, and I will post it in the Miscellaneous Mods forum. 

Edited by subtledoctor
Link to comment
4 hours ago, subtledoctor said:

 

  1. It adds some content (mostly dialogue) to stretch out the end of BG1;
  2. It brings some existing SoD content forward into BG1 for the same purpose; and
  3. It offers a dialogue option to skip SoD and go right to BG2, with added story content to make that work with BG2’s description of leaving Baldur’s Gate “under circumstances much darker than anyone would have believed" and leave hints of Irenicus' involvement earlier than the vanilla game would suggest.

Written like this it could be EndlessBG1. :p

OK, I'll wait for the readme.

Link to comment

Well, it’s odd: the idea has taken a lot of twists and turns. The genesis of it came from speaking with @morpheus562 and others about, of all things, making a story mod for the Throne of Bhaal expansion campaign. That’s actually how I came up with the “Reflections of Destiny” name. I was playing SoD at the time, and while various mods (mostly yours) improve it a lot, it is still deeply flawed. But some of the army stuff and large battles are amazing. Meanwhile ToB is supposed to be about these warlords with big armies, but has almost no large-scale combat. So we discussed cannibalizing the SoD areas and content for use in ToB

To achieve that requires changing the end of BG1, skipping SoD. But some parts of SoD don’t need to be cannibalized for ToB: Korlasz’ Dungeon is completely different from the rest of SoD, in both content and location; and the ambush scene at the end would also be inappropriate for ToB, and obviously fits very well for the transition to BG2. So I figured I could bring those two scenarios forward to BG1 and leave the rest of SoD to be used elsewhere. 

Then I played Durlag's Tower and the Brandock mod, and had the idea for a clone of Charname, to tie that BG1 content to the stuff in Irenicus’ lair under Athkatla. 

All that was still a bit pie-in-the-sky, but I now have enough experience that it seems feasible. So why not try, and talk about the process of turning a pie-in-the-sky idea into a finished product. Maybe this would make other ideas - for a ToB mod, for instance - seem less sketchy. (If anyone wants to actually collaborate on reusing the SoD content elsewhere, maybe that could even be done in this very mod!)

So, tl;dr: it covers some of the sane ground as EndlessBG1 from a technical standpoint, but I think has a distinctly different vision. 

Link to comment
Posted (edited)

Other areas to adjust/repurpose for ToB could be Dorn's, Rasaad's, Hexxat's, and Neera's ToB quests. All introduce new areas that could expand upon the scope for ToB and provide opportunities to either remove threats or recruit new allied factions to the player's war effort against their siblings' armies. The roster of allied armies to recruit or factions to defeat would be: Red Wizards (Neera), Dwarven Stronghold (Rasaad),  Lunia (Dorn), and powerful undead (Hexxat).

Dorn's character arc would not be impacted by repurposing his quest and memory serves it is the same for Hexxat. Rasaad would probably require a rewrite of his BG2 quest to defeat Algoroth at the end so he can have his closure. I have not completed Neera's ToB quest, so I do not know how that would need to be adjusted for her character arc.

In my mind, I would envision the first or second act of ToB to be the recruitment of your own army to march against your rival siblings.

Edited by morpheus562
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...