Skip to content

Help fixing stutter bug on Yoshimo?

Could use a hand fixing the stutter bug. The block that seems to be causing the problem is the following:
IF
    InParty(Myself)
    RealGlobalTimerExpired("I#YoshimoTalksPC2","GLOBAL")
    Global("PCYosh","LOCALS",2)
    See(Player1)
    !StateCheck(Player1,STATE_SLEEPING)
    CombatCounter(0)
    Global("BYoshimo5","LOCALS",0)
THEN
    RESPONSE #100
        DisplayStringHead(Myself,145914)  // Running block 25 of YOSHIMO.BCS
        Interact(Player1)
END

Unfortunately I have no idea what to do with this. I'm using both IEP Extended Banters and the Yoshimo Friendship mod.

Comments

  • jmerryjmerry Member Posts: 3,830
    Nothing, because that's only half the problem. The other half is which conversation you're actually getting - it probably isn't the one that's supposed to be tied to that script block. That's how stutter bugs usually work; the script conditions to activate one conversation are in place, but there's a mismatch with the dialogue and either a different conversation comes up or nothing's conditions are met. Either way, the variables that causes the conversation to start are still in place, and things repeat.

    Given the "Interact()" action, the relevant dialogue file here is the "banter" file BYOSHIM.DLG. Look at the conversation you're actually getting, and try to figure out which conversation you should be getting. What are those dialogues' conditions? What's the state of the variables involved, and how did you get there?

    Checking a vanilla version of the file ... actually, it looks like the conversation you're supposed to get from this script block is a vanilla one, starting with "I have pondered what you said about Bhaal." Except that the scripting to activate it doesn't exist in vanilla so it's inaccessible; it looks like "IEP Extended Banters" enabled a bit of cut dialogue here. At least, that's what I'm guessing from context and the variable starting with I#.
  • AklisAklis Member Posts: 11
    The relevant conversation seems to exist in my Override\BYOSHIM.DLG when viewed in NearInfinity.
    IF WEIGHT #5 /* Triggers after states #: 74 71 even though they appear after this state */
    ~  Global("PCYosh","LOCALS",2)
    Global("BYoshimo5","LOCALS",0)
    Global("I#Yoshimo_BY5","GLOBAL",2)
    See(Player1)
    !StateCheck(Player1,STATE_SLEEPING)
    ~ THEN BEGIN 39 // from:
      SAY #5124 /* ~I have pondered what you have said about Bhaal. Could it not be that Bhaal intended to be reborn through his children?~ [YOSHIM60] */
      IF ~~ THEN REPLY #5125 /* ~It is certainly something that I've thought about. It may be true.~ */ DO ~SetGlobal("BYoshimo5","LOCALS",1)
    ~ GOTO 40
      IF ~~ THEN REPLY #5126 /* ~I think that to be impossible. He is dead.~ */ DO ~SetGlobal("BYoshimo5","LOCALS",1)
    ~ GOTO 41
      IF ~~ THEN REPLY #5127 /* ~I don't want to talk about this, Yoshimo.~ */ DO ~SetGlobal("BYoshimo5","LOCALS",1)
    ~ GOTO 42
    END
    
  • jmerryjmerry Member Posts: 3,830
    Indeed, that's what I expected; a slightly edited version of the unused dialogue from the vanilla game. But as I said, that's only half the issue. Because that's not the conversation that you're actually getting; if you did get that conversation, it would set a variable at the first reply, that variable would be checked by the scripts and the dialogues, and you'd never see that conversation again. No stutter.

    To debug this one properly, you need to also look at the other half of this - the conversation you're actually getting when Yoshimo turns to talk to you. Which, so far, you have said absolutely nothing about.
  • AklisAklis Member Posts: 11
    edited July 2023
    Initially when block 25 triggers, Yoshimo starts the conversation with Aerie about how she saw a bird being eaten by ants, then it just keeps repeating block 25 without any effect. It should be mentioned that the conversation with Aerie automatically triggers immediately after CHARNAME's conversation with Yoshimo about Candlekeep and Gorion.

    EDIT: I tried triggering the Yoshimo-Aerie conversation before the CHARNAME-Yoshimo conversation could trigger, and then waited, but I get the same end result.
    Post edited by Aklis on
  • jmerryjmerry Member Posts: 3,830
    Aklis wrote: »
    Initially when block 25 triggers, Yoshimo starts the conversation with Aerie about how she saw a bird being eaten by ants...

    Right, that's a mod-added conversation; not in the original at all. But it does seem to be ruling itself out of repeating, so it's not too badly behaved. Looks like the issue is mainly about the conversation that should be tied to the block. Time to look at the variables being tested for.
    Two of them ("PCYosh" and "BYoshimo5") have the same conditions in the script and dialogue triggers. I don't think they're the problem. That leaves the two global variables.

    First, there's the timer in the script trigger, "I#YoshimoTalksPC2". From the immediate triggering after the previous conversation about Candlekeep and Gorion, this wasn't set properly. The previous conversation should set it; the vanilla version has a "SetGlobalTimer("YoshimoTalksPC2","GLOBAL",TEN_DAYS)" action, and the mod should presumably set the new timer instead, now that the dialogue that follows is accessible.

    Second, there's the global tracking variable "I#Yoshimo_BY5". It should be 2 for this conversation to start. I suspect it isn't, in your case. And me looking at the vanilla version of the dialogue definitely won't help.
    My best guess is that it's supposed to be set by the previous conversation, but that didn't happen.
  • AklisAklis Member Posts: 11
    I figured it out while writing this post. You were a huge help and I would never have figured it out on my own, so thank you.


    The blocks immediately after the first block are as follows:
    IF
        RealGlobalTimerExpired("YoshimoTalksPC3","GLOBAL")
        InParty(Myself)
        Global("I#Yoshimo_BY5","GLOBAL",1)
    THEN
        RESPONSE #100
            DisplayStringHead(Myself,145915)  // Running block 26 of YOSHIMO.BCS
            SetGlobal("I#Yoshimo_BY5","GLOBAL",2)
            RealSetGlobalTimer("I#YoshimoFriendTalksTimer","GLOBAL",TWELVE_HOURS)
            SetGlobal("I#YoshimoFriendshipActive","GLOBAL",2)
            SetGlobal("I#YoshimoFriendStart","GLOBAL",1)
    END
    
    IF
        RealGlobalTimerExpired("YoshimoTalksPC3","GLOBAL")
        InParty(Myself)
        Global("I#Yoshimo_BY5","GLOBAL",2)
        Global("BYoshimo5","LOCALS",0)
    THEN
        RESPONSE #100
            DisplayStringHead(Myself,145916)  // Running block 27 of YOSHIMO.BCS
            Interact(Player1)
    END
    

    I'm not sure if I'm understanding it correctly, but what I'm getting is that once "I#Yoshimo_BY5" equals 1 and the "YoshimoTalksPC3" timer expires, "I#Yoshimo_BY5" should automatically set to 2 (among other things). And as you suspected, looking at the Global Variables in EEKeeper confirms that it is 1. Setting it to 2 in EEKeeper (and with the console) triggers the conversation straight away once I load the game.

    Now, looking at BYOSHIM.D, I found this:
    IF WEIGHT #4 /* Triggers after states #: 74 71 even though they appear after this state */
    ~  Global("PCYosh","LOCALS",1)
    RealGlobalTimerExpired("I#YoshimoTalksPC2","GLOBAL")
    Global("BYoshimo4","LOCALS",0)
    See(Player1)
    !StateCheck(Player1,STATE_SLEEPING)
    ~ THEN BEGIN 24 // from:
      SAY #5082 /* ~Tell me, where did you spend your childhood?~ [YOSHIM59] */
      IF ~~ THEN REPLY #5084 /* ~In Candlekeep, a citadel to the north of Amn.~ */ DO ~RealSetGlobalTimer("YoshimoTalksPC3","GLOBAL",TWELVE_HOURS)
    SetGlobal("I#Yoshimo_BY5","GLOBAL",1)
    SetGlobal("BYoshimo4","LOCALS",1)
    ~ GOTO 25
      IF ~~ THEN REPLY #5085 /* ~I don't feel like exchanging pleasantries today, Yoshimo.~ */ DO ~RealSetGlobalTimer("YoshimoTalksPC3","GLOBAL",TWELVE_HOURS)
    SetGlobal("I#Yoshimo_BY5","GLOBAL",1)
    SetGlobal("BYoshimo4","LOCALS",1)
    ~ GOTO 26
    END
    

    In other words, the conversation preceding the one about pondering Bhaal sets "I#Yoshimo_BY5" to 1 and presumably sets a timer for twelve real hours.

    If my suspicions are correct, the stutter would fix itself after twelve real hours, as that would set "I#Yoshimo_BY5" to 2 alongside the other stuff.


    I just entered
    C:SetGlobal("YoshimoTalksPC3","GLOBAL",2)
    
    and right as rain it triggers on its own. I would assume the problem would disappear if the conversation was set to trigger on the expiration of "YoshimoTalksPC3" rather than "I#YoshimoTalksPC2".

    All this because the mod developer set the timer for twelve real hours.
  • jmerryjmerry Member Posts: 3,830
    edited July 2023
    TWELVE_HOURS is 3600 seconds, by the way - one real hour. The difference between a GlobalTimer and a RealGlobalTimer is in whether it looks at the in-game time or the system clock, not the scaling of how long things take. If you let the game run without any sort of pausing, resting, or traveling, it takes five real minutes for one in-game hour to pass.
    One real hour is a perfectly normal timer for these sorts of talks; the romances all use that or something close to it.

    And yes, switching that one block to check for "YoshimoTalksPC3" instead of "I#YoshimoTalksPC2" would fix the issue.

    It's possible that the underlying issue is a cross-mod incompatibility; it looks like the Yoshimo friendship mod starts up the friendship talks after this one, and I could easily see both that and the "Extended Banters" trying to restore the cut talk and getting in each other's way with different control variables.
  • AklisAklis Member Posts: 11
    I see. I'll leave it on in the background for an hour just to see what happens.

    Thanks again for the help.
  • AklisAklis Member Posts: 11
    I replaced "I#YoshimoTalksPC2" with "YoshimoTalksPC3" and now it triggered just right. The banter between Yoshimo and Aerie seems to be tied to the same trigger, because it fired as well, but at least now it seems to be working as intended.
Sign In or Register to comment.