Skip to content

Modding chapter transitions and dreams in BG:EE so the main plot is more flexible

The_Baffled_KingThe_Baffled_King Member Posts: 147
edited April 2021 in General Modding
EDIT: I've added code formatting to the spoilered code.

I made a post on this topic in the 'General mod Questions' thread, here:

https://forums.beamdog.com/discussion/67382/general-mod-questions-thread/p70

Perhaps not getting a response is a bad sign, but I'm gonna indulge myself with a thread of my own. Note that what I write below is also on Gibberlings3, so if you've seen it there then save your eyes!

Since posting in 'General mod Questions', Kjeron kindly clarified a couple of things at Gibberlings3, and I've poked about some more and “solved” my problem (sort of, and not with Weidu). The script works in the game when added using Near Infinity. But there is probably a lot wrong with the language, and my solution is unsatisfactory in some respects, so any help is greatly appreciated.


Before posting my code, I should note that I’m operating on a number of assumptions which could be wrong, so it would be great if anyone can tell me if they are wrong. My assumptions are spoilered:
(1) In order to have a functioning journal system advancing as it does in the vanilla game, with a separate section for each chapter, I have to use the CHAPTER global.

(2) It seems easier, and better, to advance the CHAPTER global via IncrementGlobal action rather than SetGlobal, and there doesn’t appear to be any downside to doing so.

(3) From Chapter 2 onwards, the game is hard-coded to play the dreams when the DREAM global is less than the CHAPTER globlal.

(4) If I cannot adapt the existing dream content and DREAM variable to fit my purposes, I have to effectively disable it by advancing the DREAM global when I advance the CHAPTER global.

(5) It is to some extent relatively easy to use the existing dream content and DREAM variable in the manner I want to use it (to recap: killing Mulahey, stealing Tazok’s papers, killing Davaeorn all advance the Chapter – and thus the CHAPTER global – as in the vanilla game, but can be done in any order, and the resulting dream content must refer to what the player did in order to trigger the dream). I just have to set the DREAM global to the necessary number as and when required.

(6) To provide an example for the previous point: if the order of the game is such that the player is advancing to Chapter 5 by stealing Tazok’s papers in the Bandit Camp, the DREAM global needs to be set to 3 in the same script sequence that advances the CHAPTER global to 5. As required, the player will then dream about the Bandit Camp (hole in the earth, etc) despite it being Chapter 5, at which point the DREAM global advances to 4.

(7) One downside of doing this without any change to the existing DRMTEXTX.2DA is that the player would sometimes get Slow Poison/Horror as their second innate ability, or a second instance of Cure Light Wounds/Larloch’s Minor Drain as their fourth innate ability. Not sure how easy it is to script around that? If it was the only downside that would be fine.

(8) In the example given, I don’t know how easy it would be to reliably script for the game to set the DREAM global back to 5 after the dream about the Bandit Camp. If this cannot be done, I believe that the player also ends up with a second instance of the Cloakwood dream (tide of blood; etc) and associated special ability, long after they dealt with Davaeorn, as the game will ensure that a DREAM global at 4 is incremented to match the CHAPTER global at 5.

(9) I didn’t spend much time thinking about the previous example, because I think that everything goes to hell with this method unless the player advances the game in a rigid order: Chapter, Dream; Chapter, Dream; etc, only performing the task that gets them to the next chapter once they have the dream for the chapter they are currently in.

(10) On the basis of my assumptions, it seems I have to create my own global variable to manage the dreams, and disable the DREAM global as described above. Am I right?


Given the assumptions I’ve made, I’ve written the following code (within spoilers). As I said, it does work. The journal works as in the vanilla game and advances through Chapters 2-5 regardless of the order in which the player (a) kills Mulahey; (b) steals Tazok’s papers; (c) kills Davaeorn. The player gets no more than one dream per night, and no more than one dream for each chapter, but can dream multiple times in one chapter if they need to ‘catch up’. The image, text screen, and audio matches whatever the player did to trigger the chapter transition. The ability awarded matches the player’s Rep when the dream happens. And the abilities are awarded in the same order as in the vanilla game (so CLW; CLW; Slow Poison; Slow Poision if ‘good’ throughout).


First, a few quick questions/clarifications:

(A) At multiple places my script has IncrementChapter("") then TextScreen("") on consecutive lines. The 2DAs to be referenced don't yet exist, but I obviously won't be using CHPTXT3.2DA and so on. Should this be IncrementGlobal("Chapter","GLOBAL",1) then TextScreen("2DAfileofchoice")? Given that I won't be using the 2DAs that the game would expect from IncrementChapter, might I be inviting trouble by using that action?

(B) The 2DA files used in my dream scripting are the existing DRMTXT.2DA files (a) copied; (b) renamed; (c) with the MOS specified in line 2 so it doesn't go looking at BGEE.LUA and do something I don't understand. This was just for convenience while testing, but then I noticed something...

(C) ... I noticed that using TextScreen on the existing DRMTXT.2DA files, as described above, preserves the existing functionality from the DRMTXT.2DA whereby the Rep of the player is detected and the correct string (and audio) is used. However, the award of the innate ability was not preserved. In theory, this is good, as it allows me to just use the one .2DA file for each dream (rather than needing two; one for Good Rep, one for Evil Rep). But... I don't understand why part of the functionality was preserved. Anyone? And should the lines for Good_Power etc be deleted, if they aren't doing anything?

(D) The triggers used to begin a new chapter are identical to the vanilla game. Nothing needs checking there.

(E) Text strings and quests relating to AddJournalEntry are irrelevant. I just left it in the script so I had visual feedback that things were working as I tested it.

(F) I deleted innumerable EraseJournalEntry actions for brevity (from the script and/or what I'm posting here).

(G) I used the prefix BK_ for my global variables. BK_Dream works much like DREAM. BK_NMines_Done has values of 0 and 1, for whether CHARNAME has, or has not, killed Mulahey and taken his letters. BK_NMines has values of 2, 3, or 4, which correspond to the value of the CHAPTER global immediately before Mulahey was killed and his letters taken. Cloakwood and Bandit Camp are treated in exactly the same way. Everything else has descriptive names and should I think be understood as it is read in context.


Phew. So, here it is (sorry, written with actual Notepad):

At the beginning of the game (in ch1cut04.BCS):
	IncrementChapter("Chptxt1")
        AddJournalEntry(16190,INFO)  // You awake with the realization ... etc
        EraseJournalEntry(31438)  // Find Gorion Gorion, my foster father, ... etc
        AddJournalEntry(31439,QUEST)  // Go to the Friendly Arm Inn ... etc
        MoveViewObject(Player1,INSTANT)
        FadeFromColor([4.0],0)
SetGlobal("BK_Dream","GLOBAL",1)
        EndCutSceneMode()
        SmallWait(4)
        SetGlobal("BD_Chapter_Save","GLOBAL",1)
        SaveGame(11)
        SaveGame(0)
END

(Bit I added is left-aligned. This is the last of the Gorion cutscenes at the end of the Prologue. I think that this is needed somewhere so my code doesn't try to play dreams in Chapter 1. Is it better placed somewhere else?)

On entering Nashkel to trigger Chapter 2 (in AR4800.BCS):
IF
    Global("Chapter","GLOBAL",1)
    !InPartyAllowDead("Xzar")  // Xzar
    !InPartyAllowDead("Montaron")  // Montaron
    !InPartyAllowDead("Jaheira")  // Jaheira
    !InPartyAllowDead("Khalid")  // Khalid
THEN
    RESPONSE #100
        StartMovie("NASHKELL")
        BreakInstants()
        IncrementChapter("")
SetGlobal("Dream","GLOBAL",2)
        AddJournalEntry(15836,INFO)  // With your hurried flight from Candlekeep ... etc
        AddJournalEntry(31442,QUEST)  // Speak to the Mayor of Nashkel ... etc
END

(Bit I added is left-aligned. The dream in Chapter 2 could be done by the unmodded game, but letting that happen and having the player begin Chapter 3 without having dreamt is bad. Better if modded code handles Chapter 2 dream as well. I’m aware I need similar code elsewhere in AR4800.BCS, in the scripts for the Nashkel Carnival and the Nashkel Mines exterior. If I make it theoretically possible to reach them in Chapter 1, something similar is needed in the Bandit Camp and Cloakwood Mines exterior)

Killing Mulahey in Nashkel Mines to trigger a new chapter (in AR5405.BCS):
IF
    Global("CDLetterCheckscrl2v","GLOBAL",0)
    PartyHasItem("SCRL2V")  // Letter
THEN
    RESPONSE #100
        SetGlobal("CDLetterCheckscrl2v","GLOBAL",1)
END

IF
    !ActuallyInCombat()
    Global("CDLetterCheckscrl2v","GLOBAL",1)
    Global("BK_NMines_Done","GLOBAL",0)
    Global("BK_BCamp_Done","GLOBAL",0)
    Global("BK_CWood_Done","GLOBAL",0)
THEN
    RESPONSE #100
        Wait(2)
        SetGlobal("BK_NMines_Done","GLOBAL",1)
        IncrementChapter("")
        TextScreen("")
        AddJournalEntry(15837,INFO)  // It is certain that the death of Mulahey will relieve the fears ... etc
        SetGlobal("Dream","GLOBAL",3)
        SetGlobal("BK_NMines","GLOBAL",2)
END

IF
    !ActuallyInCombat()
    Global("CDLetterCheckscrl2v","GLOBAL",1)
    Global("BK_NMines_Done","GLOBAL",0)
    Global("BK_BCamp_Done","GLOBAL",1)
    Global("BK_CWood_Done","GLOBAL",0)
THEN
    RESPONSE #100
        Wait(2)
        SetGlobal("BK_NMines_Done","GLOBAL",1)
        IncrementChapter("")
        TextScreen("")
        AddJournalEntry(15837,INFO)  // It is certain that the death of Mulahey will relieve the fears ... etc
        SetGlobal("Dream","GLOBAL",4)
        SetGlobal("BK_NMines","GLOBAL",3)
END

IF
    !ActuallyInCombat()
    Global("CDLetterCheckscrl2v","GLOBAL",1)
    Global("BK_NMines_Done","GLOBAL",0)
    Global("BK_BCamp_Done","GLOBAL",0)
    Global("BK_CWood_Done","GLOBAL",1)
THEN
    RESPONSE #100
        Wait(2)
        SetGlobal("BK_NMines_Done","GLOBAL",1)
        IncrementChapter("")
        TextScreen("")
        AddJournalEntry(15837,INFO)  // It is certain that the death of Mulahey will relieve the fears ... etc
        SetGlobal("Dream","GLOBAL",4)
        SetGlobal("BK_NMines","GLOBAL",3)
END

IF
    !ActuallyInCombat()
    Global("CDLetterCheckscrl2v","GLOBAL",1)
    Global("BK_NMines_Done","GLOBAL",0)
    Global("BK_BCamp_Done","GLOBAL",1)
    Global("BK_CWood_Done","GLOBAL",1)
THEN
    RESPONSE #100
        Wait(2)
        SetGlobal("BK_NMines_Done","GLOBAL",1)
        IncrementChapter("")
        TextScreen("")
        AddJournalEntry(15837,INFO)  // It is certain that the death of Mulahey will relieve the fears ... etc
        SetGlobal("Dream","GLOBAL",5)
        SetGlobal("BK_NMines","GLOBAL",4)
END

IF
    Global("Chapter","GLOBAL",5)
    Global("BK_To_Baldur's_Gate","GLOBAL",0)
THEN
    RESPONSE #100
        SetGlobal("BK_To_Baldur's_Gate","GLOBAL",1)
        RevealAreaOnMap("AR0900")  // Wyrm's Crossing (bridge to BG, Tenya, Quayle)
END

(No point in showing script for AR5404.BCS as well, but I know it needs similar lines)

Stealing Tazok's letters in the Bandit Camp to trigger a new chapter (in BALDUR.BCS):
IF
    Global("CDLetterCheckscrl2z","GLOBAL",1)
    !ActuallyInCombat()
    Global("BK_NMines_Done","GLOBAL",0)
    Global("BK_BCamp_Done","GLOBAL",0)
    Global("BK_CWood_Done","GLOBAL",0)
THEN
    RESPONSE #100
        Wait(2)
        SetGlobal("BK_BCamp_Done","GLOBAL",1)
        IncrementChapter("")
        TextScreen("")
        AddJournalEntry(15838,INFO)  // Mulahey and Tazok have proven to be nothing more than puppets ... etc
        AddJournalEntry(31451,QUEST)  // Cloakwood The investigation of the bandit camp has directed ... etc
        SetGlobal("Dream","GLOBAL",3)
        SetGlobal("BK_BCamp","GLOBAL",2)
END

IF
    Global("CDLetterCheckscrl2z","GLOBAL",1)
    !ActuallyInCombat()
    Global("BK_NMines_Done","GLOBAL",1)
    Global("BK_BCamp_Done","GLOBAL",0)
    Global("BK_CWood_Done","GLOBAL",0)
THEN
    RESPONSE #100
        Wait(2)
        SetGlobal("BK_BCamp_Done","GLOBAL",1)
        IncrementChapter("")
        TextScreen("")
        AddJournalEntry(15838,INFO)  // Mulahey and Tazok have proven to be nothing more than puppets ... etc
        AddJournalEntry(31451,QUEST)  // Cloakwood The investigation of the bandit camp has directed ... etc
        SetGlobal("Dream","GLOBAL",4)
        SetGlobal("BK_BCamp","GLOBAL",3)
END

IF
    Global("CDLetterCheckscrl2z","GLOBAL",1)
    !ActuallyInCombat()
    Global("BK_NMines_Done","GLOBAL",0)
    Global("BK_BCamp_Done","GLOBAL",0)
    Global("BK_CWood_Done","GLOBAL",1)
THEN
    RESPONSE #100
        Wait(2)
        SetGlobal("BK_BCamp_Done","GLOBAL",1)
        IncrementChapter("")
        TextScreen("")
        AddJournalEntry(15838,INFO)  // Mulahey and Tazok have proven to be nothing more than puppets ... etc
        AddJournalEntry(31451,QUEST)  // Cloakwood The investigation of the bandit camp has directed ... etc
        SetGlobal("Dream","GLOBAL",4)
        SetGlobal("BK_BCamp","GLOBAL",3)
END

IF
    Global("CDLetterCheckscrl2z","GLOBAL",1)
    !ActuallyInCombat()
    Global("BK_NMines_Done","GLOBAL",1)
    Global("BK_BCamp_Done","GLOBAL",0)
    Global("BK_CWood_Done","GLOBAL",1)
THEN
    RESPONSE #100
        Wait(2)
        SetGlobal("BK_BCamp_Done","GLOBAL",1)
        IncrementChapter("")
        TextScreen("")
        AddJournalEntry(15838,INFO)  // Mulahey and Tazok have proven to be nothing more than puppets ... etc
        AddJournalEntry(31451,QUEST)  // Cloakwood The investigation of the bandit camp has directed ... etc
        SetGlobal("Dream","GLOBAL",5)
        SetGlobal("BK_BCamp","GLOBAL",4)
END

IF
    Global("Chapter","GLOBAL",5)
    Global("BK_To_Baldur's_Gate","GLOBAL",0)
THEN
    RESPONSE #100
        SetGlobal("BK_To_Baldur's_Gate","GLOBAL",1)
        RevealAreaOnMap("AR0900")  // Wyrm's Crossing (bridge to BG, Tenya, Quayle)
END

(I just stuck this where the existing lines were in BALDUR.BCS. Note that SetGlobal("CDLetterCheckscrl2z","GLOBAL",1) happens in Tazok's Tent)

Killing Davaeorn in Cloakwood to trigger a new chapter (in AR1803.BCS):
IF
    Dead("Davaeorn")  // Davaeorn
    Global("BK_NMines_Done","GLOBAL",0)
    Global("BK_BCamp_Done","GLOBAL",0)
    Global("BK_CWood_Done","GLOBAL",0)
THEN
    RESPONSE #100
        SetGlobal("BK_CWood_Done","GLOBAL",1)
        IncrementChapter("")
        TextScreen("")
        AddJournalEntry(15839,INFO)  // You have dealt a great blow to the organization known as .... etc
        SetGlobal("Dream","GLOBAL",3)
        SetGlobal("BK_CWood","GLOBAL",2)
END

IF
    Dead("Davaeorn")  // Davaeorn
    Global("BK_NMines_Done","GLOBAL",1)
    Global("BK_BCamp_Done","GLOBAL",0)
    Global("BK_CWood_Done","GLOBAL",0)
THEN
    RESPONSE #100
        SetGlobal("BK_CWood_Done","GLOBAL",1)
        IncrementChapter("")
        TextScreen("")
        AddJournalEntry(15839,INFO)  // You have dealt a great blow to the organization known as .... etc
        SetGlobal("Dream","GLOBAL",4)
        SetGlobal("BK_CWood","GLOBAL",3)
END

IF
    Dead("Davaeorn")  // Davaeorn
    Global("BK_NMines_Done","GLOBAL",0)
    Global("BK_BCamp_Done","GLOBAL",1)
    Global("BK_CWood_Done","GLOBAL",0)
THEN
    RESPONSE #100
        SetGlobal("BK_CWood_Done","GLOBAL",1)
        IncrementChapter("")
        TextScreen("")
        AddJournalEntry(15839,INFO)  // You have dealt a great blow to the organization known as .... etc
        SetGlobal("Dream","GLOBAL",4)
        SetGlobal("BK_CWood","GLOBAL",3)
END

IF
    Dead("Davaeorn")  // Davaeorn
    Global("BK_NMines_Done","GLOBAL",1)
    Global("BK_BCamp_Done","GLOBAL",1)
    Global("BK_CWood_Done","GLOBAL",0)
THEN
    RESPONSE #100
        SetGlobal("BK_CWood_Done","GLOBAL",1)
        IncrementChapter("")
        TextScreen("")
        AddJournalEntry(15839,INFO)  // You have dealt a great blow to the organization known as .... etc
        SetGlobal("Dream","GLOBAL",5)
        SetGlobal("BK_CWood","GLOBAL",4)
END

IF
    Global("Chapter","GLOBAL",5)
    Global("BK_To_Baldur's_Gate","GLOBAL",0)
THEN
    RESPONSE #100
        SetGlobal("BK_To_Baldur's_Gate","GLOBAL",1)
        RevealAreaOnMap("AR0900")  // Wyrm's Crossing (bridge to BG, Tenya, Quayle)
END

(There is another script, ENDCHA4.BCS, that also advances the chapter upon the death of Davaeorn. However, the code doesn't seem to be attached to anything that would trigger it... I think it is orphan code that used to be attached to the travel trigger in the lift in BG1, but I’m not sure. Anyone know about this?)

Is it just me, or is RevealAreaOnMap("AR0900") // Wyrm's Crossing pointless script? I'm sure my unmodded game begins with Wyrm's Crossing already revealed... Either way, it was in AR1803.BCS, and it's a useful stand in for "action that needs to happen when my flexible plot merges with the rigid plot" (if Chapter 5 is the point in the game for that to happen).

Tracking and triggering the dreams and award of innate abilities (in BALDUR.BCS):
IF
    PartyRested()
    GlobalsLT("BK_Dream","Chapter")
THEN
    RESPONSE #100
        SetGlobal("BK_Dream_Text_Screen","GLOBAL",1)
        FadeToColor([35.0],0)
END

IF
    Global("BK_Dream_Text_Screen","GLOBAL",1)
    Global("BK_Dream_Rep","GLOBAL",0)
    ReputationGT(Player1,9)
THEN
    RESPONSE #100
        SetGlobal("BK_Dream_Rep","GLOBAL",1)
END

IF
    Global("BK_Dream_Text_Screen","GLOBAL",1)
    Global("BK_Dream_Rep","GLOBAL",0)
    ReputationLT(Player1,10)
THEN
    RESPONSE #100
        SetGlobal("BK_Dream_Rep","GLOBAL",2)
END

IF
    Global("BK_Dream_Text_Screen","GLOBAL",1)
    Global("BK_Dream","GLOBAL",1)
THEN
    RESPONSE #100
        TextScreen("BK_DrmC2")
        SetGlobal("BK_Dream_Text_Screen","GLOBAL",0)
END

IF
    Global("BK_Dream_Text_Screen","GLOBAL",1)
    Global("BK_Dream","GLOBAL",2)
    Global("BK_NMines","GLOBAL",2)
THEN
    RESPONSE #100
        TextScreen("BK_DrmNM")
        SetGlobal("BK_Dream_Text_Screen","GLOBAL",0)
END

IF
    Global("BK_Dream_Text_Screen","GLOBAL",1)
    Global("BK_Dream","GLOBAL",2)
    Global("BK_BCamp","GLOBAL",2)
THEN
    RESPONSE #100
        TextScreen("BK_DrmBC")
        SetGlobal("BK_Dream_Text_Screen","GLOBAL",0)
END

IF
    Global("BK_Dream_Text_Screen","GLOBAL",1)
    Global("BK_Dream","GLOBAL",2)
    Global("BK_CWood","GLOBAL",2)
THEN
    RESPONSE #100
        TextScreen("BK_DrmCW")
        SetGlobal("BK_Dream_Text_Screen","GLOBAL",0)
END

IF
    Global("BK_Dream_Rep","GLOBAL",1)
    OR(2)
        Global("BK_Dream","GLOBAL",1)
        Global("BK_Dream","GLOBAL",2)
THEN
    RESPONSE #100
        SetGlobal("BK_Dream_Rep","GLOBAL",0)
        IncrementGlobal("BK_Dream","GLOBAL",1)
        ActionOverride(Player1,AddSpecialAbility("SPIN101"))  // Cure Light Wounds
        FadeFromColor([40.0],0)
END

IF
    Global("BK_Dream_Rep","GLOBAL",2)
    OR(2)
        Global("BK_Dream","GLOBAL",1)
        Global("BK_Dream","GLOBAL",2)
THEN
    RESPONSE #100
        SetGlobal("BK_Dream_Rep","GLOBAL",0)
        IncrementGlobal("BK_Dream","GLOBAL",1)
        ActionOverride(Player1,AddSpecialAbility("SPIN104"))  // Larloch's Minor Drain
        FadeFromColor([40.0],0)
END

IF
    Global("BK_Dream_Text_Screen","GLOBAL",1)
    Global("BK_Dream","GLOBAL",3)
    Global("BK_NMines","GLOBAL",3)
THEN
    RESPONSE #100
        TextScreen("BK_DrmNM")
        SetGlobal("BK_Dream_Text_Screen","GLOBAL",0)
END

IF
    Global("BK_Dream_Text_Screen","GLOBAL",1)
    Global("BK_Dream","GLOBAL",3)
    Global("BK_BCamp","GLOBAL",3)
THEN
    RESPONSE #100
        TextScreen("BK_DrmBC")
        SetGlobal("BK_Dream_Text_Screen","GLOBAL",0)
END

IF
    Global("BK_Dream_Text_Screen","GLOBAL",1)
    Global("BK_Dream","GLOBAL",3)
    Global("BK_CWood","GLOBAL",3)
THEN
    RESPONSE #100
        TextScreen("BK_DrmCW")
        SetGlobal("BK_Dream_Text_Screen","GLOBAL",0)
END

IF
    Global("BK_Dream_Text_Screen","GLOBAL",1)
    Global("BK_Dream","GLOBAL",4)
    Global("BK_NMines","GLOBAL",4)
THEN
    RESPONSE #100
        TextScreen("BK_DrmNM")
        SetGlobal("BK_Dream_Text_Screen","GLOBAL",0)
END

IF
    Global("BK_Dream_Text_Screen","GLOBAL",1)
    Global("BK_Dream","GLOBAL",4)
    Global("BK_BCamp","GLOBAL",4)
THEN
    RESPONSE #100
        TextScreen("BK_DrmBC")
        SetGlobal("BK_Dream_Text_Screen","GLOBAL",0)
END

IF
    Global("BK_Dream_Text_Screen","GLOBAL",1)
    Global("BK_Dream","GLOBAL",4)
    Global("BK_CWood","GLOBAL",4)
THEN
    RESPONSE #100
        TextScreen("BK_DrmCW")
        SetGlobal("BK_Dream_Text_Screen","GLOBAL",0)
END

IF
    Global("BK_Dream_Rep","GLOBAL",1)
    OR(2)
        Global("BK_Dream","GLOBAL",3)
        Global("BK_Dream","GLOBAL",4)
THEN
    RESPONSE #100
        SetGlobal("BK_Dream_Rep","GLOBAL",0)
        IncrementGlobal("BK_Dream","GLOBAL",1)
        ActionOverride(Player1,AddSpecialAbility("SPIN102"))  // Slow Poison
        FadeFromColor([40.0],0)
END

IF
    Global("BK_Dream_Rep","GLOBAL",2)
    OR(2)
        Global("BK_Dream","GLOBAL",3)
        Global("BK_Dream","GLOBAL",4)
THEN
    RESPONSE #100
        SetGlobal("BK_Dream_Rep","GLOBAL",0)
        IncrementGlobal("BK_Dream","GLOBAL",1)
        ActionOverride(Player1,AddSpecialAbility("SPIN105"))  // Horror
        FadeFromColor([40.0],0)
END

(Script is written as if the game stops at Chapter 5. I either need a line to shut off my dream cycle, or I need to allow my dream cycle to handle the Chapter 6 and Chapter 7 dreams. The latter is probably better. Seems easy enough)

I really have no idea if the dream script in particular is any good. Also, there are two specific issues I can identify:

(1) BALDUR.BCS already uses a PartyRested() action, which I deleted while testing my dream script:
IF
    PartyRested()
THEN
    RESPONSE #100
        SmallWait(1)
END

I'm not 100% on the best way to re-enable this functionality with my dream script, and whether to change SmallWait at all given the additional code.

(2) The dreams do not trigger as smoothly as I would like.

In the vanilla game, when a dream triggers, the dream text screen replaces the on-rest movie. With my current implementation, the on-rest movie plays, then the screen returns to normal, and then the dream text screen plays. I really don't mind the on-rest movie playing first (I may actually even prefer that). But I hate, hate, HATE having a noticeable return to the post-rest screen in between the on-rest movie and the dream text screen!

The sequence looks particularly bad when resting at an inn, because you "wake" to the inn's rooms menu. That is behaviour from the vanilla game that I would like to see removed. Can this be done? The FadeToColor and FadeFromColor was my first attempt at addressing the overall problem, and it is not great. The FadeFromColor helps a little, but should probably be slower. The FadeToColor is terrible, although I haven't tried slowing that down as well.

I was also wondering if it is possible to either (a) have the rest action always implement a FadetoColor; or (b) dynamically disable the on-rest movie during a game when a dream is due to play, and re-enable the on-rest movie afterwards? In the latter case, note that my script has a dream happen 100% of the time when my BK_Dream global is lower than the CHAPTER global, so that probably helps matters somewhat.
Post edited by The_Baffled_King on

Comments

  • The_Baffled_KingThe_Baffled_King Member Posts: 147
    Eh, perhaps I should not have made the post that I did on April Fools' Day... I am serious, albeit quite possibly misguided!

    Here follows another crosspost from Gibberlings 3:

    I've gone back to the issue of the dreams not triggering smoothly from a visual standpoint, and it is now sorted to an acceptable standard (I've edited the code in the spoiler second from bottom in my previous post to reflect the changes).

    Previously, the sequence was:

    Rest Movie ---> FadeToColor([0.0],0) ---> Dream Text Screen ---> FadeFromColor([20.0],0) ---> Wake up with the rooms menu open (if resting at an inn).

    It is now:

    Rest Movie ---> FadeToColor([35.0],0) ---> Dream Text Screen ---> FadeFromColor([40.0],0) ---> Wake up with the rooms menu closed (the store as a whole is closed).

    The FadeToColor at 35 makes the switch from dark colours (rest movie), to lighter colours (the normal screen), and back to dark colours (the dream itself) far easier on the eye, and the subsequent FadeFromColor basically mirrors the previous FadeToColor.

    But getting rid of the rooms menu on waking really makes the sequence look far, far better. Note that the change means that clicking the "Rest" button at an inn (on the screen where it asks "are you sure you wish to rest?") will always close the store, regardless of whether a dream is queued up. This seems like a feature, not a bug; I bet that countless hours have been wasted by players the world over being forced to click to close the store the morning after resting. How does this all sound to other people?

    I'm still curious about whether it's possible to disable and re-enable the on-rest movie mid-game with BCS script, but that seems less important now. I am far more interested in the general robustness, or otherwise, of the code I've used and the assumptions made. All input is appreciated!
Sign In or Register to comment.